| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 base::TimeDelta FFmpegDemuxerStream::duration() { | 144 base::TimeDelta FFmpegDemuxerStream::duration() { |
| 145 return duration_; | 145 return duration_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 DemuxerStream::Type FFmpegDemuxerStream::type() { | 148 DemuxerStream::Type FFmpegDemuxerStream::type() { |
| 149 return type_; | 149 return type_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 const MediaFormat& FFmpegDemuxerStream::media_format() { | |
| 153 return media_format_; | |
| 154 } | |
| 155 | |
| 156 void FFmpegDemuxerStream::Read(const ReadCallback& read_callback) { | 152 void FFmpegDemuxerStream::Read(const ReadCallback& read_callback) { |
| 157 DCHECK(!read_callback.is_null()); | 153 DCHECK(!read_callback.is_null()); |
| 158 | 154 |
| 159 base::AutoLock auto_lock(lock_); | 155 base::AutoLock auto_lock(lock_); |
| 160 if (!buffer_queue_.empty()) { | 156 if (!buffer_queue_.empty()) { |
| 161 // Dequeue a buffer send back. | 157 // Dequeue a buffer send back. |
| 162 scoped_refptr<Buffer> buffer = buffer_queue_.front(); | 158 scoped_refptr<Buffer> buffer = buffer_queue_.front(); |
| 163 buffer_queue_.pop_front(); | 159 buffer_queue_.pop_front(); |
| 164 | 160 |
| 165 // Execute the callback. | 161 // Execute the callback. |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 read_event_.Wait(); | 680 read_event_.Wait(); |
| 685 return last_read_bytes_; | 681 return last_read_bytes_; |
| 686 } | 682 } |
| 687 | 683 |
| 688 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 684 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
| 689 last_read_bytes_ = size; | 685 last_read_bytes_ = size; |
| 690 read_event_.Signal(); | 686 read_event_.Signal(); |
| 691 } | 687 } |
| 692 | 688 |
| 693 } // namespace media | 689 } // namespace media |
| OLD | NEW |