| 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 // FFmpegGlue is an adapter for FFmpeg's URLProtocol interface that allows us to | 5 // FFmpegGlue is an adapter for FFmpeg's URLProtocol interface that allows us to |
| 6 // use a DataSource implementation with FFmpeg. For convenience we use FFmpeg's | 6 // use a DataSource implementation with FFmpeg. For convenience we use FFmpeg's |
| 7 // av_open_input_file function, which analyzes the filename given to it and | 7 // av_open_input_file function, which analyzes the filename given to it and |
| 8 // automatically initializes the appropriate URLProtocol. | 8 // automatically initializes the appropriate URLProtocol. |
| 9 // | 9 // |
| 10 // Since the DataSource is already open by time we call av_open_input_file, we | 10 // Since the DataSource is already open by time we call av_open_input_file, we |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 virtual bool GetPosition(int64* position_out) = 0; | 55 virtual bool GetPosition(int64* position_out) = 0; |
| 56 | 56 |
| 57 // Returns true if the file position could be set, false otherwise. | 57 // Returns true if the file position could be set, false otherwise. |
| 58 virtual bool SetPosition(int64 position) = 0; | 58 virtual bool SetPosition(int64 position) = 0; |
| 59 | 59 |
| 60 // Returns true and the file size, false if the file size could not be | 60 // Returns true and the file size, false if the file size could not be |
| 61 // retrieved. | 61 // retrieved. |
| 62 virtual bool GetSize(int64* size_out) = 0; | 62 virtual bool GetSize(int64* size_out) = 0; |
| 63 | 63 |
| 64 // Returns false if this protocol supports random seeking. | 64 // Returns false if this protocol supports random seeking. |
| 65 virtual bool IsStreamed() = 0; | 65 virtual bool IsStreaming() = 0; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(FFmpegURLProtocol); | 68 DISALLOW_COPY_AND_ASSIGN(FFmpegURLProtocol); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class FFmpegGlue : public Singleton<FFmpegGlue> { | 71 class FFmpegGlue : public Singleton<FFmpegGlue> { |
| 72 public: | 72 public: |
| 73 // Adds a FFmpegProtocol to the FFmpeg glue layer and returns a unique string | 73 // Adds a FFmpegProtocol to the FFmpeg glue layer and returns a unique string |
| 74 // that can be passed to FFmpeg to identify the data source. | 74 // that can be passed to FFmpeg to identify the data source. |
| 75 std::string AddProtocol(FFmpegURLProtocol* protocol); | 75 std::string AddProtocol(FFmpegURLProtocol* protocol); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 99 // Map between keys and FFmpegProtocol references. | 99 // Map between keys and FFmpegProtocol references. |
| 100 typedef std::map<std::string, FFmpegURLProtocol*> ProtocolMap; | 100 typedef std::map<std::string, FFmpegURLProtocol*> ProtocolMap; |
| 101 ProtocolMap protocols_; | 101 ProtocolMap protocols_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); | 103 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace media | 106 } // namespace media |
| 107 | 107 |
| 108 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ | 108 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ |
| OLD | NEW |