| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_FILTERS_FILE_DATA_SOURCE_H_ | 5 #ifndef MEDIA_FILTERS_FILE_DATA_SOURCE_H_ |
| 6 #define MEDIA_FILTERS_FILE_DATA_SOURCE_H_ | 6 #define MEDIA_FILTERS_FILE_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 static FilterFactory* CreateFactory() { | 23 static FilterFactory* CreateFactory() { |
| 24 return new FilterFactoryImpl0<FileDataSource>(); | 24 return new FilterFactoryImpl0<FileDataSource>(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // Implementation of MediaFilter. | 27 // Implementation of MediaFilter. |
| 28 virtual void Stop(); | 28 virtual void Stop(); |
| 29 | 29 |
| 30 // Implementation of DataSource. | 30 // Implementation of DataSource. |
| 31 virtual bool Initialize(const std::string& url); | 31 virtual bool Initialize(const std::string& url); |
| 32 virtual const MediaFormat* GetMediaFormat(); | 32 virtual const MediaFormat* GetMediaFormat(); |
| 33 virtual size_t Read(char* data, size_t size); | 33 virtual size_t Read(uint8* data, size_t size); |
| 34 virtual bool GetPosition(int64* position_out); | 34 virtual bool GetPosition(int64* position_out); |
| 35 virtual bool SetPosition(int64 position); | 35 virtual bool SetPosition(int64 position); |
| 36 virtual bool GetSize(int64* size_out); | 36 virtual bool GetSize(int64* size_out); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 friend class FilterFactoryImpl0<FileDataSource>; | 39 friend class FilterFactoryImpl0<FileDataSource>; |
| 40 FileDataSource(); | 40 FileDataSource(); |
| 41 virtual ~FileDataSource(); | 41 virtual ~FileDataSource(); |
| 42 | 42 |
| 43 // File handle. Null if not initialized or an error occurs. | 43 // File handle. Null if not initialized or an error occurs. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 55 // that we will block for a short period of time in reads. Othewise, we can | 55 // that we will block for a short period of time in reads. Othewise, we can |
| 56 // hang the pipeline Stop. | 56 // hang the pipeline Stop. |
| 57 Lock lock_; | 57 Lock lock_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(FileDataSource); | 59 DISALLOW_COPY_AND_ASSIGN(FileDataSource); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace media | 62 } // namespace media |
| 63 | 63 |
| 64 #endif // MEDIA_FILTERS_FILE_DATA_SOURCE_H_ | 64 #endif // MEDIA_FILTERS_FILE_DATA_SOURCE_H_ |
| OLD | NEW |