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 |
11 // is initialized with read and seek methods which FFmpeg calls when necessary. | 11 // is initialized with read and seek methods which FFmpeg calls when necessary. |
12 // | 12 // |
13 // During OpenContext() FFmpegGlue will tell FFmpeg to use Chrome's AVIO context | 13 // During OpenContext() FFmpegGlue will tell FFmpeg to use Chrome's AVIO context |
14 // by passing NULL in for the filename parameter to avformat_open_input(). All | 14 // by passing NULL in for the filename parameter to avformat_open_input(). All |
15 // FFmpeg operations using the configured AVFormatContext will then redirect | 15 // FFmpeg operations using the configured AVFormatContext will then redirect |
16 // reads and seeks through the glue. | 16 // reads and seeks through the glue. |
17 // | 17 // |
18 // The glue in turn processes those read and seek requests using the | 18 // The glue in turn processes those read and seek requests using the |
19 // FFmpegURLProtocol provided during construction. | 19 // FFmpegURLProtocol provided during construction. |
20 // | 20 // |
21 // FFmpegGlue is also responsible for initializing FFmpeg, which is done once | 21 // FFmpegGlue is also responsible for initializing FFmpeg, which is done once |
22 // per process. Initialization includes: turning off log messages, registering | 22 // per process. Initialization includes: turning off log messages, registering |
23 // a lock manager, and finally registering all demuxers and codecs. | 23 // a lock manager, and finally registering all demuxers and codecs. |
24 | 24 |
25 #ifndef MEDIA_FILTERS_FFMPEG_GLUE_H_ | 25 #ifndef MEDIA_FILTERS_FFMPEG_GLUE_H_ |
26 #define MEDIA_FILTERS_FFMPEG_GLUE_H_ | 26 #define MEDIA_FILTERS_FFMPEG_GLUE_H_ |
27 | 27 |
| 28 #include <stdint.h> |
| 29 |
28 #include "base/macros.h" | 30 #include "base/macros.h" |
29 #include "base/memory/scoped_ptr.h" | 31 #include "base/memory/scoped_ptr.h" |
30 #include "media/base/media_export.h" | 32 #include "media/base/media_export.h" |
31 #include "media/ffmpeg/ffmpeg_deleters.h" | 33 #include "media/ffmpeg/ffmpeg_deleters.h" |
32 | 34 |
33 struct AVFormatContext; | 35 struct AVFormatContext; |
34 struct AVIOContext; | 36 struct AVIOContext; |
35 | 37 |
36 namespace media { | 38 namespace media { |
37 | 39 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool open_called_; | 75 bool open_called_; |
74 AVFormatContext* format_context_; | 76 AVFormatContext* format_context_; |
75 scoped_ptr<AVIOContext, ScopedPtrAVFree> avio_context_; | 77 scoped_ptr<AVIOContext, ScopedPtrAVFree> avio_context_; |
76 | 78 |
77 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); | 79 DISALLOW_COPY_AND_ASSIGN(FFmpegGlue); |
78 }; | 80 }; |
79 | 81 |
80 } // namespace media | 82 } // namespace media |
81 | 83 |
82 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ | 84 #endif // MEDIA_FILTERS_FFMPEG_GLUE_H_ |
OLD | NEW |