Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 10910293: Add is_encrypted() in VideoDecoderConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/mp4/mp4_stream_parser.cc
diff --git a/media/mp4/mp4_stream_parser.cc b/media/mp4/mp4_stream_parser.cc
index b8f633131505f6c3eb458853238b4e554726bb75..b661997a083d3f67dabd8ac5614f7eacba4266c4 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -154,6 +154,8 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
AudioDecoderConfig audio_config;
VideoDecoderConfig video_config;
+ bool is_audio_encrypted = false;
+ bool is_video_encrypted = false;
for (std::vector<Track>::const_iterator track = moov_->tracks.begin();
track != moov_->tracks.end(); ++track) {
@@ -198,6 +200,8 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
LOG(ERROR) << "Unsupported audio object type.";
return false;
}
+
+ is_audio_encrypted = entry.sinf.info.track_encryption.is_encrypted;
RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption));
audio_config.Initialize(kCodecAAC, entry.samplesize,
@@ -219,6 +223,8 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
LOG(ERROR) << "Unsupported video format.";
return false;
}
+
+ is_video_encrypted = entry.sinf.info.track_encryption.is_encrypted;
RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption));
// TODO(strobe): Recover correct crop box
@@ -237,7 +243,8 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
}
}
- RCHECK(config_cb_.Run(audio_config, video_config));
+ RCHECK(config_cb_.Run(audio_config, video_config,
+ is_audio_encrypted, is_video_encrypted));
base::TimeDelta duration;
if (moov_->extends.header.fragment_duration > 0) {

Powered by Google App Engine
This is Rietveld 408576698