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

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 11313016: Add "type" in GenerateKeyRequest() and OnNeedKey(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the DCHECK where init_data_type_ is set but NeedKey from decoder passes empty "type". Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 if (!video_->Append(buffers)) 1109 if (!video_->Append(buffers))
1110 return false; 1110 return false;
1111 1111
1112 IncreaseDurationIfNecessary(buffers, video_); 1112 IncreaseDurationIfNecessary(buffers, video_);
1113 return true; 1113 return true;
1114 } 1114 }
1115 1115
1116 // TODO(acolwell): Remove bool from StreamParser::NeedKeyCB so that 1116 // TODO(acolwell): Remove bool from StreamParser::NeedKeyCB so that
1117 // this method can be removed and need_key_cb_ can be passed directly 1117 // this method can be removed and need_key_cb_ can be passed directly
1118 // to the parser. 1118 // to the parser.
1119 bool ChunkDemuxer::OnNeedKey(scoped_array<uint8> init_data, 1119 bool ChunkDemuxer::OnNeedKey(const std::string& type,
1120 scoped_array<uint8> init_data,
1120 int init_data_size) { 1121 int init_data_size) {
1121 lock_.AssertAcquired(); 1122 lock_.AssertAcquired();
1122 need_key_cb_.Run(init_data.Pass(), init_data_size); 1123 need_key_cb_.Run(type, init_data.Pass(), init_data_size);
1123 return true; 1124 return true;
1124 } 1125 }
1125 1126
1126 void ChunkDemuxer::OnNewMediaSegment(const std::string& source_id, 1127 void ChunkDemuxer::OnNewMediaSegment(const std::string& source_id,
1127 TimeDelta timestamp) { 1128 TimeDelta timestamp) {
1128 DCHECK(timestamp != kNoTimestamp()); 1129 DCHECK(timestamp != kNoTimestamp());
1129 DVLOG(2) << "OnNewMediaSegment(" << source_id << ", " 1130 DVLOG(2) << "OnNewMediaSegment(" << source_id << ", "
1130 << timestamp.InSecondsF() << ")"; 1131 << timestamp.InSecondsF() << ")";
1131 lock_.AssertAcquired(); 1132 lock_.AssertAcquired();
1132 1133
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1200
1200 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { 1201 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const {
1201 if (audio_ && !video_) 1202 if (audio_ && !video_)
1202 return audio_->GetBufferedRanges(duration_); 1203 return audio_->GetBufferedRanges(duration_);
1203 else if (!audio_ && video_) 1204 else if (!audio_ && video_)
1204 return video_->GetBufferedRanges(duration_); 1205 return video_->GetBufferedRanges(duration_);
1205 return ComputeIntersection(); 1206 return ComputeIntersection();
1206 } 1207 }
1207 1208
1208 } // namespace media 1209 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698