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

Unified Diff: media/webm/webm_tracks_parser.cc

Issue 11088047: Support encrypted audio stream in demuxer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, resolved comments and changed more, sorry! Created 8 years, 2 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
« media/webm/webm_stream_parser.cc ('K') | « media/webm/webm_tracks_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_tracks_parser.cc
diff --git a/media/webm/webm_tracks_parser.cc b/media/webm/webm_tracks_parser.cc
index bf039bf77bde53870e56cc3d0564cebde0c74762..dcc3331d44988d7d2061a42b2fee1536c61499d6 100644
--- a/media/webm/webm_tracks_parser.cc
+++ b/media/webm/webm_tracks_parser.cc
@@ -25,15 +25,6 @@ WebMTracksParser::WebMTracksParser()
WebMTracksParser::~WebMTracksParser() {}
-const std::string& WebMTracksParser::video_encryption_key_id() const {
- if (!video_content_encodings_client_.get())
- return EmptyString();
-
- DCHECK(!video_content_encodings_client_->content_encodings().empty());
- return video_content_encodings_client_->content_encodings()[0]->
- encryption_key_id();
-}
-
int WebMTracksParser::Parse(const uint8* buf, int size) {
track_type_ =-1;
track_num_ = -1;
@@ -50,7 +41,6 @@ int WebMTracksParser::Parse(const uint8* buf, int size) {
return parser.IsParsingComplete() ? result : 0;
}
-
WebMParserClient* WebMTracksParser::OnListStart(int id) {
if (id == kWebMIdContentEncodings) {
DCHECK(!track_content_encodings_client_.get());
@@ -84,14 +74,16 @@ bool WebMTracksParser::OnListEnd(int id) {
if (track_type_ == kWebMTrackTypeVideo) {
ddorwin 2012/10/11 05:18:22 Strange that video is processed first here. It see
xhwang 2012/10/11 16:36:10 Done.
video_track_num_ = track_num_;
if (track_content_encodings_client_.get()) {
- video_content_encodings_client_ =
- track_content_encodings_client_.Pass();
+ DCHECK(!track_content_encodings_client_->content_encodings().empty());
+ video_encryption_key_id_ = track_content_encodings_client_->
+ content_encodings()[0]->encryption_key_id();
ddorwin 2012/10/11 05:18:22 Why is it the first encoding? Maybe we should comm
xhwang 2012/10/11 16:36:10 Added more comments and more checks. fgalligan@: p
}
} else if (track_type_ == kWebMTrackTypeAudio) {
audio_track_num_ = track_num_;
if (track_content_encodings_client_.get()) {
- audio_content_encodings_client_ =
- track_content_encodings_client_.Pass();
+ DCHECK(!track_content_encodings_client_->content_encodings().empty());
+ audio_encryption_key_id_ = track_content_encodings_client_->
+ content_encodings()[0]->encryption_key_id();
}
} else {
DVLOG(1) << "Unexpected TrackType " << track_type_;
« media/webm/webm_stream_parser.cc ('K') | « media/webm/webm_tracks_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698