OLD | NEW |
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 #ifndef MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_ | 5 #ifndef MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_ |
6 #define MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_ | 6 #define MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_ |
7 | 7 |
8 #include "media/base/data_source.h" | 8 #include "media/base/data_source.h" |
9 | 9 |
10 // Logs all DataSource operations to VLOG(1) for debugging purposes. | 10 // Logs all DataSource operations to VLOG(1) for debugging purposes. |
11 class DataSourceLogger : public media::DataSource { | 11 class DataSourceLogger : public media::DataSource { |
12 public: | 12 public: |
13 // Constructs a DataSourceLogger to log operations against another DataSource. | 13 // Constructs a DataSourceLogger to log operations against another DataSource. |
14 // | 14 // |
15 // |data_source| must be initialized in advance. | 15 // |data_source| must be initialized in advance. |
16 // | 16 // |
17 // |streaming| when set to true will override the implementation | 17 // |streaming| when set to true will override the implementation |
18 // IsStreaming() to always return true, otherwise it will delegate to | 18 // IsStreaming() to always return true, otherwise it will delegate to |
19 // |data_source|. | 19 // |data_source|. |
20 DataSourceLogger(scoped_ptr<DataSource> data_source, | 20 DataSourceLogger(scoped_ptr<DataSource> data_source, |
21 bool force_streaming); | 21 bool force_streaming); |
22 virtual ~DataSourceLogger(); | 22 virtual ~DataSourceLogger(); |
23 | 23 |
24 // media::DataSource implementation. | 24 // media::DataSource implementation. |
25 virtual void Stop() OVERRIDE; | 25 virtual void Stop() override; |
26 virtual void Read( | 26 virtual void Read( |
27 int64 position, int size, uint8* data, | 27 int64 position, int size, uint8* data, |
28 const media::DataSource::ReadCB& read_cb) OVERRIDE; | 28 const media::DataSource::ReadCB& read_cb) override; |
29 virtual bool GetSize(int64* size_out) OVERRIDE; | 29 virtual bool GetSize(int64* size_out) override; |
30 virtual bool IsStreaming() OVERRIDE; | 30 virtual bool IsStreaming() override; |
31 virtual void SetBitrate(int bitrate) OVERRIDE; | 31 virtual void SetBitrate(int bitrate) override; |
32 | 32 |
33 private: | 33 private: |
34 scoped_ptr<media::DataSource> data_source_; | 34 scoped_ptr<media::DataSource> data_source_; |
35 bool streaming_; | 35 bool streaming_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(DataSourceLogger); | 37 DISALLOW_COPY_AND_ASSIGN(DataSourceLogger); |
38 }; | 38 }; |
39 | 39 |
40 #endif // MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_ | 40 #endif // MEDIA_TOOLS_PLAYER_X11_DATA_SOURCE_LOGGER_H_ |
OLD | NEW |