OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 // when using external decoder (e.g. hardware decoder), so override them | 1028 // when using external decoder (e.g. hardware decoder), so override them |
1029 // here, to make sure this translates into a valid VideoDecoderConfig. | 1029 // here, to make sure this translates into a valid VideoDecoderConfig. |
1030 if (stream->codec->coded_width == 0 && | 1030 if (stream->codec->coded_width == 0 && |
1031 stream->codec->coded_height == 0) { | 1031 stream->codec->coded_height == 0) { |
1032 DCHECK(stream->codec->width > 0); | 1032 DCHECK(stream->codec->width > 0); |
1033 DCHECK(stream->codec->height > 0); | 1033 DCHECK(stream->codec->height > 0); |
1034 stream->codec->coded_width = stream->codec->width; | 1034 stream->codec->coded_width = stream->codec->width; |
1035 stream->codec->coded_height = stream->codec->height; | 1035 stream->codec->coded_height = stream->codec->height; |
1036 } | 1036 } |
1037 if (stream->codec->pix_fmt == AV_PIX_FMT_NONE) { | 1037 if (stream->codec->pix_fmt == AV_PIX_FMT_NONE) { |
1038 stream->codec->pix_fmt = PIX_FMT_YUV420P; | 1038 stream->codec->pix_fmt = AV_PIX_FMT_YUV420P; |
1039 } | 1039 } |
1040 } | 1040 } |
1041 #endif | 1041 #endif |
1042 // Log the codec detected, whether it is supported or not. | 1042 // Log the codec detected, whether it is supported or not. |
1043 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.DetectedVideoCodecHash", | 1043 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.DetectedVideoCodecHash", |
1044 GetCodecHash(codec_context)); | 1044 GetCodecHash(codec_context)); |
1045 | 1045 |
1046 // Ensure the codec is supported. IsValidConfig() also checks that the | 1046 // Ensure the codec is supported. IsValidConfig() also checks that the |
1047 // frame size and visible size are valid. | 1047 // frame size and visible size are valid. |
1048 AVStreamToVideoDecoderConfig(stream, &video_config); | 1048 AVStreamToVideoDecoderConfig(stream, &video_config); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 | 1457 |
1458 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1458 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
1459 DCHECK(task_runner_->BelongsToCurrentThread()); | 1459 DCHECK(task_runner_->BelongsToCurrentThread()); |
1460 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. | 1460 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. |
1461 if (stream) | 1461 if (stream) |
1462 stream->SetLiveness(liveness); | 1462 stream->SetLiveness(liveness); |
1463 } | 1463 } |
1464 } | 1464 } |
1465 | 1465 |
1466 } // namespace media | 1466 } // namespace media |
OLD | NEW |