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

Side by Side Diff: trunk/src/media/tools/player_x11/data_source_logger.cc

Issue 421843004: Revert 285479 "Make DataSource::Stop() synchronous." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 | « trunk/src/media/tools/player_x11/data_source_logger.h ('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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "media/tools/player_x11/data_source_logger.h" 7 #include "media/tools/player_x11/data_source_logger.h"
8 8
9 static void LogAndRunStopClosure(const base::Closure& closure) {
10 VLOG(1) << "Stop() finished";
11 closure.Run();
12 }
13
9 static void LogAndRunReadCB( 14 static void LogAndRunReadCB(
10 int64 position, int size, 15 int64 position, int size,
11 const media::DataSource::ReadCB& read_cb, int result) { 16 const media::DataSource::ReadCB& read_cb, int result) {
12 VLOG(1) << "Read(" << position << ", " << size << ") -> " << result; 17 VLOG(1) << "Read(" << position << ", " << size << ") -> " << result;
13 read_cb.Run(result); 18 read_cb.Run(result);
14 } 19 }
15 20
16 DataSourceLogger::DataSourceLogger( 21 DataSourceLogger::DataSourceLogger(
17 scoped_ptr<media::DataSource> data_source, 22 scoped_ptr<media::DataSource> data_source,
18 bool streaming) 23 bool streaming)
19 : data_source_(data_source.Pass()), 24 : data_source_(data_source.Pass()),
20 streaming_(streaming) { 25 streaming_(streaming) {
21 } 26 }
22 27
23 void DataSourceLogger::Stop() { 28 void DataSourceLogger::Stop(const base::Closure& closure) {
24 VLOG(1) << "Stop()"; 29 VLOG(1) << "Stop() started";
25 data_source_->Stop(); 30 data_source_->Stop(base::Bind(&LogAndRunStopClosure, closure));
26 } 31 }
27 32
28 void DataSourceLogger::Read( 33 void DataSourceLogger::Read(
29 int64 position, int size, uint8* data, 34 int64 position, int size, uint8* data,
30 const media::DataSource::ReadCB& read_cb) { 35 const media::DataSource::ReadCB& read_cb) {
31 VLOG(1) << "Read(" << position << ", " << size << ")"; 36 VLOG(1) << "Read(" << position << ", " << size << ")";
32 data_source_->Read(position, size, data, base::Bind( 37 data_source_->Read(position, size, data, base::Bind(
33 &LogAndRunReadCB, position, size, read_cb)); 38 &LogAndRunReadCB, position, size, read_cb));
34 } 39 }
35 40
(...skipping 14 matching lines...) Expand all
50 VLOG(1) << "IsStreaming() -> " << (streaming ? "true" : "false"); 55 VLOG(1) << "IsStreaming() -> " << (streaming ? "true" : "false");
51 return streaming; 56 return streaming;
52 } 57 }
53 58
54 void DataSourceLogger::SetBitrate(int bitrate) { 59 void DataSourceLogger::SetBitrate(int bitrate) {
55 VLOG(1) << "SetBitrate(" << bitrate << ")"; 60 VLOG(1) << "SetBitrate(" << bitrate << ")";
56 data_source_->SetBitrate(bitrate); 61 data_source_->SetBitrate(bitrate);
57 } 62 }
58 63
59 DataSourceLogger::~DataSourceLogger() {} 64 DataSourceLogger::~DataSourceLogger() {}
OLDNEW
« no previous file with comments | « trunk/src/media/tools/player_x11/data_source_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698