Commit 5356c317 authored by Will Cassella's avatar Will Cassella Committed by Commit Bot

Fix warnings in FFmpegDemuxer

This CL fixes all style warnings in FFmpegDemuxer that make
error/warning based IDE navigation cumbersome. There should be no
functional changes in this CL.

Change-Id: I30371e6a889d29d553f95aa275e98cfd05591b8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2211081
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770893}
parent aab22dde
...@@ -214,7 +214,7 @@ std::unique_ptr<FFmpegDemuxerStream> FFmpegDemuxerStream::Create( ...@@ -214,7 +214,7 @@ std::unique_ptr<FFmpegDemuxerStream> FFmpegDemuxerStream::Create(
std::unique_ptr<VideoDecoderConfig> video_config; std::unique_ptr<VideoDecoderConfig> video_config;
if (stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { if (stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
audio_config.reset(new AudioDecoderConfig()); audio_config = std::make_unique<AudioDecoderConfig>();
// TODO(chcunningham): Change AVStreamToAudioDecoderConfig to check // TODO(chcunningham): Change AVStreamToAudioDecoderConfig to check
// IsValidConfig internally and return a null scoped_ptr if not valid. // IsValidConfig internally and return a null scoped_ptr if not valid.
...@@ -231,7 +231,7 @@ std::unique_ptr<FFmpegDemuxerStream> FFmpegDemuxerStream::Create( ...@@ -231,7 +231,7 @@ std::unique_ptr<FFmpegDemuxerStream> FFmpegDemuxerStream::Create(
MEDIA_LOG(INFO, media_log) << "FFmpegDemuxer: created audio stream, config " MEDIA_LOG(INFO, media_log) << "FFmpegDemuxer: created audio stream, config "
<< audio_config->AsHumanReadableString(); << audio_config->AsHumanReadableString();
} else if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { } else if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
video_config.reset(new VideoDecoderConfig()); video_config = std::make_unique<VideoDecoderConfig>();
// TODO(chcunningham): Change AVStreamToVideoDecoderConfig to check // TODO(chcunningham): Change AVStreamToVideoDecoderConfig to check
// IsValidConfig internally and return a null scoped_ptr if not valid. // IsValidConfig internally and return a null scoped_ptr if not valid.
...@@ -781,8 +781,9 @@ void FFmpegDemuxerStream::InitBitstreamConverter() { ...@@ -781,8 +781,9 @@ void FFmpegDemuxerStream::InitBitstreamConverter() {
// consume that data. // consume that data.
if (video_config_) if (video_config_)
video_config_->SetExtraData(std::vector<uint8_t>()); video_config_->SetExtraData(std::vector<uint8_t>());
bitstream_converter_.reset( bitstream_converter_ =
new FFmpegH264ToAnnexBBitstreamConverter(stream_->codecpar)); std::make_unique<FFmpegH264ToAnnexBBitstreamConverter>(
stream_->codecpar);
break; break;
#if BUILDFLAG(ENABLE_PLATFORM_HEVC) #if BUILDFLAG(ENABLE_PLATFORM_HEVC)
case AV_CODEC_ID_HEVC: case AV_CODEC_ID_HEVC:
...@@ -795,8 +796,8 @@ void FFmpegDemuxerStream::InitBitstreamConverter() { ...@@ -795,8 +796,8 @@ void FFmpegDemuxerStream::InitBitstreamConverter() {
// ADTS anyways, so skip bitstream conversion when the profile is // ADTS anyways, so skip bitstream conversion when the profile is
// unknown. // unknown.
if (audio_config_->profile() != AudioCodecProfile::kXHE_AAC) { if (audio_config_->profile() != AudioCodecProfile::kXHE_AAC) {
bitstream_converter_.reset( bitstream_converter_ =
new FFmpegAACBitstreamConverter(stream_->codecpar)); std::make_unique<FFmpegAACBitstreamConverter>(stream_->codecpar);
} }
break; break;
default: default:
...@@ -953,10 +954,10 @@ void FFmpegDemuxer::Initialize(DemuxerHost* host, ...@@ -953,10 +954,10 @@ void FFmpegDemuxer::Initialize(DemuxerHost* host,
// Give a WeakPtr to BlockingUrlProtocol since we'll need to release it on the // Give a WeakPtr to BlockingUrlProtocol since we'll need to release it on the
// blocking thread pool. // blocking thread pool.
url_protocol_.reset(new BlockingUrlProtocol( url_protocol_ = std::make_unique<BlockingUrlProtocol>(
data_source_, BindToCurrentLoop(base::Bind( data_source_, BindToCurrentLoop(base::Bind(
&FFmpegDemuxer::OnDataSourceError, weak_this_)))); &FFmpegDemuxer::OnDataSourceError, weak_this_)));
glue_.reset(new FFmpegGlue(url_protocol_.get())); glue_ = std::make_unique<FFmpegGlue>(url_protocol_.get());
AVFormatContext* format_context = glue_->format_context(); AVFormatContext* format_context = glue_->format_context();
// Disable ID3v1 tag reading to avoid costly seeks to end of file for data we // Disable ID3v1 tag reading to avoid costly seeks to end of file for data we
...@@ -1565,8 +1566,7 @@ void FFmpegDemuxer::LogMetadata(AVFormatContext* avctx, ...@@ -1565,8 +1566,7 @@ void FFmpegDemuxer::LogMetadata(AVFormatContext* avctx,
DCHECK_EQ(avctx->nb_streams, streams_.size()); DCHECK_EQ(avctx->nb_streams, streams_.size());
for (size_t i = 0; i < streams_.size(); ++i) { for (auto const& stream : streams_) {
FFmpegDemuxerStream* stream = streams_[i].get();
if (!stream) if (!stream)
continue; continue;
if (stream->type() == DemuxerStream::AUDIO) { if (stream->type() == DemuxerStream::AUDIO) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment