| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Convert if the packet if there is bitstream filter. | 122 // Convert if the packet if there is bitstream filter. |
| 123 if (packet->data && bitstream_converter_.get() && | 123 if (packet->data && bitstream_converter_.get() && |
| 124 !bitstream_converter_->ConvertPacket(packet)) { | 124 !bitstream_converter_->ConvertPacket(packet)) { |
| 125 LOG(ERROR) << "Format converstion failed."; | 125 LOG(ERROR) << "Format converstion failed."; |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Enqueue the callback and attempt to satisfy a read immediately. | 128 // Enqueue the callback and attempt to satisfy a read immediately. |
| 129 scoped_refptr<Buffer> buffer = | 129 scoped_refptr<Buffer> buffer( |
| 130 new AVPacketBuffer(packet, timestamp, duration); | 130 new AVPacketBuffer(packet, timestamp, duration)); |
| 131 if (!buffer) { | 131 if (!buffer) { |
| 132 NOTREACHED() << "Unable to allocate AVPacketBuffer"; | 132 NOTREACHED() << "Unable to allocate AVPacketBuffer"; |
| 133 return; | 133 return; |
| 134 } | 134 } |
| 135 buffer_queue_.push_back(buffer); | 135 buffer_queue_.push_back(buffer); |
| 136 FulfillPendingRead(); | 136 FulfillPendingRead(); |
| 137 return; | 137 return; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void FFmpegDemuxerStream::FlushBuffers() { | 140 void FFmpegDemuxerStream::FlushBuffers() { |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 read_event_.Wait(); | 611 read_event_.Wait(); |
| 612 return last_read_bytes_; | 612 return last_read_bytes_; |
| 613 } | 613 } |
| 614 | 614 |
| 615 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 615 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
| 616 last_read_bytes_ = size; | 616 last_read_bytes_ = size; |
| 617 read_event_.Signal(); | 617 read_event_.Signal(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 } // namespace media | 620 } // namespace media |
| OLD | NEW |