Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: media/base/video_decoder_config.cc

Issue 2746013006: use VideoColorSpace in decoder configuration (Closed)
Patch Set: oops, win compile fix reapplied Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698