| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Constructs an initialized object. It is acceptable to pass in NULL for | 75 // Constructs an initialized object. It is acceptable to pass in NULL for |
| 76 // |extra_data|, otherwise the memory is copied. | 76 // |extra_data|, otherwise the memory is copied. |
| 77 VideoDecoderConfig(VideoCodec codec, | 77 VideoDecoderConfig(VideoCodec codec, |
| 78 VideoCodecProfile profile, | 78 VideoCodecProfile profile, |
| 79 VideoFrame::Format format, | 79 VideoFrame::Format format, |
| 80 const gfx::Size& coded_size, | 80 const gfx::Size& coded_size, |
| 81 const gfx::Rect& visible_rect, | 81 const gfx::Rect& visible_rect, |
| 82 const gfx::Size& natural_size, | 82 const gfx::Size& natural_size, |
| 83 const uint8* extra_data, size_t extra_data_size, | 83 const uint8* extra_data, size_t extra_data_size, |
| 84 bool is_encrypted); | 84 bool is_encrypted, |
| 85 bool live_mode); |
| 85 | 86 |
| 86 ~VideoDecoderConfig(); | 87 ~VideoDecoderConfig(); |
| 87 | 88 |
| 88 // Resets the internal state of this object. | 89 // Resets the internal state of this object. |
| 89 void Initialize(VideoCodec codec, | 90 void Initialize(VideoCodec codec, |
| 90 VideoCodecProfile profile, | 91 VideoCodecProfile profile, |
| 91 VideoFrame::Format format, | 92 VideoFrame::Format format, |
| 92 const gfx::Size& coded_size, | 93 const gfx::Size& coded_size, |
| 93 const gfx::Rect& visible_rect, | 94 const gfx::Rect& visible_rect, |
| 94 const gfx::Size& natural_size, | 95 const gfx::Size& natural_size, |
| 95 const uint8* extra_data, size_t extra_data_size, | 96 const uint8* extra_data, size_t extra_data_size, |
| 96 bool is_encrypted, | 97 bool is_encrypted, |
| 98 bool live_mode, |
| 97 bool record_stats); | 99 bool record_stats); |
| 98 | 100 |
| 99 // Returns true if this object has appropriate configuration values, false | 101 // Returns true if this object has appropriate configuration values, false |
| 100 // otherwise. | 102 // otherwise. |
| 101 bool IsValidConfig() const; | 103 bool IsValidConfig() const; |
| 102 | 104 |
| 103 // Returns true if all fields in |config| match this config. | 105 // Returns true if all fields in |config| match this config. |
| 104 // Note: The contents of |extra_data_| are compared not the raw pointers. | 106 // Note: The contents of |extra_data_| are compared not the raw pointers. |
| 105 bool Matches(const VideoDecoderConfig& config) const; | 107 bool Matches(const VideoDecoderConfig& config) const; |
| 106 | 108 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 128 // Optional byte data required to initialize video decoders, such as H.264 | 130 // Optional byte data required to initialize video decoders, such as H.264 |
| 129 // AAVC data. | 131 // AAVC data. |
| 130 const uint8* extra_data() const; | 132 const uint8* extra_data() const; |
| 131 size_t extra_data_size() const; | 133 size_t extra_data_size() const; |
| 132 | 134 |
| 133 // Whether the video stream is potentially encrypted. | 135 // Whether the video stream is potentially encrypted. |
| 134 // Note that in a potentially encrypted video stream, individual buffers | 136 // Note that in a potentially encrypted video stream, individual buffers |
| 135 // can be encrypted or not encrypted. | 137 // can be encrypted or not encrypted. |
| 136 bool is_encrypted() const; | 138 bool is_encrypted() const; |
| 137 | 139 |
| 140 // True when the stream is a live stream. Decoders may use this flag e.g. to |
| 141 // minimize decoding delay for live streams. |
| 142 bool live_mode() const; |
| 143 |
| 138 private: | 144 private: |
| 139 VideoCodec codec_; | 145 VideoCodec codec_; |
| 140 VideoCodecProfile profile_; | 146 VideoCodecProfile profile_; |
| 141 | 147 |
| 142 VideoFrame::Format format_; | 148 VideoFrame::Format format_; |
| 143 | 149 |
| 144 gfx::Size coded_size_; | 150 gfx::Size coded_size_; |
| 145 gfx::Rect visible_rect_; | 151 gfx::Rect visible_rect_; |
| 146 gfx::Size natural_size_; | 152 gfx::Size natural_size_; |
| 147 | 153 |
| 148 std::vector<uint8> extra_data_; | 154 std::vector<uint8> extra_data_; |
| 149 | 155 |
| 150 bool is_encrypted_; | 156 bool is_encrypted_; |
| 151 | 157 |
| 158 bool live_mode_; |
| 159 |
| 152 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 160 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
| 153 // generated copy constructor and assignment operator. Since the extra data is | 161 // generated copy constructor and assignment operator. Since the extra data is |
| 154 // typically small, the performance impact is minimal. | 162 // typically small, the performance impact is minimal. |
| 155 }; | 163 }; |
| 156 | 164 |
| 157 } // namespace media | 165 } // namespace media |
| 158 | 166 |
| 159 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 167 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
| OLD | NEW |