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

Side by Side Diff: chromecast/media/cma/test/frame_segmenter_for_test.cc

Issue 784493002: Encrypted Media: Rename NeedKey to EncryptedMediaInitData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years 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
« no previous file with comments | « no previous file | content/renderer/media/android/media_source_delegate.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/media/cma/test/frame_segmenter_for_test.h" 5 #include "chromecast/media/cma/test/frame_segmenter_for_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/port.h" 10 #include "base/port.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 scoped_refptr< ::media::DecoderBuffer> buffer( 256 scoped_refptr< ::media::DecoderBuffer> buffer(
257 ::media::DecoderBuffer::CopyFrom(&data[it->offset], it->size)); 257 ::media::DecoderBuffer::CopyFrom(&data[it->offset], it->size));
258 buffer->set_timestamp(it->poc * poc_duration); 258 buffer->set_timestamp(it->poc * poc_duration);
259 video_frames.push_back( 259 video_frames.push_back(
260 scoped_refptr<DecoderBufferBase>(new DecoderBufferAdapter(buffer))); 260 scoped_refptr<DecoderBufferBase>(new DecoderBufferAdapter(buffer)));
261 } 261 }
262 262
263 return video_frames; 263 return video_frames;
264 } 264 }
265 265
266 void OnDemuxerNeedKey(const std::string& type, 266 void OnEncryptedMediaInitData(const std::string& init_data_type,
267 const std::vector<uint8>& init_data) { 267 const std::vector<uint8>& init_data) {
268 LOG(FATAL) << "Unexpected test failure: file is encrypted."; 268 LOG(FATAL) << "Unexpected test failure: file is encrypted.";
269 } 269 }
270 270
271 void OnNewBuffer(BufferList* buffer_list, 271 void OnNewBuffer(BufferList* buffer_list,
272 const base::Closure& finished_cb, 272 const base::Closure& finished_cb,
273 ::media::DemuxerStream::Status status, 273 ::media::DemuxerStream::Status status,
274 const scoped_refptr< ::media::DecoderBuffer>& buffer) { 274 const scoped_refptr< ::media::DecoderBuffer>& buffer) {
275 CHECK_EQ(status, ::media::DemuxerStream::kOk); 275 CHECK_EQ(status, ::media::DemuxerStream::kOk);
276 CHECK(buffer.get()); 276 CHECK(buffer.get());
277 CHECK(buffer_list); 277 CHECK(buffer_list);
(...skipping 22 matching lines...) Expand all
300 300
301 DemuxResult::~DemuxResult() { 301 DemuxResult::~DemuxResult() {
302 } 302 }
303 303
304 DemuxResult FFmpegDemuxForTest(const base::FilePath& filepath, 304 DemuxResult FFmpegDemuxForTest(const base::FilePath& filepath,
305 bool audio) { 305 bool audio) {
306 FakeDemuxerHost fake_demuxer_host; 306 FakeDemuxerHost fake_demuxer_host;
307 ::media::FileDataSource data_source; 307 ::media::FileDataSource data_source;
308 CHECK(data_source.Initialize(filepath)); 308 CHECK(data_source.Initialize(filepath));
309 309
310 ::media::FFmpegDemuxer demuxer(base::MessageLoopProxy::current(), 310 ::media::FFmpegDemuxer demuxer(
311 &data_source, 311 base::MessageLoopProxy::current(), &data_source,
312 base::Bind(&OnDemuxerNeedKey), 312 base::Bind(&OnEncryptedMediaInitData), new ::media::MediaLog());
313 new ::media::MediaLog());
314 ::media::WaitableMessageLoopEvent init_event; 313 ::media::WaitableMessageLoopEvent init_event;
315 demuxer.Initialize(&fake_demuxer_host, 314 demuxer.Initialize(&fake_demuxer_host,
316 init_event.GetPipelineStatusCB(), 315 init_event.GetPipelineStatusCB(),
317 false); 316 false);
318 init_event.RunAndWaitForStatus(::media::PIPELINE_OK); 317 init_event.RunAndWaitForStatus(::media::PIPELINE_OK);
319 318
320 ::media::DemuxerStream* stream = demuxer.GetStream( 319 ::media::DemuxerStream* stream = demuxer.GetStream(
321 audio ? ::media::DemuxerStream::AUDIO : ::media::DemuxerStream::VIDEO); 320 audio ? ::media::DemuxerStream::AUDIO : ::media::DemuxerStream::VIDEO);
322 CHECK(stream); 321 CHECK(stream);
323 322
(...skipping 14 matching lines...) Expand all
338 CHECK(!demux_result.frames.empty()); 337 CHECK(!demux_result.frames.empty());
339 end_of_stream = demux_result.frames.back()->end_of_stream(); 338 end_of_stream = demux_result.frames.back()->end_of_stream();
340 } 339 }
341 340
342 demuxer.Stop(); 341 demuxer.Stop();
343 return demux_result; 342 return demux_result;
344 } 343 }
345 344
346 } // namespace media 345 } // namespace media
347 } // namespace chromecast 346 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/android/media_source_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698