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

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

Issue 10808087: Remove use of PipelineStatus from BufferedDataSource and FileDataSource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: status -> success Created 8 years, 5 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/player_x11/player_x11.cc ('k') | webkit/media/buffered_data_source.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 (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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 int main(int argc, char** argv) { 55 int main(int argc, char** argv) {
56 base::AtExitManager at_exit; 56 base::AtExitManager at_exit;
57 media::InitializeMediaLibraryForTesting(); 57 media::InitializeMediaLibraryForTesting();
58 58
59 CHECK_EQ(argc, 3) << "\nUsage: " << argv[0] << " <file> <seekTimeInMs>"; 59 CHECK_EQ(argc, 3) << "\nUsage: " << argv[0] << " <file> <seekTimeInMs>";
60 uint64 seek_target_ms; 60 uint64 seek_target_ms;
61 CHECK(base::StringToUint64(argv[2], &seek_target_ms)); 61 CHECK(base::StringToUint64(argv[2], &seek_target_ms));
62 scoped_refptr<media::FileDataSource> file_data_source( 62 scoped_refptr<media::FileDataSource> file_data_source(
63 new media::FileDataSource()); 63 new media::FileDataSource());
64 CHECK_EQ(file_data_source->Initialize(argv[1]), media::PIPELINE_OK); 64 CHECK(file_data_source->Initialize(argv[1]));
65 65
66 DemuxerHostImpl host; 66 DemuxerHostImpl host;
67 MessageLoop loop; 67 MessageLoop loop;
68 media::PipelineStatusCB quitter = base::Bind(&QuitMessageLoop, &loop); 68 media::PipelineStatusCB quitter = base::Bind(&QuitMessageLoop, &loop);
69 scoped_refptr<media::FFmpegDemuxer> demuxer( 69 scoped_refptr<media::FFmpegDemuxer> demuxer(
70 new media::FFmpegDemuxer(&loop, file_data_source)); 70 new media::FFmpegDemuxer(&loop, file_data_source));
71 demuxer->Initialize(&host, quitter); 71 demuxer->Initialize(&host, quitter);
72 loop.Run(); 72 loop.Run();
73 73
74 demuxer->Seek(base::TimeDelta::FromMilliseconds(seek_target_ms), quitter); 74 demuxer->Seek(base::TimeDelta::FromMilliseconds(seek_target_ms), quitter);
(...skipping 17 matching lines...) Expand all
92 base::Bind(&TimestampExtractor, &video_seeked_to_ms, &loop)); 92 base::Bind(&TimestampExtractor, &video_seeked_to_ms, &loop));
93 loop.Run(); 93 loop.Run();
94 LOG(INFO) << " video seeked to: " << video_seeked_to_ms << "ms"; 94 LOG(INFO) << " video seeked to: " << video_seeked_to_ms << "ms";
95 } 95 }
96 96
97 demuxer->Stop(base::Bind(&MessageLoop::Quit, base::Unretained(&loop))); 97 demuxer->Stop(base::Bind(&MessageLoop::Quit, base::Unretained(&loop)));
98 loop.Run(); 98 loop.Run();
99 99
100 return 0; 100 return 0;
101 } 101 }
OLDNEW
« no previous file with comments | « media/tools/player_x11/player_x11.cc ('k') | webkit/media/buffered_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698