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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 264743016: Change H264AnnexBBitstreamConverter to use AVCDecoderConfigurationRecord. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix build busters. Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index aa829d75462a0c11a7f9116e013ddd966ef59cc9..dd41410d7200cb7ea9076f632e78e9efa3209bfd 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -95,10 +95,12 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(
// Calculate the duration.
duration_ = ConvertStreamTimestamp(stream->time_base, stream->duration);
+#if defined(USE_PROPRIETARY_CODECS)
if (stream_->codec->codec_id == AV_CODEC_ID_H264) {
bitstream_converter_.reset(
new FFmpegH264ToAnnexBBitstreamConverter(stream_->codec));
}
+#endif
if (is_encrypted) {
AVDictionaryEntry* key = av_dict_get(stream->metadata, "enc_key_id", NULL,
@@ -127,11 +129,13 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
return;
}
+#if defined(USE_PROPRIETARY_CODECS)
// Convert the packet if there is a bitstream filter.
if (packet->data && bitstream_converter_enabled_ &&
!bitstream_converter_->ConvertPacket(packet.get())) {
LOG(ERROR) << "Format conversion failed.";
}
+#endif
// Get side data if any. For now, the only type of side_data is VP8 Alpha. We
// keep this generic so that other side_data types in the future can be
@@ -293,8 +297,13 @@ void FFmpegDemuxerStream::Read(const ReadCB& read_cb) {
void FFmpegDemuxerStream::EnableBitstreamConverter() {
DCHECK(task_runner_->BelongsToCurrentThread());
+
+#if defined(USE_PROPRIETARY_CODECS)
CHECK(bitstream_converter_.get());
bitstream_converter_enabled_ = true;
+#else
+ NOTREACHED() << "Proprietary codecs not enabled.";
scherkus (not reviewing) 2014/05/05 18:22:17 will this end up being logspam?
acolwell GONE FROM CHROMIUM 2014/05/05 18:49:02 It shouldn't. Nothing should be calling this metho
+#endif
}
bool FFmpegDemuxerStream::SupportsConfigChanges() { return false; }

Powered by Google App Engine
This is Rietveld 408576698