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

Side by Side Diff: media/formats/webm/webm_video_client.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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
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 "media/formats/webm/webm_video_client.h" 5 #include "media/formats/webm/webm_video_client.h"
6 6
7 #include "media/base/video_decoder_config.h" 7 #include "media/base/video_decoder_config.h"
8 #include "media/formats/webm/webm_constants.h" 8 #include "media/formats/webm/webm_constants.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 13 matching lines...) Expand all
24 crop_top_ = -1; 24 crop_top_ = -1;
25 crop_left_ = -1; 25 crop_left_ = -1;
26 crop_right_ = -1; 26 crop_right_ = -1;
27 display_width_ = -1; 27 display_width_ = -1;
28 display_height_ = -1; 28 display_height_ = -1;
29 display_unit_ = -1; 29 display_unit_ = -1;
30 alpha_mode_ = -1; 30 alpha_mode_ = -1;
31 } 31 }
32 32
33 bool WebMVideoClient::InitializeConfig( 33 bool WebMVideoClient::InitializeConfig(
34 const std::string& codec_id, const std::vector<uint8>& codec_private, 34 const std::string& codec_id,
35 bool is_encrypted, VideoDecoderConfig* config) { 35 const std::vector<uint8_t>& codec_private,
36 bool is_encrypted,
37 VideoDecoderConfig* config) {
36 DCHECK(config); 38 DCHECK(config);
37 39
38 VideoCodec video_codec = kUnknownVideoCodec; 40 VideoCodec video_codec = kUnknownVideoCodec;
39 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; 41 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
40 if (codec_id == "V_VP8") { 42 if (codec_id == "V_VP8") {
41 video_codec = kCodecVP8; 43 video_codec = kCodecVP8;
42 profile = VP8PROFILE_ANY; 44 profile = VP8PROFILE_ANY;
43 } else if (codec_id == "V_VP9") { 45 } else if (codec_id == "V_VP9") {
44 video_codec = kCodecVP9; 46 video_codec = kCodecVP9;
45 profile = VP9PROFILE_ANY; 47 profile = VP9PROFILE_ANY;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return false; 90 return false;
89 } 91 }
90 gfx::Size natural_size = gfx::Size(display_width_, display_height_); 92 gfx::Size natural_size = gfx::Size(display_width_, display_height_);
91 93
92 config->Initialize(video_codec, profile, format, COLOR_SPACE_HD_REC709, 94 config->Initialize(video_codec, profile, format, COLOR_SPACE_HD_REC709,
93 coded_size, visible_rect, natural_size, codec_private, 95 coded_size, visible_rect, natural_size, codec_private,
94 is_encrypted); 96 is_encrypted);
95 return config->IsValidConfig(); 97 return config->IsValidConfig();
96 } 98 }
97 99
98 bool WebMVideoClient::OnUInt(int id, int64 val) { 100 bool WebMVideoClient::OnUInt(int id, int64_t val) {
99 int64* dst = NULL; 101 int64_t* dst = NULL;
100 102
101 switch (id) { 103 switch (id) {
102 case kWebMIdPixelWidth: 104 case kWebMIdPixelWidth:
103 dst = &pixel_width_; 105 dst = &pixel_width_;
104 break; 106 break;
105 case kWebMIdPixelHeight: 107 case kWebMIdPixelHeight:
106 dst = &pixel_height_; 108 dst = &pixel_height_;
107 break; 109 break;
108 case kWebMIdPixelCropTop: 110 case kWebMIdPixelCropTop:
109 dst = &crop_top_; 111 dst = &crop_top_;
(...skipping 27 matching lines...) Expand all
137 MEDIA_LOG(ERROR, media_log_) << "Multiple values for id " << std::hex << id 139 MEDIA_LOG(ERROR, media_log_) << "Multiple values for id " << std::hex << id
138 << " specified (" << *dst << " and " << val 140 << " specified (" << *dst << " and " << val
139 << ")"; 141 << ")";
140 return false; 142 return false;
141 } 143 }
142 144
143 *dst = val; 145 *dst = val;
144 return true; 146 return true;
145 } 147 }
146 148
147 bool WebMVideoClient::OnBinary(int id, const uint8* data, int size) { 149 bool WebMVideoClient::OnBinary(int id, const uint8_t* data, int size) {
148 // Accept binary fields we don't care about for now. 150 // Accept binary fields we don't care about for now.
149 return true; 151 return true;
150 } 152 }
151 153
152 bool WebMVideoClient::OnFloat(int id, double val) { 154 bool WebMVideoClient::OnFloat(int id, double val) {
153 // Accept float fields we don't care about for now. 155 // Accept float fields we don't care about for now.
154 return true; 156 return true;
155 } 157 }
156 158
157 } // namespace media 159 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698