| 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 #include "media/base/video_decoder_config.h" | 5 #include "media/base/video_decoder_config.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/base/media_util.h" | 10 #include "media/base/media_util.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 Initialize(codec, profile, format, color_space, coded_size, visible_rect, | 68 Initialize(codec, profile, format, color_space, coded_size, visible_rect, |
| 69 natural_size, extra_data, encryption_scheme); | 69 natural_size, extra_data, encryption_scheme); |
| 70 } | 70 } |
| 71 | 71 |
| 72 VideoDecoderConfig::VideoDecoderConfig(const VideoDecoderConfig& other) = | 72 VideoDecoderConfig::VideoDecoderConfig(const VideoDecoderConfig& other) = |
| 73 default; | 73 default; |
| 74 | 74 |
| 75 VideoDecoderConfig::~VideoDecoderConfig() {} | 75 VideoDecoderConfig::~VideoDecoderConfig() {} |
| 76 | 76 |
| 77 void VideoDecoderConfig::set_color_space_info( | 77 void VideoDecoderConfig::set_color_space_info( |
| 78 const gfx::ColorSpace& color_space_info) { | 78 const VideoColorSpace& color_space_info) { |
| 79 color_space_info_ = color_space_info; | 79 color_space_info_ = color_space_info; |
| 80 } | 80 } |
| 81 | 81 |
| 82 gfx::ColorSpace VideoDecoderConfig::color_space_info() const { | 82 VideoColorSpace VideoDecoderConfig::color_space_info() const { |
| 83 return color_space_info_; | 83 return color_space_info_; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void VideoDecoderConfig::set_hdr_metadata(const HDRMetadata& hdr_metadata) { | 86 void VideoDecoderConfig::set_hdr_metadata(const HDRMetadata& hdr_metadata) { |
| 87 hdr_metadata_ = hdr_metadata; | 87 hdr_metadata_ = hdr_metadata; |
| 88 } | 88 } |
| 89 | 89 |
| 90 base::Optional<HDRMetadata> VideoDecoderConfig::hdr_metadata() const { | 90 base::Optional<HDRMetadata> VideoDecoderConfig::hdr_metadata() const { |
| 91 return hdr_metadata_; | 91 return hdr_metadata_; |
| 92 } | 92 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 105 format_ = format; | 105 format_ = format; |
| 106 color_space_ = color_space; | 106 color_space_ = color_space; |
| 107 coded_size_ = coded_size; | 107 coded_size_ = coded_size; |
| 108 visible_rect_ = visible_rect; | 108 visible_rect_ = visible_rect; |
| 109 natural_size_ = natural_size; | 109 natural_size_ = natural_size; |
| 110 extra_data_ = extra_data; | 110 extra_data_ = extra_data; |
| 111 encryption_scheme_ = encryption_scheme; | 111 encryption_scheme_ = encryption_scheme; |
| 112 | 112 |
| 113 switch (color_space) { | 113 switch (color_space) { |
| 114 case ColorSpace::COLOR_SPACE_JPEG: | 114 case ColorSpace::COLOR_SPACE_JPEG: |
| 115 color_space_info_ = gfx::ColorSpace::CreateJpeg(); | 115 color_space_info_ = VideoColorSpace::JPEG(); |
| 116 break; | 116 break; |
| 117 case ColorSpace::COLOR_SPACE_HD_REC709: | 117 case ColorSpace::COLOR_SPACE_HD_REC709: |
| 118 color_space_info_ = gfx::ColorSpace::CreateREC709(); | 118 color_space_info_ = VideoColorSpace::REC709(); |
| 119 break; | 119 break; |
| 120 case ColorSpace::COLOR_SPACE_SD_REC601: | 120 case ColorSpace::COLOR_SPACE_SD_REC601: |
| 121 color_space_info_ = gfx::ColorSpace::CreateREC601(); | 121 color_space_info_ = VideoColorSpace::REC601(); |
| 122 break; | 122 break; |
| 123 case ColorSpace::COLOR_SPACE_UNSPECIFIED: | 123 case ColorSpace::COLOR_SPACE_UNSPECIFIED: |
| 124 default: | 124 default: |
| 125 break; | 125 break; |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool VideoDecoderConfig::IsValidConfig() const { | 129 bool VideoDecoderConfig::IsValidConfig() const { |
| 130 return codec_ != kUnknownVideoCodec && | 130 return codec_ != kUnknownVideoCodec && |
| 131 natural_size_.width() > 0 && | 131 natural_size_.width() > 0 && |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 << "Config is already encrypted."; | 173 << "Config is already encrypted."; |
| 174 // TODO(xhwang): This is only used to guide decoder selection, so set | 174 // TODO(xhwang): This is only used to guide decoder selection, so set |
| 175 // a common encryption scheme that should be supported by all decrypting | 175 // a common encryption scheme that should be supported by all decrypting |
| 176 // decoders. We should be able to remove this when we support switching | 176 // decoders. We should be able to remove this when we support switching |
| 177 // decoders at run time. See http://crbug.com/695595 | 177 // decoders at run time. See http://crbug.com/695595 |
| 178 encryption_scheme_ = AesCtrEncryptionScheme(); | 178 encryption_scheme_ = AesCtrEncryptionScheme(); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace media | 182 } // namespace media |
| OLD | NEW |