| 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 // FFmpegGlue is an interface between FFmpeg and Chrome used to proxy FFmpeg's | 5 // FFmpegGlue is an interface between FFmpeg and Chrome used to proxy FFmpeg's |
| 6 // read and seek requests to Chrome's internal data structures. The glue works | 6 // read and seek requests to Chrome's internal data structures. The glue works |
| 7 // through the AVIO interface provided by FFmpeg. | 7 // through the AVIO interface provided by FFmpeg. |
| 8 // | 8 // |
| 9 // AVIO works through a special AVIOContext created through avio_alloc_context() | 9 // AVIO works through a special AVIOContext created through avio_alloc_context() |
| 10 // which is attached to the AVFormatContext used for demuxing. The AVIO context | 10 // which is attached to the AVFormatContext used for demuxing. The AVIO context |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 struct AVFormatContext; | 32 struct AVFormatContext; |
| 33 struct AVIOContext; | 33 struct AVIOContext; |
| 34 | 34 |
| 35 namespace media { | 35 namespace media { |
| 36 | 36 |
| 37 class ScopedPtrAVFree; | 37 class ScopedPtrAVFree; |
| 38 | 38 |
| 39 class MEDIA_EXPORT FFmpegURLProtocol { | 39 class MEDIA_EXPORT FFmpegURLProtocol { |
| 40 public: | 40 public: |
| 41 virtual ~FFmpegURLProtocol() { } |
| 42 |
| 41 // Read the given amount of bytes into data, returns the number of bytes read | 43 // Read the given amount of bytes into data, returns the number of bytes read |
| 42 // if successful, kReadError otherwise. | 44 // if successful, kReadError otherwise. |
| 43 virtual int Read(int size, uint8* data) = 0; | 45 virtual int Read(int size, uint8* data) = 0; |
| 44 | 46 |
| 45 // Returns true and the current file position for this file, false if the | 47 // Returns true and the current file position for this file, false if the |
| 46 // file position could not be retrieved. | 48 // file position could not be retrieved. |
| 47 virtual bool GetPosition(int64* position_out) = 0; | 49 virtual bool GetPosition(int64* position_out) = 0; |
| 48 | 50 |
| 49 // Returns true if the file position could be set, false otherwise. | 51 // Returns true if the file position could be set, false otherwise. |
| 50 virtual bool SetPosition(int64 position) = 0; | 52 virtual bool SetPosition(int64 position) = 0; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 74 bool open_called_; | 76 bool open_called_; |
| 75 AVFormatContext* format_context_; | 77 AVFormatContext* format_context_; |
| 76 scoped_ptr_malloc<AVIOContext, ScopedPtrAVFree> avio_context_; | 78 scoped_ptr_malloc<AVIOContext, ScopedPtrAVFree> avio_context_; |
| 77 | 79 |
| 78 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); | 80 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } // namespace media | 83 } // namespace media |
| 82 | 84 |
| 83 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ | 85 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ |
| OLD | NEW |