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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 VP8PROFILE_MAX = VP8PROFILE_MAIN, | 58 VP8PROFILE_MAX = VP8PROFILE_MAIN, |
59 VIDEO_CODEC_PROFILE_MAX = VP8PROFILE_MAX, | 59 VIDEO_CODEC_PROFILE_MAX = VP8PROFILE_MAX, |
60 }; | 60 }; |
61 | 61 |
62 class MEDIA_EXPORT VideoDecoderConfig { | 62 class MEDIA_EXPORT VideoDecoderConfig { |
63 public: | 63 public: |
64 // Constructs an uninitialized object. Clients should call Initialize() with | 64 // Constructs an uninitialized object. Clients should call Initialize() with |
65 // appropriate values before using. | 65 // appropriate values before using. |
66 VideoDecoderConfig(); | 66 VideoDecoderConfig(); |
67 | 67 |
68 // Constructs an initialized object. It is acceptable to pass in NULL for | 68 // Constructs an initialized object. It is acceptable to pass in NULL for |
Ami GONE FROM CHROMIUM
2012/08/01 17:45:23
Is there a reason this form doesn't accept a natur
acolwell GONE FROM CHROMIUM
2012/08/01 20:52:40
It was only used by tests that didn't have aspect
| |
69 // |extra_data|, otherwise the memory is copied. | 69 // |extra_data|, otherwise the memory is copied. |
70 VideoDecoderConfig(VideoCodec codec, | 70 VideoDecoderConfig(VideoCodec codec, |
71 VideoCodecProfile profile, | 71 VideoCodecProfile profile, |
72 VideoFrame::Format format, | 72 VideoFrame::Format format, |
73 const gfx::Size& coded_size, | 73 const gfx::Size& coded_size, |
74 const gfx::Rect& visible_rect, | 74 const gfx::Rect& visible_rect, |
75 int aspect_ratio_numerator, int aspect_ratio_denominator, | |
76 const uint8* extra_data, size_t extra_data_size); | 75 const uint8* extra_data, size_t extra_data_size); |
77 | 76 |
78 ~VideoDecoderConfig(); | 77 ~VideoDecoderConfig(); |
79 | 78 |
80 // Resets the internal state of this object. | 79 // Resets the internal state of this object. |
81 void Initialize(VideoCodec codec, | 80 void Initialize(VideoCodec codec, |
82 VideoCodecProfile profile, | 81 VideoCodecProfile profile, |
83 VideoFrame::Format format, | 82 VideoFrame::Format format, |
84 const gfx::Size& coded_size, | 83 const gfx::Size& coded_size, |
85 const gfx::Rect& visible_rect, | 84 const gfx::Rect& visible_rect, |
86 int aspect_ratio_numerator, int aspect_ratio_denominator, | 85 const gfx::Size& natural_size, |
87 const uint8* extra_data, size_t extra_data_size, | 86 const uint8* extra_data, size_t extra_data_size, |
88 bool record_stats); | 87 bool record_stats); |
89 | 88 |
90 // Deep copies |video_config|. | 89 // Deep copies |video_config|. |
91 void CopyFrom(const VideoDecoderConfig& video_config); | 90 void CopyFrom(const VideoDecoderConfig& video_config); |
92 | 91 |
93 // Returns true if this object has appropriate configuration values, false | 92 // Returns true if this object has appropriate configuration values, false |
94 // otherwise. | 93 // otherwise. |
95 bool IsValidConfig() const; | 94 bool IsValidConfig() const; |
96 | 95 |
(...skipping 15 matching lines...) Expand all Loading... | |
112 // in this region are valid. | 111 // in this region are valid. |
113 gfx::Size coded_size() const; | 112 gfx::Size coded_size() const; |
114 | 113 |
115 // Region of |coded_size_| that is visible. | 114 // Region of |coded_size_| that is visible. |
116 gfx::Rect visible_rect() const; | 115 gfx::Rect visible_rect() const; |
117 | 116 |
118 // Final visible width and height of a video frame with aspect ratio taken | 117 // Final visible width and height of a video frame with aspect ratio taken |
119 // into account. | 118 // into account. |
120 gfx::Size natural_size() const; | 119 gfx::Size natural_size() const; |
121 | 120 |
122 // Aspect ratio of the decoded video frame expressed as a fraction. | |
123 // | |
124 // TODO(scherkus): think of a better way to avoid having video decoders | |
125 // handle tricky aspect ratio dimension calculations. | |
126 int aspect_ratio_numerator() const; | |
127 int aspect_ratio_denominator() const; | |
128 | |
129 // Optional byte data required to initialize video decoders, such as H.264 | 121 // Optional byte data required to initialize video decoders, such as H.264 |
130 // AAVC data. | 122 // AAVC data. |
131 uint8* extra_data() const; | 123 uint8* extra_data() const; |
132 size_t extra_data_size() const; | 124 size_t extra_data_size() const; |
133 | 125 |
134 private: | 126 private: |
135 VideoCodec codec_; | 127 VideoCodec codec_; |
136 VideoCodecProfile profile_; | 128 VideoCodecProfile profile_; |
137 | 129 |
138 VideoFrame::Format format_; | 130 VideoFrame::Format format_; |
139 | 131 |
140 gfx::Size coded_size_; | 132 gfx::Size coded_size_; |
141 gfx::Rect visible_rect_; | 133 gfx::Rect visible_rect_; |
142 gfx::Size natural_size_; | 134 gfx::Size natural_size_; |
143 | 135 |
144 int aspect_ratio_numerator_; | |
145 int aspect_ratio_denominator_; | |
146 | |
147 scoped_array<uint8> extra_data_; | 136 scoped_array<uint8> extra_data_; |
148 size_t extra_data_size_; | 137 size_t extra_data_size_; |
149 | 138 |
150 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); | 139 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); |
151 }; | 140 }; |
152 | 141 |
153 } // namespace media | 142 } // namespace media |
154 | 143 |
155 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 144 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
OLD | NEW |