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

Side by Side Diff: media/tools/seek_tester/seek_tester.cc

Issue 14217008: Remove reference counting from media::DemuxerStream and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/tools/demuxer_bench/demuxer_bench.cc ('k') | no next file » | 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 // This standalone binary is a helper for diagnosing seek behavior of the 5 // This standalone binary is a helper for diagnosing seek behavior of the
6 // demuxer setup in media/ code. It answers the question: "if I ask the demuxer 6 // demuxer setup in media/ code. It answers the question: "if I ask the demuxer
7 // to Seek to X ms, where will it actually seek to? (necessitating 7 // to Seek to X ms, where will it actually seek to? (necessitating
8 // frame-dropping until the original seek target is reached)". Sample run: 8 // frame-dropping until the original seek target is reached)". Sample run:
9 // 9 //
10 // $ ./out/Debug/seek_tester .../LayoutTests/media/content/test.ogv 6300 10 // $ ./out/Debug/seek_tester .../LayoutTests/media/content/test.ogv 6300
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 scoped_ptr<media::FFmpegDemuxer> demuxer(new media::FFmpegDemuxer( 76 scoped_ptr<media::FFmpegDemuxer> demuxer(new media::FFmpegDemuxer(
77 loop.message_loop_proxy(), file_data_source, need_key_cb)); 77 loop.message_loop_proxy(), file_data_source, need_key_cb));
78 demuxer->Initialize(&host, quitter); 78 demuxer->Initialize(&host, quitter);
79 loop.Run(); 79 loop.Run();
80 80
81 demuxer->Seek(base::TimeDelta::FromMilliseconds(seek_target_ms), quitter); 81 demuxer->Seek(base::TimeDelta::FromMilliseconds(seek_target_ms), quitter);
82 loop.Run(); 82 loop.Run();
83 83
84 uint64 audio_seeked_to_ms; 84 uint64 audio_seeked_to_ms;
85 uint64 video_seeked_to_ms; 85 uint64 video_seeked_to_ms;
86 scoped_refptr<media::DemuxerStream> audio_stream( 86 media::DemuxerStream* audio_stream =
87 demuxer->GetStream(media::DemuxerStream::AUDIO)); 87 demuxer->GetStream(media::DemuxerStream::AUDIO);
88 scoped_refptr<media::DemuxerStream> video_stream( 88 media::DemuxerStream* video_stream =
89 demuxer->GetStream(media::DemuxerStream::VIDEO)); 89 demuxer->GetStream(media::DemuxerStream::VIDEO);
90 LOG(INFO) << "Requested: " << seek_target_ms << "ms"; 90 LOG(INFO) << "Requested: " << seek_target_ms << "ms";
91 if (audio_stream) { 91 if (audio_stream) {
92 audio_stream->Read(base::Bind( 92 audio_stream->Read(base::Bind(
93 &TimestampExtractor, &audio_seeked_to_ms, &loop)); 93 &TimestampExtractor, &audio_seeked_to_ms, &loop));
94 loop.Run(); 94 loop.Run();
95 LOG(INFO) << " audio seeked to: " << audio_seeked_to_ms << "ms"; 95 LOG(INFO) << " audio seeked to: " << audio_seeked_to_ms << "ms";
96 } 96 }
97 if (video_stream) { 97 if (video_stream) {
98 video_stream->Read( 98 video_stream->Read(
99 base::Bind(&TimestampExtractor, &video_seeked_to_ms, &loop)); 99 base::Bind(&TimestampExtractor, &video_seeked_to_ms, &loop));
100 loop.Run(); 100 loop.Run();
101 LOG(INFO) << " video seeked to: " << video_seeked_to_ms << "ms"; 101 LOG(INFO) << " video seeked to: " << video_seeked_to_ms << "ms";
102 } 102 }
103 103
104 demuxer->Stop(base::Bind(&base::MessageLoop::Quit, base::Unretained(&loop))); 104 demuxer->Stop(base::Bind(&base::MessageLoop::Quit, base::Unretained(&loop)));
105 loop.Run(); 105 loop.Run();
106 106
107 return 0; 107 return 0;
108 } 108 }
OLDNEW
« no previous file with comments | « media/tools/demuxer_bench/demuxer_bench.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698