Commit fe5fdbfc authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Add tests for encrypted AV1 10-bit playback

Also fix mime types used in pipeline_integration_test.cc which should
be 10-bit.

Bug: 884898
Test: Add more tests.
Change-Id: I16c5f4fd22c219a88a94c4d8727f5d1a676c3e10
Reviewed-on: https://chromium-review.googlesource.com/c/1290519Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601679}
parent d5eb2c0f
...@@ -91,7 +91,9 @@ const char kMp4Vp9Profile2VideoOnly[] = ...@@ -91,7 +91,9 @@ const char kMp4Vp9Profile2VideoOnly[] =
"video/mp4; codecs=\"vp09.02.10.10.01.02.02.02.00\""; "video/mp4; codecs=\"vp09.02.10.10.01.02.02.02.00\"";
#if BUILDFLAG(ENABLE_AV1_DECODER) #if BUILDFLAG(ENABLE_AV1_DECODER)
const char kWebMAv1VideoOnly[] = "video/webm; codecs=\"av01.0.04M.08\""; const char kWebMAv1VideoOnly[] = "video/webm; codecs=\"av01.0.04M.08\"";
const char kWebMAv110bitVideoOnly[] = "video/webm; codecs=\"av01.0.04M.10\"";
const char kMp4Av1VideoOnly[] = "video/mp4; codecs=\"av01.0.04M.08\""; const char kMp4Av1VideoOnly[] = "video/mp4; codecs=\"av01.0.04M.08\"";
const char kMp4Av110bitVideoOnly[] = "video/mp4; codecs=\"av01.0.04M.10\"";
#endif // BUILDFLAG(ENABLE_AV1_DECODER) #endif // BUILDFLAG(ENABLE_AV1_DECODER)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) #if BUILDFLAG(ENABLE_LIBRARY_CDMS)
const char kWebMVp8VideoOnly[] = "video/webm; codecs=\"vp8\""; const char kWebMVp8VideoOnly[] = "video/webm; codecs=\"vp8\"";
...@@ -634,6 +636,18 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_AV1) { ...@@ -634,6 +636,18 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_AV1) {
TestSimplePlayback("bear-av1-cenc.webm", kWebMAv1VideoOnly); TestSimplePlayback("bear-av1-cenc.webm", kWebMAv1VideoOnly);
} }
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_AV1_10bit) {
#if BUILDFLAG(ENABLE_WIDEVINE)
// TODO(crbug.com/884845): Update Widevine CDM to support AV1.
if (IsWidevine(CurrentKeySystem())) {
DVLOG(0) << "Skipping test - Widevine CDM does not support AV1";
return;
}
#endif
TestSimplePlayback("bear-av1-320x180-10bit-cenc.webm",
kWebMAv110bitVideoOnly);
}
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) { IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) {
// MP4 without MSE is not support yet, http://crbug.com/170793. // MP4 without MSE is not support yet, http://crbug.com/170793.
if (CurrentSourceType() != SrcType::MSE) { if (CurrentSourceType() != SrcType::MSE) {
...@@ -649,6 +663,22 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) { ...@@ -649,6 +663,22 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) {
#endif #endif
TestSimplePlayback("bear-av1-cenc.mp4", kMp4Av1VideoOnly); TestSimplePlayback("bear-av1-cenc.mp4", kMp4Av1VideoOnly);
} }
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1_10bit) {
// MP4 without MSE is not support yet, http://crbug.com/170793.
if (CurrentSourceType() != SrcType::MSE) {
DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE.";
return;
}
#if BUILDFLAG(ENABLE_WIDEVINE)
// TODO(crbug.com/884845): Update Widevine CDM to support AV1.
if (IsWidevine(CurrentKeySystem())) {
DVLOG(0) << "Skipping test - Widevine CDM does not support AV1";
return;
}
#endif
TestSimplePlayback("bear-av1-320x180-10bit-cenc.mp4", kMp4Av110bitVideoOnly);
}
#endif // BUILDFLAG(ENABLE_AV1_DECODER) #endif // BUILDFLAG(ENABLE_AV1_DECODER)
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) { IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) {
......
...@@ -143,7 +143,8 @@ class EncryptedMediaSupportedTypesTest : public InProcessBrowserTest { ...@@ -143,7 +143,8 @@ class EncryptedMediaSupportedTypesTest : public InProcessBrowserTest {
vp9_higher_profile_codecs_.push_back("vp09.03.10.10"); vp9_higher_profile_codecs_.push_back("vp09.03.10.10");
// AV1 codec string: https://aomediacodec.github.io/av1-isobmff/#codecsparam // AV1 codec string: https://aomediacodec.github.io/av1-isobmff/#codecsparam
av1_codecs_.push_back("av01.0.00M.10.0.112"); av1_codecs_.push_back("av01.0.04M.08"); // 8 bit
av1_codecs_.push_back("av01.0.00M.10.0.112"); // 10 bit
// Extended codecs are used, so make sure generic ones fail. These will be // Extended codecs are used, so make sure generic ones fail. These will be
// tested against all init data types as they should always fail to be // tested against all init data types as they should always fail to be
......
...@@ -71,7 +71,9 @@ const char kMp4Vp9Profile2VideoOnly[] = ...@@ -71,7 +71,9 @@ const char kMp4Vp9Profile2VideoOnly[] =
#if BUILDFLAG(ENABLE_AV1_DECODER) #if BUILDFLAG(ENABLE_AV1_DECODER)
const char kWebMAv1VideoOnly[] = "video/webm; codecs=\"av01.0.04M.08\""; const char kWebMAv1VideoOnly[] = "video/webm; codecs=\"av01.0.04M.08\"";
const char kWebMAv110bitVideoOnly[] = "video/webm; codecs=\"av01.0.04M.10\"";
const char kMp4Av1VideoOnly[] = "video/mp4; codecs=\"av01.0.04M.08\""; const char kMp4Av1VideoOnly[] = "video/mp4; codecs=\"av01.0.04M.08\"";
const char kMp4Av110bitVideoOnly[] = "video/mp4; codecs=\"av01.0.04M.10\"";
#endif // BUILDFLAG(ENABLE_AV1_DECODER) #endif // BUILDFLAG(ENABLE_AV1_DECODER)
// EME-specific test results and errors. // EME-specific test results and errors.
...@@ -325,6 +327,11 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_AV1) { ...@@ -325,6 +327,11 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_AV1) {
TestSimplePlayback("bear-av1-cenc.webm", kWebMAv1VideoOnly); TestSimplePlayback("bear-av1-cenc.webm", kWebMAv1VideoOnly);
} }
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_AV1_10bit) {
TestSimplePlayback("bear-av1-320x180-10bit-cenc.webm",
kWebMAv110bitVideoOnly);
}
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) { IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) {
// MP4 without MSE is not support yet, http://crbug.com/170793. // MP4 without MSE is not support yet, http://crbug.com/170793.
if (CurrentSourceType() != SrcType::MSE) { if (CurrentSourceType() != SrcType::MSE) {
...@@ -333,6 +340,15 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) { ...@@ -333,6 +340,15 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1) {
} }
TestSimplePlayback("bear-av1-cenc.mp4", kMp4Av1VideoOnly); TestSimplePlayback("bear-av1-cenc.mp4", kMp4Av1VideoOnly);
} }
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_AV1_10bit) {
// MP4 without MSE is not support yet, http://crbug.com/170793.
if (CurrentSourceType() != SrcType::MSE) {
DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE.";
return;
}
TestSimplePlayback("bear-av1-320x180-10bit-cenc.mp4", kMp4Av110bitVideoOnly);
}
#endif // BUILDFLAG(ENABLE_AV1_DECODER) #endif // BUILDFLAG(ENABLE_AV1_DECODER)
// Strictly speaking this is not an "encrypted" media test. Keep it here for // Strictly speaking this is not an "encrypted" media test. Keep it here for
......
...@@ -85,6 +85,9 @@ ffmpeg -i sfx.flac -map 0:0 -acodec copy -strict -2 -movflags frag_keyframe+empt ...@@ -85,6 +85,9 @@ ffmpeg -i sfx.flac -map 0:0 -acodec copy -strict -2 -movflags frag_keyframe+empt
### AV1 ### AV1
Unless noted otherwise, the codec string is `av01.0.04M.08` for 8-bit files,
and `av01.0.04M.10` for 10-bit files.
#### bear.y4m #### bear.y4m
Not an AV1 file, but all of the following commands rely on this file. It was Not an AV1 file, but all of the following commands rely on this file. It was
created using vpxdec with the following command: created using vpxdec with the following command:
...@@ -423,6 +426,9 @@ using key ID [1] and key [2]. ...@@ -423,6 +426,9 @@ using key ID [1] and key [2].
### AV1 ### AV1
Unless noted otherwise, the codec string is `av01.0.04M.08` for 8-bit files,
and `av01.0.04M.10` for 10-bit files.
#### bear-av1-cenc.mp4 #### bear-av1-cenc.mp4
Encrypted version of bear-av1.mp4. Encrypted by [Shaka Packager] built locally Encrypted version of bear-av1.mp4. Encrypted by [Shaka Packager] built locally
at commit 53aa775ea488c0ffd3a2e1cb78ad000154e414e1 using key ID [1] and key [2]. at commit 53aa775ea488c0ffd3a2e1cb78ad000154e414e1 using key ID [1] and key [2].
...@@ -436,6 +442,16 @@ packager in=bear-av1.mp4,stream=video,output=bear-av1-cenc.mp4 ...@@ -436,6 +442,16 @@ packager in=bear-av1.mp4,stream=video,output=bear-av1-cenc.mp4
#### bear-av1-cenc.webm #### bear-av1-cenc.webm
Same as bear-av1-cenc.mp4, except that the output name is bear-av1-cenc.webm. Same as bear-av1-cenc.mp4, except that the output name is bear-av1-cenc.webm.
#### bear-av1-320x180-10bit-cenc.mp4
Same as bear-av1-cenc.mp4, except that the input name is
bear-av1-320x180-10bit.mp4, and the output name is
bear-av1-320x180-10bit-cenc.mp4.
#### bear-av1-320x180-10bit-cenc.webm
Same as bear-av1-cenc.mp4, except that the input name is
bear-av1-320x180-10bit.webm, and the output name is
bear-av1-320x180-10bit-cenc.webm.
### Encryption Scheme Test ### Encryption Scheme Test
* bear-640x360-v_frag-cenc.mp4 * bear-640x360-v_frag-cenc.mp4
......
...@@ -116,7 +116,9 @@ const char kMP3[] = "audio/mpeg"; ...@@ -116,7 +116,9 @@ const char kMP3[] = "audio/mpeg";
#if BUILDFLAG(ENABLE_AV1_DECODER) #if BUILDFLAG(ENABLE_AV1_DECODER)
const char kMP4AV1[] = "video/mp4; codecs=\"av01.0.04M.08\""; const char kMP4AV1[] = "video/mp4; codecs=\"av01.0.04M.08\"";
const char kWebMAV1[] = "video/webm; codecs=\"av01.0.04M.08\""; const char kWebMAV1[] = "video/webm; codecs=\"av01.0.04M.08\"";
const int kAV110BitMp4FileDurationMs = 2735; const char kMP4AV110bit[] = "video/mp4; codecs=\"av01.0.04M.10\"";
const char kWebMAV110bit[] = "video/webm; codecs=\"av01.0.04M.10\"";
const int kAV110bitMp4FileDurationMs = 2735;
const int kAV1640WebMFileDurationMs = 2736; const int kAV1640WebMFileDurationMs = 2736;
#endif // BUILDFLAG(ENABLE_AV1_DECODER) #endif // BUILDFLAG(ENABLE_AV1_DECODER)
#if BUILDFLAG(USE_PROPRIETARY_CODECS) #if BUILDFLAG(USE_PROPRIETARY_CODECS)
...@@ -1540,7 +1542,7 @@ TEST_P(MSEPipelineIntegrationTest, BasicPlayback_AV1_10bit_WebM) { ...@@ -1540,7 +1542,7 @@ TEST_P(MSEPipelineIntegrationTest, BasicPlayback_AV1_10bit_WebM) {
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
scoped_feature_list_.InitAndEnableFeature(kAv1Decoder); scoped_feature_list_.InitAndEnableFeature(kAv1Decoder);
MockMediaSource source("bear-av1-320x180-10bit.webm", kWebMAV1, 19076); MockMediaSource source("bear-av1-320x180-10bit.webm", kWebMAV110bit, 19076);
EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source)); EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source));
source.EndOfStream(); source.EndOfStream();
...@@ -1930,13 +1932,13 @@ TEST_P(MSEPipelineIntegrationTest, BasicPlayback_AV1_MP4) { ...@@ -1930,13 +1932,13 @@ TEST_P(MSEPipelineIntegrationTest, BasicPlayback_AV1_MP4) {
TEST_P(MSEPipelineIntegrationTest, BasicPlayback_AV1_10bit_MP4) { TEST_P(MSEPipelineIntegrationTest, BasicPlayback_AV1_10bit_MP4) {
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
scoped_feature_list_.InitAndEnableFeature(kAv1Decoder); scoped_feature_list_.InitAndEnableFeature(kAv1Decoder);
MockMediaSource source("bear-av1-320x180-10bit.mp4", kMP4AV1, 19658); MockMediaSource source("bear-av1-320x180-10bit.mp4", kMP4AV110bit, 19658);
EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source)); EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source));
source.EndOfStream(); source.EndOfStream();
EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
EXPECT_EQ(kAV110BitMp4FileDurationMs, EXPECT_EQ(kAV110bitMp4FileDurationMs,
pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
Play(); Play();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment