| 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" | 
| 11 #include "base/bind.h" | 11 #include "base/bind.h" | 
| 12 #include "base/callback.h" | 12 #include "base/callback.h" | 
| 13 #include "base/callback_helpers.h" | 13 #include "base/callback_helpers.h" | 
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" | 
| 15 #include "base/message_loop/message_loop_proxy.h" |  | 
| 16 #include "base/metrics/sparse_histogram.h" | 15 #include "base/metrics/sparse_histogram.h" | 
|  | 16 #include "base/single_thread_task_runner.h" | 
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" | 
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" | 
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" | 
| 20 #include "base/sys_byteorder.h" | 20 #include "base/sys_byteorder.h" | 
| 21 #include "base/task_runner_util.h" | 21 #include "base/task_runner_util.h" | 
|  | 22 #include "base/thread_task_runner_handle.h" | 
| 22 #include "base/time/time.h" | 23 #include "base/time/time.h" | 
| 23 #include "media/base/audio_decoder_config.h" | 24 #include "media/base/audio_decoder_config.h" | 
| 24 #include "media/base/bind_to_current_loop.h" | 25 #include "media/base/bind_to_current_loop.h" | 
| 25 #include "media/base/decoder_buffer.h" | 26 #include "media/base/decoder_buffer.h" | 
| 26 #include "media/base/decrypt_config.h" | 27 #include "media/base/decrypt_config.h" | 
| 27 #include "media/base/limits.h" | 28 #include "media/base/limits.h" | 
| 28 #include "media/base/media_log.h" | 29 #include "media/base/media_log.h" | 
| 29 #include "media/base/video_decoder_config.h" | 30 #include "media/base/video_decoder_config.h" | 
| 30 #include "media/ffmpeg/ffmpeg_common.h" | 31 #include "media/ffmpeg/ffmpeg_common.h" | 
| 31 #include "media/filters/ffmpeg_aac_bitstream_converter.h" | 32 #include "media/filters/ffmpeg_aac_bitstream_converter.h" | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 83   // presentation timestamp. | 84   // presentation timestamp. | 
| 84   return start_time; | 85   return start_time; | 
| 85 } | 86 } | 
| 86 | 87 | 
| 87 // | 88 // | 
| 88 // FFmpegDemuxerStream | 89 // FFmpegDemuxerStream | 
| 89 // | 90 // | 
| 90 FFmpegDemuxerStream::FFmpegDemuxerStream(FFmpegDemuxer* demuxer, | 91 FFmpegDemuxerStream::FFmpegDemuxerStream(FFmpegDemuxer* demuxer, | 
| 91                                          AVStream* stream) | 92                                          AVStream* stream) | 
| 92     : demuxer_(demuxer), | 93     : demuxer_(demuxer), | 
| 93       task_runner_(base::MessageLoopProxy::current()), | 94       task_runner_(base::ThreadTaskRunnerHandle::Get()), | 
| 94       stream_(stream), | 95       stream_(stream), | 
| 95       type_(UNKNOWN), | 96       type_(UNKNOWN), | 
| 96       liveness_(LIVENESS_UNKNOWN), | 97       liveness_(LIVENESS_UNKNOWN), | 
| 97       end_of_stream_(false), | 98       end_of_stream_(false), | 
| 98       last_packet_timestamp_(kNoTimestamp()), | 99       last_packet_timestamp_(kNoTimestamp()), | 
| 99       last_packet_duration_(kNoTimestamp()), | 100       last_packet_duration_(kNoTimestamp()), | 
| 100       video_rotation_(VIDEO_ROTATION_0), | 101       video_rotation_(VIDEO_ROTATION_0), | 
| 101       fixup_negative_ogg_timestamps_(false) { | 102       fixup_negative_ogg_timestamps_(false) { | 
| 102   DCHECK(demuxer_); | 103   DCHECK(demuxer_); | 
| 103 | 104 | 
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1294 | 1295 | 
| 1295 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1296 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 
| 1296   DCHECK(task_runner_->BelongsToCurrentThread()); | 1297   DCHECK(task_runner_->BelongsToCurrentThread()); | 
| 1297   for (const auto& stream : streams_) {  // |stream| is a ref to a pointer. | 1298   for (const auto& stream : streams_) {  // |stream| is a ref to a pointer. | 
| 1298     if (stream) | 1299     if (stream) | 
| 1299       stream->SetLiveness(liveness); | 1300       stream->SetLiveness(liveness); | 
| 1300   } | 1301   } | 
| 1301 } | 1302 } | 
| 1302 | 1303 | 
| 1303 }  // namespace media | 1304 }  // namespace media | 
| OLD | NEW | 
|---|