Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: media/ffmpeg/ffmpeg_common.h

Issue 1254953004: Hacking ffvp9 decoder support for profiling. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Supress windows warning Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #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 #include <stdint.h> 8 #include <stdint.h>
9 9
10 // Used for FFmpeg error codes. 10 // Used for FFmpeg error codes.
(...skipping 19 matching lines...) Expand all
30 // av_dup_packet(), causing deprecation warnings. 30 // av_dup_packet(), causing deprecation warnings.
31 // The normal fix for such things is to disable the feature as below, 31 // The normal fix for such things is to disable the feature as below,
32 // but the upstream code does not yet compile with it disabled. 32 // but the upstream code does not yet compile with it disabled.
33 // (In this case, the fix is replacing the call with a new function.) 33 // (In this case, the fix is replacing the call with a new function.)
34 // In the meantime, we directly disable those warnings in the C file. 34 // In the meantime, we directly disable those warnings in the C file.
35 //#define FF_API_AVPACKET_OLD_API 0 35 //#define FF_API_AVPACKET_OLD_API 0
36 36
37 // Temporarily disable possible loss of data warning. 37 // Temporarily disable possible loss of data warning.
38 // TODO(scherkus): fix and upstream the compiler warnings. 38 // TODO(scherkus): fix and upstream the compiler warnings.
39 MSVC_PUSH_DISABLE_WARNING(4244); 39 MSVC_PUSH_DISABLE_WARNING(4244);
40 // Temporarily disable "parenthesized type followed by an initializer list is a
41 // non-standard"
42 MSVC_PUSH_DISABLE_WARNING(4576);
40 #include <libavcodec/avcodec.h> 43 #include <libavcodec/avcodec.h>
44 #include <libavcodec/internal.h>
41 #include <libavformat/avformat.h> 45 #include <libavformat/avformat.h>
42 #include <libavformat/internal.h> 46 #include <libavformat/internal.h>
43 #include <libavformat/avio.h> 47 #include <libavformat/avio.h>
44 #include <libavutil/avutil.h> 48 #include <libavutil/avutil.h>
45 #include <libavutil/imgutils.h> 49 #include <libavutil/imgutils.h>
46 #include <libavutil/log.h> 50 #include <libavutil/log.h>
47 #include <libavutil/mathematics.h> 51 #include <libavutil/mathematics.h>
48 #include <libavutil/opt.h> 52 #include <libavutil/opt.h>
49 MSVC_POP_WARNING(); 53 MSVC_POP_WARNING();
54 MSVC_POP_WARNING();
50 } // extern "C" 55 } // extern "C"
51 56
52 namespace media { 57 namespace media {
53 58
54 class AudioDecoderConfig; 59 class AudioDecoderConfig;
55 class EncryptionScheme; 60 class EncryptionScheme;
56 class VideoDecoderConfig; 61 class VideoDecoderConfig;
57 62
58 // The following implement the deleters declared in ffmpeg_deleters.h (which 63 // The following implement the deleters declared in ffmpeg_deleters.h (which
59 // contains the declarations needed for use with |scoped_ptr| without #include 64 // contains the declarations needed for use with |scoped_ptr| without #include
(...skipping 12 matching lines...) Expand all
72 inline void ScopedPtrAVFreeContext::operator()(void* x) const { 77 inline void ScopedPtrAVFreeContext::operator()(void* x) const {
73 AVCodecContext* codec_context = static_cast<AVCodecContext*>(x); 78 AVCodecContext* codec_context = static_cast<AVCodecContext*>(x);
74 avcodec_free_context(&codec_context); 79 avcodec_free_context(&codec_context);
75 } 80 }
76 81
77 inline void ScopedPtrAVFreeFrame::operator()(void* x) const { 82 inline void ScopedPtrAVFreeFrame::operator()(void* x) const {
78 AVFrame* frame = static_cast<AVFrame*>(x); 83 AVFrame* frame = static_cast<AVFrame*>(x);
79 av_frame_free(&frame); 84 av_frame_free(&frame);
80 } 85 }
81 86
87 inline void ScopedPtrAVFreeParserContext::operator()(void* x) const {
88 AVCodecParserContext* parser = static_cast<AVCodecParserContext*>(x);
89 av_parser_close(parser);
90 }
91
82 // Converts an int64_t timestamp in |time_base| units to a base::TimeDelta. 92 // Converts an int64_t timestamp in |time_base| units to a base::TimeDelta.
83 // For example if |timestamp| equals 11025 and |time_base| equals {1, 44100} 93 // For example if |timestamp| equals 11025 and |time_base| equals {1, 44100}
84 // then the return value will be a base::TimeDelta for 0.25 seconds since that 94 // then the return value will be a base::TimeDelta for 0.25 seconds since that
85 // is how much time 11025/44100ths of a second represents. 95 // is how much time 11025/44100ths of a second represents.
86 MEDIA_EXPORT base::TimeDelta ConvertFromTimeBase(const AVRational& time_base, 96 MEDIA_EXPORT base::TimeDelta ConvertFromTimeBase(const AVRational& time_base,
87 int64_t timestamp); 97 int64_t timestamp);
88 98
89 // Converts a base::TimeDelta into an int64_t timestamp in |time_base| units. 99 // Converts a base::TimeDelta into an int64_t timestamp in |time_base| units.
90 // For example if |timestamp| is 0.5 seconds and |time_base| is {1, 44100}, then 100 // For example if |timestamp| is 0.5 seconds and |time_base| is {1, 44100}, then
91 // the return value will be 22050 since that is how many 1/44100ths of a second 101 // the return value will be 22050 since that is how many 1/44100ths of a second
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // date string. Otherwise returns fals and timeline_offset is unmodified. 159 // date string. Otherwise returns fals and timeline_offset is unmodified.
150 MEDIA_EXPORT bool FFmpegUTCDateToTime(const char* date_utc, base::Time* out); 160 MEDIA_EXPORT bool FFmpegUTCDateToTime(const char* date_utc, base::Time* out);
151 161
152 // Returns a 32-bit hash for the given codec name. See the VerifyUmaCodecHashes 162 // Returns a 32-bit hash for the given codec name. See the VerifyUmaCodecHashes
153 // unit test for more information and code for generating the histogram XML. 163 // unit test for more information and code for generating the histogram XML.
154 MEDIA_EXPORT int32_t HashCodecName(const char* codec_name); 164 MEDIA_EXPORT int32_t HashCodecName(const char* codec_name);
155 165
156 } // namespace media 166 } // namespace media
157 167
158 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ 168 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_
OLDNEW
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698