Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: media/filters/ffmpeg_demuxer.cc

Issue 2448763002: FFmpegDemuxer: Clear |extra_data| when enabling bitstream conversion. (Closed)
Patch Set: Restore variant used by fuzzertest. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/video_decoder_config.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 #if defined(USE_PROPRIETARY_CODECS) 663 #if defined(USE_PROPRIETARY_CODECS)
664 if (bitstream_converter_) 664 if (bitstream_converter_)
665 InitBitstreamConverter(); 665 InitBitstreamConverter();
666 #endif // defined(USE_PROPRIETARY_CODECS) 666 #endif // defined(USE_PROPRIETARY_CODECS)
667 } 667 }
668 668
669 void FFmpegDemuxerStream::InitBitstreamConverter() { 669 void FFmpegDemuxerStream::InitBitstreamConverter() {
670 #if defined(USE_PROPRIETARY_CODECS) 670 #if defined(USE_PROPRIETARY_CODECS)
671 switch (stream_->codec->codec_id) { 671 switch (stream_->codec->codec_id) {
672 case AV_CODEC_ID_H264: 672 case AV_CODEC_ID_H264:
673 // Clear |extra_data| so that future (fallback) decoders will know that
674 // conversion is forcibly enabled on this stream.
675 //
676 // TODO(sandersd): Ideally we would convert |extra_data| to concatenated
677 // SPS/PPS data, but it's too late to be useful because Initialize() was
678 // already called on GpuVideoDecoder, which is the only path that would
679 // consume that data.
680 if (video_config_)
681 video_config_->SetExtraData(std::vector<uint8_t>());
673 bitstream_converter_.reset( 682 bitstream_converter_.reset(
674 new FFmpegH264ToAnnexBBitstreamConverter(stream_->codec)); 683 new FFmpegH264ToAnnexBBitstreamConverter(stream_->codec));
675 break; 684 break;
676 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 685 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
677 case AV_CODEC_ID_HEVC: 686 case AV_CODEC_ID_HEVC:
678 bitstream_converter_.reset( 687 bitstream_converter_.reset(
679 new FFmpegH265ToAnnexBBitstreamConverter(stream_->codec)); 688 new FFmpegH265ToAnnexBBitstreamConverter(stream_->codec));
680 break; 689 break;
681 #endif 690 #endif
682 case AV_CODEC_ID_AAC: 691 case AV_CODEC_ID_AAC:
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 1788
1780 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { 1789 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) {
1781 DCHECK(task_runner_->BelongsToCurrentThread()); 1790 DCHECK(task_runner_->BelongsToCurrentThread());
1782 for (const auto& stream : streams_) { 1791 for (const auto& stream : streams_) {
1783 if (stream) 1792 if (stream)
1784 stream->SetLiveness(liveness); 1793 stream->SetLiveness(liveness);
1785 } 1794 }
1786 } 1795 }
1787 1796
1788 } // namespace media 1797 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_decoder_config.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698