| OLD | NEW |
| 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 15 matching lines...) Expand all Loading... |
| 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, | 34 const std::string& codec_id, |
| 35 const std::vector<uint8_t>& codec_private, | 35 const std::vector<uint8_t>& codec_private, |
| 36 bool is_encrypted, | 36 const EncryptionScheme& encryption_scheme, |
| 37 VideoDecoderConfig* config) { | 37 VideoDecoderConfig* config) { |
| 38 DCHECK(config); | 38 DCHECK(config); |
| 39 | 39 |
| 40 VideoCodec video_codec = kUnknownVideoCodec; | 40 VideoCodec video_codec = kUnknownVideoCodec; |
| 41 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; | 41 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
| 42 if (codec_id == "V_VP8") { | 42 if (codec_id == "V_VP8") { |
| 43 video_codec = kCodecVP8; | 43 video_codec = kCodecVP8; |
| 44 profile = VP8PROFILE_ANY; | 44 profile = VP8PROFILE_ANY; |
| 45 } else if (codec_id == "V_VP9") { | 45 } else if (codec_id == "V_VP9") { |
| 46 video_codec = kCodecVP9; | 46 video_codec = kCodecVP9; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return false; | 86 return false; |
| 87 } else { | 87 } else { |
| 88 MEDIA_LOG(ERROR, media_log_) << "Unsupported display unit type " | 88 MEDIA_LOG(ERROR, media_log_) << "Unsupported display unit type " |
| 89 << display_unit_; | 89 << display_unit_; |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 gfx::Size natural_size = gfx::Size(display_width_, display_height_); | 92 gfx::Size natural_size = gfx::Size(display_width_, display_height_); |
| 93 | 93 |
| 94 config->Initialize(video_codec, profile, format, COLOR_SPACE_HD_REC709, | 94 config->Initialize(video_codec, profile, format, COLOR_SPACE_HD_REC709, |
| 95 coded_size, visible_rect, natural_size, codec_private, | 95 coded_size, visible_rect, natural_size, codec_private, |
| 96 is_encrypted); | 96 encryption_scheme); |
| 97 return config->IsValidConfig(); | 97 return config->IsValidConfig(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool WebMVideoClient::OnUInt(int id, int64_t val) { | 100 bool WebMVideoClient::OnUInt(int id, int64_t val) { |
| 101 int64_t* dst = NULL; | 101 int64_t* dst = NULL; |
| 102 | 102 |
| 103 switch (id) { | 103 switch (id) { |
| 104 case kWebMIdPixelWidth: | 104 case kWebMIdPixelWidth: |
| 105 dst = &pixel_width_; | 105 dst = &pixel_width_; |
| 106 break; | 106 break; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Accept binary fields we don't care about for now. | 150 // Accept binary fields we don't care about for now. |
| 151 return true; | 151 return true; |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool WebMVideoClient::OnFloat(int id, double val) { | 154 bool WebMVideoClient::OnFloat(int id, double val) { |
| 155 // Accept float fields we don't care about for now. | 155 // Accept float fields we don't care about for now. |
| 156 return true; | 156 return true; |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace media | 159 } // namespace media |
| OLD | NEW |