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

Unified Diff: media/tools/player_x11/data_source_logger.cc

Issue 1083683003: Speculative revert by sheriff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed an unrelated commit that had accidentally slipped in. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/tools/player_x11/data_source_logger.h ('k') | media/tools/player_x11/gl_video_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/player_x11/data_source_logger.cc
diff --git a/media/tools/player_x11/data_source_logger.cc b/media/tools/player_x11/data_source_logger.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d09b6bf2e1ac99651914042f35aaf9d32dd4de1a
--- /dev/null
+++ b/media/tools/player_x11/data_source_logger.cc
@@ -0,0 +1,59 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "base/logging.h"
+#include "media/tools/player_x11/data_source_logger.h"
+
+static void LogAndRunReadCB(
+ int64 position, int size,
+ const media::DataSource::ReadCB& read_cb, int result) {
+ VLOG(1) << "Read(" << position << ", " << size << ") -> " << result;
+ read_cb.Run(result);
+}
+
+DataSourceLogger::DataSourceLogger(
+ scoped_ptr<media::DataSource> data_source,
+ bool streaming)
+ : data_source_(data_source.Pass()),
+ streaming_(streaming) {
+}
+
+void DataSourceLogger::Stop() {
+ VLOG(1) << "Stop()";
+ data_source_->Stop();
+}
+
+void DataSourceLogger::Read(
+ int64 position, int size, uint8* data,
+ const media::DataSource::ReadCB& read_cb) {
+ VLOG(1) << "Read(" << position << ", " << size << ")";
+ data_source_->Read(position, size, data, base::Bind(
+ &LogAndRunReadCB, position, size, read_cb));
+}
+
+bool DataSourceLogger::GetSize(int64* size_out) {
+ bool success = data_source_->GetSize(size_out);
+ VLOG(1) << "GetSize() -> " << (success ? "true" : "false")
+ << ", " << *size_out;
+ return success;
+}
+
+bool DataSourceLogger::IsStreaming() {
+ if (streaming_) {
+ VLOG(1) << "IsStreaming() -> true (overridden)";
+ return true;
+ }
+
+ bool streaming = data_source_->IsStreaming();
+ VLOG(1) << "IsStreaming() -> " << (streaming ? "true" : "false");
+ return streaming;
+}
+
+void DataSourceLogger::SetBitrate(int bitrate) {
+ VLOG(1) << "SetBitrate(" << bitrate << ")";
+ data_source_->SetBitrate(bitrate);
+}
+
+DataSourceLogger::~DataSourceLogger() {}
« no previous file with comments | « media/tools/player_x11/data_source_logger.h ('k') | media/tools/player_x11/gl_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698