| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 sps->frame_crop_top_offset); | 272 sps->frame_crop_top_offset); |
| 273 if (visible_rect.width() <= 0 || visible_rect.height() <= 0) | 273 if (visible_rect.width() <= 0 || visible_rect.height() <= 0) |
| 274 return false; | 274 return false; |
| 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, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, coded_size, | 282 kCodecH264, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, |
| 283 visible_rect, natural_size, NULL, 0, false); | 283 COLOR_SPACE_HD_REC709, coded_size, visible_rect, natural_size, NULL, 0, |
| 284 false); |
| 284 | 285 |
| 285 if (!video_decoder_config.Matches(last_video_decoder_config_)) { | 286 if (!video_decoder_config.Matches(last_video_decoder_config_)) { |
| 286 DVLOG(1) << "Profile IDC: " << sps->profile_idc; | 287 DVLOG(1) << "Profile IDC: " << sps->profile_idc; |
| 287 DVLOG(1) << "Level IDC: " << sps->level_idc; | 288 DVLOG(1) << "Level IDC: " << sps->level_idc; |
| 288 DVLOG(1) << "Pic width: " << coded_size.width(); | 289 DVLOG(1) << "Pic width: " << coded_size.width(); |
| 289 DVLOG(1) << "Pic height: " << coded_size.height(); | 290 DVLOG(1) << "Pic height: " << coded_size.height(); |
| 290 DVLOG(1) << "log2_max_frame_num_minus4: " | 291 DVLOG(1) << "log2_max_frame_num_minus4: " |
| 291 << sps->log2_max_frame_num_minus4; | 292 << sps->log2_max_frame_num_minus4; |
| 292 DVLOG(1) << "SAR: width=" << sps->sar_width | 293 DVLOG(1) << "SAR: width=" << sps->sar_width |
| 293 << " height=" << sps->sar_height; | 294 << " height=" << sps->sar_height; |
| 294 last_video_decoder_config_ = video_decoder_config; | 295 last_video_decoder_config_ = video_decoder_config; |
| 295 es_adapter_.OnConfigChanged(video_decoder_config); | 296 es_adapter_.OnConfigChanged(video_decoder_config); |
| 296 } | 297 } |
| 297 | 298 |
| 298 return true; | 299 return true; |
| 299 } | 300 } |
| 300 | 301 |
| 301 } // namespace mp2t | 302 } // namespace mp2t |
| 302 } // namespace media | 303 } // namespace media |
| OLD | NEW |