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 #ifndef MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 5 #ifndef MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
6 #define MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 6 #define MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
13 #include "media/base/video_frame.h" | 13 #include "media/base/video_frame.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 enum VideoCodec { | 19 enum VideoCodec { |
20 // These values are histogrammed over time; do not change their ordinal | 20 // These values are histogrammed over time; do not change their ordinal |
21 // values. When deleting a codec replace it with a dummy value; when adding a | 21 // values. When deleting a codec replace it with a dummy value; when adding a |
22 // codec, do so at the bottom (and update kVideoCodecMax). | 22 // codec, do so at the bottom (and update kVideoCodecMax). |
23 kUnknownVideoCodec = 0, | 23 kUnknownVideoCodec = 0, |
24 kCodecH264, | 24 kCodecH264, |
25 kCodecVC1, | 25 kCodecVC1, |
26 kCodecMPEG2, | 26 kCodecMPEG2, |
27 kCodecMPEG4, | 27 kCodecMPEG4, |
28 kCodecTheora, | 28 kCodecTheora, |
29 kCodecVP8, | 29 kCodecVP8, |
| 30 kCodecVP9, |
30 // DO NOT ADD RANDOM VIDEO CODECS! | 31 // DO NOT ADD RANDOM VIDEO CODECS! |
31 // | 32 // |
32 // The only acceptable time to add a new codec is if there is production code | 33 // The only acceptable time to add a new codec is if there is production code |
33 // that uses said codec in the same CL. | 34 // that uses said codec in the same CL. |
34 | 35 |
35 kVideoCodecMax = kCodecVP8 // Must equal the last "real" codec above. | 36 kVideoCodecMax = kCodecVP9 // Must equal the last "real" codec above. |
36 }; | 37 }; |
37 | 38 |
38 // Video stream profile. This *must* match PP_VideoDecoder_Profile. | 39 // Video stream profile. This *must* match PP_VideoDecoder_Profile. |
39 // (enforced in webkit/plugins/ppapi/ppb_video_decoder_impl.cc) | 40 // (enforced in webkit/plugins/ppapi/ppb_video_decoder_impl.cc) |
40 enum VideoCodecProfile { | 41 enum VideoCodecProfile { |
41 // Keep the values in this enum unique, as they imply format (h.264 vs. VP8, | 42 // Keep the values in this enum unique, as they imply format (h.264 vs. VP8, |
42 // for example), and keep the values for a particular format grouped | 43 // for example), and keep the values for a particular format grouped |
43 // together for clarity. | 44 // together for clarity. |
44 VIDEO_CODEC_PROFILE_UNKNOWN = -1, | 45 VIDEO_CODEC_PROFILE_UNKNOWN = -1, |
45 H264PROFILE_MIN = 0, | 46 H264PROFILE_MIN = 0, |
46 H264PROFILE_BASELINE = H264PROFILE_MIN, | 47 H264PROFILE_BASELINE = H264PROFILE_MIN, |
47 H264PROFILE_MAIN = 1, | 48 H264PROFILE_MAIN = 1, |
48 H264PROFILE_EXTENDED = 2, | 49 H264PROFILE_EXTENDED = 2, |
49 H264PROFILE_HIGH = 3, | 50 H264PROFILE_HIGH = 3, |
50 H264PROFILE_HIGH10PROFILE = 4, | 51 H264PROFILE_HIGH10PROFILE = 4, |
51 H264PROFILE_HIGH422PROFILE = 5, | 52 H264PROFILE_HIGH422PROFILE = 5, |
52 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6, | 53 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6, |
53 H264PROFILE_SCALABLEBASELINE = 7, | 54 H264PROFILE_SCALABLEBASELINE = 7, |
54 H264PROFILE_SCALABLEHIGH = 8, | 55 H264PROFILE_SCALABLEHIGH = 8, |
55 H264PROFILE_STEREOHIGH = 9, | 56 H264PROFILE_STEREOHIGH = 9, |
56 H264PROFILE_MULTIVIEWHIGH = 10, | 57 H264PROFILE_MULTIVIEWHIGH = 10, |
57 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH, | 58 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH, |
58 VP8PROFILE_MIN = 11, | 59 VP8PROFILE_MIN = 11, |
59 VP8PROFILE_MAIN = VP8PROFILE_MIN, | 60 VP8PROFILE_MAIN = VP8PROFILE_MIN, |
60 VP8PROFILE_MAX = VP8PROFILE_MAIN, | 61 VP8PROFILE_MAX = VP8PROFILE_MAIN, |
61 VIDEO_CODEC_PROFILE_MAX = VP8PROFILE_MAX, | 62 VP9PROFILE_MIN = 12, |
| 63 VP9PROFILE_MAIN = VP9PROFILE_MIN, |
| 64 VP9PROFILE_MAX = VP9PROFILE_MAIN, |
| 65 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX, |
62 }; | 66 }; |
63 | 67 |
64 class MEDIA_EXPORT VideoDecoderConfig { | 68 class MEDIA_EXPORT VideoDecoderConfig { |
65 public: | 69 public: |
66 // Constructs an uninitialized object. Clients should call Initialize() with | 70 // Constructs an uninitialized object. Clients should call Initialize() with |
67 // appropriate values before using. | 71 // appropriate values before using. |
68 VideoDecoderConfig(); | 72 VideoDecoderConfig(); |
69 | 73 |
70 // Constructs an initialized object. It is acceptable to pass in NULL for | 74 // Constructs an initialized object. It is acceptable to pass in NULL for |
71 // |extra_data|, otherwise the memory is copied. | 75 // |extra_data|, otherwise the memory is copied. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 size_t extra_data_size_; | 151 size_t extra_data_size_; |
148 | 152 |
149 bool is_encrypted_; | 153 bool is_encrypted_; |
150 | 154 |
151 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); | 155 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); |
152 }; | 156 }; |
153 | 157 |
154 } // namespace media | 158 } // namespace media |
155 | 159 |
156 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 160 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
OLD | NEW |