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/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 base::TimeDelta timestamp = | 110 base::TimeDelta timestamp = |
111 ConvertStreamTimestamp(stream_->time_base, packet->pts); | 111 ConvertStreamTimestamp(stream_->time_base, packet->pts); |
112 base::TimeDelta duration = | 112 base::TimeDelta duration = |
113 ConvertStreamTimestamp(stream_->time_base, packet->duration); | 113 ConvertStreamTimestamp(stream_->time_base, packet->duration); |
114 if (stopped_) { | 114 if (stopped_) { |
115 NOTREACHED() << "Attempted to enqueue packet on a stopped stream"; | 115 NOTREACHED() << "Attempted to enqueue packet on a stopped stream"; |
116 return timestamp; | 116 return timestamp; |
117 } | 117 } |
118 | 118 |
119 // Convert if the packet if there is bitstream filter. | 119 // Convert if the packet if there is bitstream filter. |
120 if (bitstream_converter_.get() && | 120 if (packet->data && bitstream_converter_.get() && |
121 !bitstream_converter_->ConvertPacket(packet)) { | 121 !bitstream_converter_->ConvertPacket(packet)) { |
122 LOG(ERROR) << "Format converstion failed."; | 122 LOG(ERROR) << "Format converstion failed."; |
123 } | 123 } |
124 | 124 |
125 // Enqueue the callback and attempt to satisfy a read immediately. | 125 // Enqueue the callback and attempt to satisfy a read immediately. |
126 scoped_refptr<Buffer> buffer = | 126 scoped_refptr<Buffer> buffer = |
127 new AVPacketBuffer(packet, timestamp, duration); | 127 new AVPacketBuffer(packet, timestamp, duration); |
128 if (!buffer) { | 128 if (!buffer) { |
129 NOTREACHED() << "Unable to allocate AVPacketBuffer"; | 129 NOTREACHED() << "Unable to allocate AVPacketBuffer"; |
130 return timestamp; | 130 return timestamp; |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 read_event_.Wait(); | 616 read_event_.Wait(); |
617 return last_read_bytes_; | 617 return last_read_bytes_; |
618 } | 618 } |
619 | 619 |
620 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 620 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
621 last_read_bytes_ = size; | 621 last_read_bytes_ = size; |
622 read_event_.Signal(); | 622 read_event_.Signal(); |
623 } | 623 } |
624 | 624 |
625 } // namespace media | 625 } // namespace media |
OLD | NEW |