diff options
author | zmo <zmo@chromium.org> | 2014-09-30 16:20:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-30 23:20:46 +0000 |
commit | de394fa4553674e0aa522ce7c3483394f0f40d3d (patch) | |
tree | 63972c851107a4ffba6159cbf8faad69e99c14ec /media | |
parent | ca73bb0e2d9f84c5dbcb738d1fca0e34269651f2 (diff) | |
download | chromium_src-de394fa4553674e0aa522ce7c3483394f0f40d3d.zip chromium_src-de394fa4553674e0aa522ce7c3483394f0f40d3d.tar.gz chromium_src-de394fa4553674e0aa522ce7c3483394f0f40d3d.tar.bz2 |
Revert of Pass initDataType instead of contentType on OnNeedKey(). (patchset #4 id:60001 of https://codereview.chromium.org/611513005/)
Reason for revert:
This broke media/encrypted-media/encrypted-media-needkey.html on Linux (at least)
Original issue's description:
> Pass initDataType instead of contentType to OnNeedKey().
>
> BUG=224786
>
> Committed: https://crrev.com/2983dc91cc0bc7be6014f4bfc5cb19cc6e262a0b
> Cr-Commit-Position: refs/heads/master@{#297523}
TBR=ddorwin@chromium.org,sandersd@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=224786
Review URL: https://codereview.chromium.org/616183002
Cr-Commit-Position: refs/heads/master@{#297538}
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/pipeline_integration_test.cc | 5 | ||||
-rw-r--r-- | media/formats/mp4/mp4_stream_parser.cc | 5 | ||||
-rw-r--r-- | media/formats/mp4/mp4_stream_parser_unittest.cc | 5 | ||||
-rw-r--r-- | media/formats/webm/webm_crypto_helpers.h | 5 |
4 files changed, 13 insertions, 7 deletions
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc index 27e6344..d9904f6 100644 --- a/media/filters/pipeline_integration_test.cc +++ b/media/filters/pipeline_integration_test.cc @@ -29,7 +29,6 @@ using testing::SaveArg; namespace media { const char kSourceId[] = "SourceId"; -const char kCencInitDataType[] = "cenc"; const uint8 kInitData[] = { 0x69, 0x6e, 0x69, 0x74 }; const char kWebM[] = "video/webm; codecs=\"vp8,vorbis\""; @@ -37,6 +36,8 @@ const char kWebMVP9[] = "video/webm; codecs=\"vp9\""; const char kAudioOnlyWebM[] = "video/webm; codecs=\"vorbis\""; const char kOpusAudioOnlyWebM[] = "video/webm; codecs=\"opus\""; const char kVideoOnlyWebM[] = "video/webm; codecs=\"vp8\""; +const char kMP4VideoType[] = "video/mp4"; +const char kMP4AudioType[] = "audio/mp4"; #if defined(USE_PROPRIETARY_CODECS) const char kADTS[] = "audio/aac"; const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; @@ -266,7 +267,7 @@ class KeyProvidingApp : public FakeEncryptedMedia::AppBase { // correct key ID. const uint8* key_id = init_data.empty() ? NULL : &init_data[0]; size_t key_id_length = init_data.size(); - if (type == kCencInitDataType) { + if (type == kMP4AudioType || type == kMP4VideoType) { key_id = kKeyId; key_id_length = arraysize(kKeyId); } diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc index c6163bf..7ad3ccc 100644 --- a/media/formats/mp4/mp4_stream_parser.cc +++ b/media/formats/mp4/mp4_stream_parser.cc @@ -22,7 +22,8 @@ namespace media { namespace mp4 { -static const char kCencInitDataType[] = "cenc"; +// TODO(xhwang): Figure out the init data type appropriately once it's spec'ed. +static const char kMp4InitDataType[] = "video/mp4"; MP4StreamParser::MP4StreamParser(const std::set<int>& audio_object_types, bool has_sbr) @@ -353,7 +354,7 @@ void MP4StreamParser::EmitNeedKeyIfNecessary( headers[i].raw_box.size()); pos += headers[i].raw_box.size(); } - need_key_cb_.Run(kCencInitDataType, init_data); + need_key_cb_.Run(kMp4InitDataType, init_data); } bool MP4StreamParser::PrepareAVCBuffer( diff --git a/media/formats/mp4/mp4_stream_parser_unittest.cc b/media/formats/mp4/mp4_stream_parser_unittest.cc index 5bcb7ad..c44e0ce 100644 --- a/media/formats/mp4/mp4_stream_parser_unittest.cc +++ b/media/formats/mp4/mp4_stream_parser_unittest.cc @@ -25,7 +25,8 @@ using base::TimeDelta; namespace media { namespace mp4 { -static const char kCencInitDataType[] = "cenc"; +// TODO(xhwang): Figure out the init data type appropriately once it's spec'ed. +static const char kMp4InitDataType[] = "video/mp4"; class MP4StreamParserTest : public testing::Test { public: @@ -121,7 +122,7 @@ class MP4StreamParserTest : public testing::Test { void KeyNeededF(const std::string& type, const std::vector<uint8>& init_data) { DVLOG(1) << "KeyNeededF: " << init_data.size(); - EXPECT_EQ(kCencInitDataType, type); + EXPECT_EQ(kMp4InitDataType, type); EXPECT_FALSE(init_data.empty()); } diff --git a/media/formats/webm/webm_crypto_helpers.h b/media/formats/webm/webm_crypto_helpers.h index d602e63..23095f3 100644 --- a/media/formats/webm/webm_crypto_helpers.h +++ b/media/formats/webm/webm_crypto_helpers.h @@ -11,7 +11,10 @@ namespace media { -const char kWebMEncryptInitDataType[] = "webm"; +// TODO(xhwang): Figure out the init data type appropriately once it's spec'ed. +// See https://www.w3.org/Bugs/Public/show_bug.cgi?id=19096 for more +// information. +const char kWebMEncryptInitDataType[] = "video/webm"; // Fills an initialized DecryptConfig, which can be sent to the Decryptor if // the stream has potentially encrypted frames. Also sets |data_offset| which |