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

Side by Side Diff: chromecast/common/media/cma_param_traits.cc

Issue 1221903003: Change the video color space default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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 | « no previous file | chromecast/common/media/cma_param_traits_macros.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/common/media/cma_param_traits.h" 5 #include "chromecast/common/media/cma_param_traits.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "chromecast/common/media/cma_param_traits_macros.h" 9 #include "chromecast/common/media/cma_param_traits_macros.h"
10 #include "content/public/common/common_param_traits.h" 10 #include "content/public/common/common_param_traits.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void ParamTraits<media::AudioDecoderConfig>::Log( 72 void ParamTraits<media::AudioDecoderConfig>::Log(
73 const media::AudioDecoderConfig& p, std::string* l) { 73 const media::AudioDecoderConfig& p, std::string* l) {
74 l->append(base::StringPrintf("<AudioDecoderConfig>")); 74 l->append(base::StringPrintf("<AudioDecoderConfig>"));
75 } 75 }
76 76
77 void ParamTraits<media::VideoDecoderConfig>::Write( 77 void ParamTraits<media::VideoDecoderConfig>::Write(
78 Message* m, const media::VideoDecoderConfig& p) { 78 Message* m, const media::VideoDecoderConfig& p) {
79 WriteParam(m, p.codec()); 79 WriteParam(m, p.codec());
80 WriteParam(m, p.profile()); 80 WriteParam(m, p.profile());
81 WriteParam(m, p.format()); 81 WriteParam(m, p.format());
82 WriteParam(m, p.color_space());
82 WriteParam(m, p.coded_size()); 83 WriteParam(m, p.coded_size());
83 WriteParam(m, p.visible_rect()); 84 WriteParam(m, p.visible_rect());
84 WriteParam(m, p.natural_size()); 85 WriteParam(m, p.natural_size());
85 WriteParam(m, p.is_encrypted()); 86 WriteParam(m, p.is_encrypted());
86 std::vector<uint8> extra_data; 87 std::vector<uint8> extra_data;
87 if (p.extra_data_size() > 0) { 88 if (p.extra_data_size() > 0) {
88 extra_data = 89 extra_data =
89 std::vector<uint8>(p.extra_data(), 90 std::vector<uint8>(p.extra_data(),
90 p.extra_data() + p.extra_data_size()); 91 p.extra_data() + p.extra_data_size());
91 } 92 }
92 WriteParam(m, extra_data); 93 WriteParam(m, extra_data);
93 } 94 }
94 95
95 bool ParamTraits<media::VideoDecoderConfig>::Read( 96 bool ParamTraits<media::VideoDecoderConfig>::Read(
96 const Message* m, 97 const Message* m,
97 base::PickleIterator* iter, 98 base::PickleIterator* iter,
98 media::VideoDecoderConfig* r) { 99 media::VideoDecoderConfig* r) {
99 media::VideoCodec codec; 100 media::VideoCodec codec;
100 media::VideoCodecProfile profile; 101 media::VideoCodecProfile profile;
101 media::VideoFrame::Format format; 102 media::VideoFrame::Format format;
103 media::VideoFrame::ColorSpace color_space;
102 gfx::Size coded_size; 104 gfx::Size coded_size;
103 gfx::Rect visible_rect; 105 gfx::Rect visible_rect;
104 gfx::Size natural_size; 106 gfx::Size natural_size;
105 bool is_encrypted; 107 bool is_encrypted;
106 std::vector<uint8> extra_data; 108 std::vector<uint8> extra_data;
107 if (!ReadParam(m, iter, &codec) || !ReadParam(m, iter, &profile) || 109 if (!ReadParam(m, iter, &codec) || !ReadParam(m, iter, &profile) ||
108 !ReadParam(m, iter, &format) || !ReadParam(m, iter, &coded_size) || 110 !ReadParam(m, iter, &format) || !ReadParam(m, iter, &color_space) ||
109 !ReadParam(m, iter, &visible_rect) || 111 !ReadParam(m, iter, &coded_size) || !ReadParam(m, iter, &visible_rect) ||
110 !ReadParam(m, iter, &natural_size) || 112 !ReadParam(m, iter, &natural_size) ||
111 !ReadParam(m, iter, &is_encrypted) || !ReadParam(m, iter, &extra_data)) 113 !ReadParam(m, iter, &is_encrypted) || !ReadParam(m, iter, &extra_data))
112 return false; 114 return false;
113 const uint8* extra_data_ptr = nullptr; 115 const uint8* extra_data_ptr = nullptr;
114 if (!extra_data.empty()) 116 if (!extra_data.empty())
115 extra_data_ptr = &extra_data[0]; 117 extra_data_ptr = &extra_data[0];
116 *r = media::VideoDecoderConfig(codec, profile, format, 118 *r = media::VideoDecoderConfig(codec, profile, format, color_space,
117 coded_size, visible_rect, natural_size, 119 coded_size, visible_rect, natural_size,
118 extra_data_ptr, extra_data.size(), 120 extra_data_ptr, extra_data.size(),
119 is_encrypted); 121 is_encrypted);
120 return true; 122 return true;
121 } 123 }
122 124
123 void ParamTraits<media::VideoDecoderConfig>::Log( 125 void ParamTraits<media::VideoDecoderConfig>::Log(
124 const media::VideoDecoderConfig& p, std::string* l) { 126 const media::VideoDecoderConfig& p, std::string* l) {
125 l->append(base::StringPrintf("<VideoDecoderConfig>")); 127 l->append(base::StringPrintf("<VideoDecoderConfig>"));
126 } 128 }
127 129
128 } // namespace IPC 130 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | chromecast/common/media/cma_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698