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

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

Issue 10535101: Replace Pipeline::SetNetworkActivity() with BufferedDataSource -> WebMediaPlayerImpl callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
11 // [0207/130327:INFO:seek_tester.cc(63)] Requested: 6123ms 11 // [0207/130327:INFO:seek_tester.cc(63)] Requested: 6123ms
12 // [0207/130327:INFO:seek_tester.cc(68)] audio seeked to: 5526ms 12 // [0207/130327:INFO:seek_tester.cc(68)] audio seeked to: 5526ms
13 // [0207/130327:INFO:seek_tester.cc(74)] video seeked to: 5577ms 13 // [0207/130327:INFO:seek_tester.cc(74)] video seeked to: 5577ms
14 14
15 15
16 #include "base/at_exit.h" 16 #include "base/at_exit.h"
17 #include "base/bind.h" 17 #include "base/bind.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/message_loop.h" 19 #include "base/message_loop.h"
20 #include "base/string_number_conversions.h" 20 #include "base/string_number_conversions.h"
21 #include "media/base/media.h" 21 #include "media/base/media.h"
22 #include "media/filters/ffmpeg_demuxer.h" 22 #include "media/filters/ffmpeg_demuxer.h"
23 #include "media/filters/file_data_source.h" 23 #include "media/filters/file_data_source.h"
24 24
25 class DemuxerHostImpl : public media::DemuxerHost { 25 class DemuxerHostImpl : public media::DemuxerHost {
26 public: 26 public:
27 // DataSourceHost implementation. 27 // DataSourceHost implementation.
28 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE {} 28 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE {}
29 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE {} 29 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE {}
30 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE {}
31 30
32 // DemuxerHost implementation. 31 // DemuxerHost implementation.
33 virtual void SetDuration(base::TimeDelta duration) OVERRIDE {} 32 virtual void SetDuration(base::TimeDelta duration) OVERRIDE {}
34 virtual void OnDemuxerError(media::PipelineStatus error) OVERRIDE {} 33 virtual void OnDemuxerError(media::PipelineStatus error) OVERRIDE {}
35 }; 34 };
36 35
37 void QuitMessageLoop(MessageLoop* loop, media::PipelineStatus status) { 36 void QuitMessageLoop(MessageLoop* loop, media::PipelineStatus status) {
38 CHECK_EQ(status, media::PIPELINE_OK); 37 CHECK_EQ(status, media::PIPELINE_OK);
39 loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 38 loop->PostTask(FROM_HERE, MessageLoop::QuitClosure());
40 } 39 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 base::Bind(&TimestampExtractor, &video_seeked_to_ms, &loop)); 88 base::Bind(&TimestampExtractor, &video_seeked_to_ms, &loop));
90 loop.Run(); 89 loop.Run();
91 LOG(INFO) << " video seeked to: " << video_seeked_to_ms << "ms"; 90 LOG(INFO) << " video seeked to: " << video_seeked_to_ms << "ms";
92 } 91 }
93 92
94 demuxer->Stop(base::Bind(&MessageLoop::Quit, base::Unretained(&loop))); 93 demuxer->Stop(base::Bind(&MessageLoop::Quit, base::Unretained(&loop)));
95 loop.Run(); 94 loop.Run();
96 95
97 return 0; 96 return 0;
98 } 97 }
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