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
3 // found in the LICENSE file.
5 #ifndef MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_
6 #define MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_
8 #include "media/base/data_source.h"
10 // Logs all DataSource operations to VLOG(1) for debugging purposes.
11 class DataSourceLogger : public media::DataSource {
13 // Constructs a DataSourceLogger to log operations against another DataSource.
15 // |data_source| must be initialized in advance.
17 // |streaming| when set to true will override the implementation
18 // IsStreaming() to always return true, otherwise it will delegate to
20 DataSourceLogger(scoped_ptr<DataSource> data_source,
21 bool force_streaming);
22 virtual ~DataSourceLogger();
24 // media::DataSource implementation.
25 virtual void set_host(media::DataSourceHost* host) OVERRIDE;
26 virtual void Stop(const base::Closure& closure) OVERRIDE;
28 int64 position, int size, uint8* data,
29 const media::DataSource::ReadCB& read_cb) OVERRIDE;
30 virtual bool GetSize(int64* size_out) OVERRIDE;
31 virtual bool IsStreaming() OVERRIDE;
32 virtual void SetBitrate(int bitrate) OVERRIDE;
35 scoped_ptr<media::DataSource> data_source_;
38 DISALLOW_COPY_AND_ASSIGN(DataSourceLogger);
41 #endif // MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_