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