OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/scoped_ptr.h" | 5 #include "base/scoped_ptr.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "media/base/filter_host.h" | 8 #include "media/base/filter_host.h" |
9 #include "media/filters/ffmpeg_common.h" | 9 #include "media/filters/ffmpeg_common.h" |
10 #include "media/filters/ffmpeg_demuxer.h" | 10 #include "media/filters/ffmpeg_demuxer.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 base::TimeDelta duration = time_base_ * packet->duration; | 116 base::TimeDelta duration = time_base_ * packet->duration; |
117 Buffer* buffer = new AVPacketBuffer(packet, timestamp, duration); | 117 Buffer* buffer = new AVPacketBuffer(packet, timestamp, duration); |
118 DCHECK(buffer); | 118 DCHECK(buffer); |
119 { | 119 { |
120 AutoLock auto_lock(lock_); | 120 AutoLock auto_lock(lock_); |
121 input_queue_.push_back(buffer); | 121 input_queue_.push_back(buffer); |
122 } | 122 } |
123 FulfillPendingReads(); | 123 FulfillPendingReads(); |
124 } | 124 } |
125 | 125 |
126 const MediaFormat* FFmpegDemuxerStream::GetMediaFormat() { | 126 const MediaFormat& FFmpegDemuxerStream::media_format() { |
127 return &media_format_; | 127 return media_format_; |
128 } | 128 } |
129 | 129 |
130 void FFmpegDemuxerStream::Read(Assignable<Buffer>* buffer) { | 130 void FFmpegDemuxerStream::Read(Assignable<Buffer>* buffer) { |
131 DCHECK(buffer); | 131 DCHECK(buffer); |
132 { | 132 { |
133 AutoLock auto_lock(lock_); | 133 AutoLock auto_lock(lock_); |
134 output_queue_.push_back(scoped_refptr< Assignable<Buffer> >(buffer)); | 134 output_queue_.push_back(scoped_refptr< Assignable<Buffer> >(buffer)); |
135 } | 135 } |
136 if (FulfillPendingReads()) { | 136 if (FulfillPendingReads()) { |
137 demuxer_->ScheduleDemux(); | 137 demuxer_->ScheduleDemux(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 StreamVector::iterator iter; | 284 StreamVector::iterator iter; |
285 for (iter = streams_.begin(); iter != streams_.end(); ++iter) { | 285 for (iter = streams_.begin(); iter != streams_.end(); ++iter) { |
286 if ((*iter)->HasPendingReads()) { | 286 if ((*iter)->HasPendingReads()) { |
287 return true; | 287 return true; |
288 } | 288 } |
289 } | 289 } |
290 return false; | 290 return false; |
291 } | 291 } |
292 | 292 |
293 } // namespace media | 293 } // namespace media |
OLD | NEW |