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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
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, | 75 const gfx::Size& natural_size, |
76 const uint8* extra_data, size_t extra_data_size); | 76 const uint8* extra_data, size_t extra_data_size); |
77 | 77 |
78 ~VideoDecoderConfig(); | 78 ~VideoDecoderConfig(); |
79 | 79 |
80 // Resets the internal state of this object. | 80 // Resets the internal state of this object. |
81 void Initialize(VideoCodec codec, | 81 void Initialize(VideoCodec codec, |
82 VideoCodecProfile profile, | 82 VideoCodecProfile profile, |
83 VideoFrame::Format format, | 83 VideoFrame::Format format, |
84 const gfx::Size& coded_size, | 84 const gfx::Size& coded_size, |
85 const gfx::Rect& visible_rect, | 85 const gfx::Rect& visible_rect, |
86 int aspect_ratio_numerator, int aspect_ratio_denominator, | 86 const gfx::Size& natural_size, |
87 const uint8* extra_data, size_t extra_data_size, | 87 const uint8* extra_data, size_t extra_data_size, |
88 bool record_stats); | 88 bool record_stats); |
89 | 89 |
90 // Deep copies |video_config|. | 90 // Deep copies |video_config|. |
91 void CopyFrom(const VideoDecoderConfig& video_config); | 91 void CopyFrom(const VideoDecoderConfig& video_config); |
92 | 92 |
93 // Returns true if this object has appropriate configuration values, false | 93 // Returns true if this object has appropriate configuration values, false |
94 // otherwise. | 94 // otherwise. |
95 bool IsValidConfig() const; | 95 bool IsValidConfig() const; |
96 | 96 |
(...skipping 15 matching lines...) Expand all Loading... |
112 // in this region are valid. | 112 // in this region are valid. |
113 gfx::Size coded_size() const; | 113 gfx::Size coded_size() const; |
114 | 114 |
115 // Region of |coded_size_| that is visible. | 115 // Region of |coded_size_| that is visible. |
116 gfx::Rect visible_rect() const; | 116 gfx::Rect visible_rect() const; |
117 | 117 |
118 // Final visible width and height of a video frame with aspect ratio taken | 118 // Final visible width and height of a video frame with aspect ratio taken |
119 // into account. | 119 // into account. |
120 gfx::Size natural_size() const; | 120 gfx::Size natural_size() const; |
121 | 121 |
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 | 122 // Optional byte data required to initialize video decoders, such as H.264 |
130 // AAVC data. | 123 // AAVC data. |
131 uint8* extra_data() const; | 124 uint8* extra_data() const; |
132 size_t extra_data_size() const; | 125 size_t extra_data_size() const; |
133 | 126 |
134 private: | 127 private: |
135 VideoCodec codec_; | 128 VideoCodec codec_; |
136 VideoCodecProfile profile_; | 129 VideoCodecProfile profile_; |
137 | 130 |
138 VideoFrame::Format format_; | 131 VideoFrame::Format format_; |
139 | 132 |
140 gfx::Size coded_size_; | 133 gfx::Size coded_size_; |
141 gfx::Rect visible_rect_; | 134 gfx::Rect visible_rect_; |
142 gfx::Size natural_size_; | 135 gfx::Size natural_size_; |
143 | 136 |
144 int aspect_ratio_numerator_; | |
145 int aspect_ratio_denominator_; | |
146 | |
147 scoped_array<uint8> extra_data_; | 137 scoped_array<uint8> extra_data_; |
148 size_t extra_data_size_; | 138 size_t extra_data_size_; |
149 | 139 |
150 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); | 140 DISALLOW_COPY_AND_ASSIGN(VideoDecoderConfig); |
151 }; | 141 }; |
152 | 142 |
153 } // namespace media | 143 } // namespace media |
154 | 144 |
155 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 145 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
OLD | NEW |