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 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 #include "media/base/decoder_buffer.h" | 25 #include "media/base/decoder_buffer.h" |
26 #include "media/base/decrypt_config.h" | 26 #include "media/base/decrypt_config.h" |
27 #include "media/base/limits.h" | 27 #include "media/base/limits.h" |
28 #include "media/base/media_log.h" | 28 #include "media/base/media_log.h" |
29 #include "media/base/video_decoder_config.h" | 29 #include "media/base/video_decoder_config.h" |
30 #include "media/ffmpeg/ffmpeg_common.h" | 30 #include "media/ffmpeg/ffmpeg_common.h" |
31 #include "media/filters/ffmpeg_aac_bitstream_converter.h" | 31 #include "media/filters/ffmpeg_aac_bitstream_converter.h" |
32 #include "media/filters/ffmpeg_bitstream_converter.h" | 32 #include "media/filters/ffmpeg_bitstream_converter.h" |
33 #include "media/filters/ffmpeg_glue.h" | 33 #include "media/filters/ffmpeg_glue.h" |
34 #include "media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.h" | 34 #include "media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.h" |
35 #if defined(ENABLE_HEVC_DEMUXING) | |
36 #include "media/filters/ffmpeg_h265_to_annex_b_bitstream_converter.h" | |
37 #endif | |
35 #include "media/filters/webvtt_util.h" | 38 #include "media/filters/webvtt_util.h" |
36 #include "media/formats/webm/webm_crypto_helpers.h" | 39 #include "media/formats/webm/webm_crypto_helpers.h" |
37 | 40 |
38 namespace media { | 41 namespace media { |
39 | 42 |
40 static base::Time ExtractTimelineOffset(AVFormatContext* format_context) { | 43 static base::Time ExtractTimelineOffset(AVFormatContext* format_context) { |
41 if (strstr(format_context->iformat->name, "webm") || | 44 if (strstr(format_context->iformat->name, "webm") || |
42 strstr(format_context->iformat->name, "matroska")) { | 45 strstr(format_context->iformat->name, "matroska")) { |
43 const AVDictionaryEntry* entry = | 46 const AVDictionaryEntry* entry = |
44 av_dict_get(format_context->metadata, "creation_time", NULL, 0); | 47 av_dict_get(format_context->metadata, "creation_time", NULL, 0); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 if (bitstream_converter_) | 456 if (bitstream_converter_) |
454 InitBitstreamConverter(); | 457 InitBitstreamConverter(); |
455 #endif // defined(USE_PROPRIETARY_CODECS) | 458 #endif // defined(USE_PROPRIETARY_CODECS) |
456 } | 459 } |
457 | 460 |
458 void FFmpegDemuxerStream::InitBitstreamConverter() { | 461 void FFmpegDemuxerStream::InitBitstreamConverter() { |
459 #if defined(USE_PROPRIETARY_CODECS) | 462 #if defined(USE_PROPRIETARY_CODECS) |
460 if (stream_->codec->codec_id == AV_CODEC_ID_H264) { | 463 if (stream_->codec->codec_id == AV_CODEC_ID_H264) { |
461 bitstream_converter_.reset( | 464 bitstream_converter_.reset( |
462 new FFmpegH264ToAnnexBBitstreamConverter(stream_->codec)); | 465 new FFmpegH264ToAnnexBBitstreamConverter(stream_->codec)); |
466 #if defined(ENABLE_HEVC_DEMUXING) | |
467 } else if (stream_->codec->codec_id == AV_CODEC_ID_HEVC) { | |
ddorwin
2015/02/23 20:00:49
Do you expect FFmpeg to be built with such support
servolk
2015/02/24 02:15:13
Possibly. At the moment none of the ffmpeg_brandin
| |
468 bitstream_converter_.reset( | |
469 new FFmpegH265ToAnnexBBitstreamConverter(stream_->codec)); | |
470 #endif | |
463 } else if (stream_->codec->codec_id == AV_CODEC_ID_AAC) { | 471 } else if (stream_->codec->codec_id == AV_CODEC_ID_AAC) { |
464 bitstream_converter_.reset( | 472 bitstream_converter_.reset( |
465 new FFmpegAACBitstreamConverter(stream_->codec)); | 473 new FFmpegAACBitstreamConverter(stream_->codec)); |
466 } | 474 } |
467 #endif // defined(USE_PROPRIETARY_CODECS) | 475 #endif // defined(USE_PROPRIETARY_CODECS) |
468 } | 476 } |
469 | 477 |
470 bool FFmpegDemuxerStream::SupportsConfigChanges() { return false; } | 478 bool FFmpegDemuxerStream::SupportsConfigChanges() { return false; } |
471 | 479 |
472 AudioDecoderConfig FFmpegDemuxerStream::audio_decoder_config() { | 480 AudioDecoderConfig FFmpegDemuxerStream::audio_decoder_config() { |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1293 | 1301 |
1294 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1302 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
1295 DCHECK(task_runner_->BelongsToCurrentThread()); | 1303 DCHECK(task_runner_->BelongsToCurrentThread()); |
1296 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. | 1304 for (const auto& stream : streams_) { // |stream| is a ref to a pointer. |
1297 if (stream) | 1305 if (stream) |
1298 stream->SetLiveness(liveness); | 1306 stream->SetLiveness(liveness); |
1299 } | 1307 } |
1300 } | 1308 } |
1301 | 1309 |
1302 } // namespace media | 1310 } // namespace media |
OLD | NEW |