OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FFMPEG_FFMPEG_COMMON_H_ | 5 #ifndef MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
6 #define MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 6 #define MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
7 | 7 |
8 // Used for FFmpeg error codes. | 8 // Used for FFmpeg error codes. |
9 #include <cerrno> | 9 #include <cerrno> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/singleton.h" | |
13 #include "base/time.h" | 12 #include "base/time.h" |
14 #include "media/base/audio_decoder_config.h" | |
15 #include "media/base/channel_layout.h" | 13 #include "media/base/channel_layout.h" |
16 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
17 #include "media/video/video_decode_engine.h" | 15 #include "media/base/video_frame.h" |
18 #include "ui/gfx/size.h" | |
19 | 16 |
20 // Include FFmpeg header files. | 17 // Include FFmpeg header files. |
21 extern "C" { | 18 extern "C" { |
22 // Temporarily disable possible loss of data warning. | 19 // Temporarily disable possible loss of data warning. |
23 // TODO(scherkus): fix and upstream the compiler warnings. | 20 // TODO(scherkus): fix and upstream the compiler warnings. |
24 MSVC_PUSH_DISABLE_WARNING(4244); | 21 MSVC_PUSH_DISABLE_WARNING(4244); |
25 #include <libavcodec/avcodec.h> | 22 #include <libavcodec/avcodec.h> |
26 #include <libavformat/avformat.h> | 23 #include <libavformat/avformat.h> |
27 #include <libavformat/avio.h> | 24 #include <libavformat/avio.h> |
28 #include <libavutil/avutil.h> | 25 #include <libavutil/avutil.h> |
29 #include <libavutil/log.h> | 26 #include <libavutil/log.h> |
30 MSVC_POP_WARNING(); | 27 MSVC_POP_WARNING(); |
31 } // extern "C" | 28 } // extern "C" |
32 | 29 |
33 namespace media { | 30 namespace media { |
34 | 31 |
| 32 class AudioDecoderConfig; |
| 33 class VideoDecoderConfig; |
| 34 |
35 // Wraps FFmpeg's av_free() in a class that can be passed as a template argument | 35 // Wraps FFmpeg's av_free() in a class that can be passed as a template argument |
36 // to scoped_ptr_malloc. | 36 // to scoped_ptr_malloc. |
37 class ScopedPtrAVFree { | 37 class ScopedPtrAVFree { |
38 public: | 38 public: |
39 inline void operator()(void* x) const { | 39 inline void operator()(void* x) const { |
40 av_free(x); | 40 av_free(x); |
41 } | 41 } |
42 }; | 42 }; |
43 | 43 |
44 // This assumes that the AVPacket being captured was allocated outside of | 44 // This assumes that the AVPacket being captured was allocated outside of |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // |config|. | 97 // |config|. |
98 base::TimeDelta GetFrameDuration(const VideoDecoderConfig& config); | 98 base::TimeDelta GetFrameDuration(const VideoDecoderConfig& config); |
99 | 99 |
100 // Closes & destroys all AVStreams in the context and then closes & | 100 // Closes & destroys all AVStreams in the context and then closes & |
101 // destroys the AVFormatContext. | 101 // destroys the AVFormatContext. |
102 void DestroyAVFormatContext(AVFormatContext* format_context); | 102 void DestroyAVFormatContext(AVFormatContext* format_context); |
103 | 103 |
104 } // namespace media | 104 } // namespace media |
105 | 105 |
106 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 106 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
OLD | NEW |