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/mp2t/es_parser_h264.h" | 5 #include "media/formats/mp2t/es_parser_h264.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
10 #include "media/base/stream_parser_buffer.h" | 10 #include "media/base/stream_parser_buffer.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 gfx::Size natural_size( | 275 gfx::Size natural_size( |
276 (visible_rect.width() * sar_width) / sar_height, | 276 (visible_rect.width() * sar_width) / sar_height, |
277 visible_rect.height()); | 277 visible_rect.height()); |
278 if (natural_size.width() == 0) | 278 if (natural_size.width() == 0) |
279 return false; | 279 return false; |
280 | 280 |
281 VideoDecoderConfig video_decoder_config( | 281 VideoDecoderConfig video_decoder_config( |
282 kCodecH264, | 282 kCodecH264, |
283 VIDEO_CODEC_PROFILE_UNKNOWN, | 283 VIDEO_CODEC_PROFILE_UNKNOWN, |
284 VideoFrame::YV12, | 284 VideoFrame::YV12, |
| 285 VideoFrame::COLOR_SPACE_HD_REC709, |
285 coded_size, | 286 coded_size, |
286 visible_rect, | 287 visible_rect, |
287 natural_size, | 288 natural_size, |
288 NULL, 0, | 289 NULL, 0, |
289 false); | 290 false); |
290 | 291 |
291 if (!video_decoder_config.Matches(last_video_decoder_config_)) { | 292 if (!video_decoder_config.Matches(last_video_decoder_config_)) { |
292 DVLOG(1) << "Profile IDC: " << sps->profile_idc; | 293 DVLOG(1) << "Profile IDC: " << sps->profile_idc; |
293 DVLOG(1) << "Level IDC: " << sps->level_idc; | 294 DVLOG(1) << "Level IDC: " << sps->level_idc; |
294 DVLOG(1) << "Pic width: " << coded_size.width(); | 295 DVLOG(1) << "Pic width: " << coded_size.width(); |
295 DVLOG(1) << "Pic height: " << coded_size.height(); | 296 DVLOG(1) << "Pic height: " << coded_size.height(); |
296 DVLOG(1) << "log2_max_frame_num_minus4: " | 297 DVLOG(1) << "log2_max_frame_num_minus4: " |
297 << sps->log2_max_frame_num_minus4; | 298 << sps->log2_max_frame_num_minus4; |
298 DVLOG(1) << "SAR: width=" << sps->sar_width | 299 DVLOG(1) << "SAR: width=" << sps->sar_width |
299 << " height=" << sps->sar_height; | 300 << " height=" << sps->sar_height; |
300 last_video_decoder_config_ = video_decoder_config; | 301 last_video_decoder_config_ = video_decoder_config; |
301 es_adapter_.OnConfigChanged(video_decoder_config); | 302 es_adapter_.OnConfigChanged(video_decoder_config); |
302 } | 303 } |
303 | 304 |
304 return true; | 305 return true; |
305 } | 306 } |
306 | 307 |
307 } // namespace mp2t | 308 } // namespace mp2t |
308 } // namespace media | 309 } // namespace media |
OLD | NEW |