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 | |
43 // Read the given amount of bytes into data, returns the number of bytes read | 41 // Read the given amount of bytes into data, returns the number of bytes read |
44 // if successful, kReadError otherwise. | 42 // if successful, kReadError otherwise. |
45 virtual int Read(int size, uint8* data) = 0; | 43 virtual int Read(int size, uint8* data) = 0; |
46 | 44 |
47 // Returns true and the current file position for this file, false if the | 45 // Returns true and the current file position for this file, false if the |
48 // file position could not be retrieved. | 46 // file position could not be retrieved. |
49 virtual bool GetPosition(int64* position_out) = 0; | 47 virtual bool GetPosition(int64* position_out) = 0; |
50 | 48 |
51 // Returns true if the file position could be set, false otherwise. | 49 // Returns true if the file position could be set, false otherwise. |
52 virtual bool SetPosition(int64 position) = 0; | 50 virtual bool SetPosition(int64 position) = 0; |
(...skipping 23 matching lines...) Expand all Loading... |
76 bool open_called_; | 74 bool open_called_; |
77 AVFormatContext* format_context_; | 75 AVFormatContext* format_context_; |
78 scoped_ptr_malloc<AVIOContext, ScopedPtrAVFree> avio_context_; | 76 scoped_ptr_malloc<AVIOContext, ScopedPtrAVFree> avio_context_; |
79 | 77 |
80 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); | 78 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); |
81 }; | 79 }; |
82 | 80 |
83 } // namespace media | 81 } // namespace media |
84 | 82 |
85 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ | 83 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ |
OLD | NEW |