| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // | 26 // |
| 27 class AVPacketBuffer : public Buffer { | 27 class AVPacketBuffer : public Buffer { |
| 28 public: | 28 public: |
| 29 AVPacketBuffer(scoped_ptr_malloc<AVPacket, ScopedPtrAVFreePacket> packet, | 29 AVPacketBuffer(scoped_ptr_malloc<AVPacket, ScopedPtrAVFreePacket> packet, |
| 30 const base::TimeDelta& timestamp, | 30 const base::TimeDelta& timestamp, |
| 31 const base::TimeDelta& duration) | 31 const base::TimeDelta& duration) |
| 32 : Buffer(timestamp, duration), | 32 : Buffer(timestamp, duration), |
| 33 packet_(packet.Pass()) { | 33 packet_(packet.Pass()) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual ~AVPacketBuffer() {} | |
| 37 | |
| 38 // Buffer implementation. | 36 // Buffer implementation. |
| 39 virtual const uint8* GetData() const { | 37 virtual const uint8* GetData() const { |
| 40 return reinterpret_cast<const uint8*>(packet_->data); | 38 return reinterpret_cast<const uint8*>(packet_->data); |
| 41 } | 39 } |
| 42 | 40 |
| 43 virtual int GetDataSize() const { | 41 virtual int GetDataSize() const { |
| 44 return packet_->size; | 42 return packet_->size; |
| 45 } | 43 } |
| 46 | 44 |
| 47 private: | 45 private: |
| 46 virtual ~AVPacketBuffer() {} |
| 47 |
| 48 scoped_ptr_malloc<AVPacket, ScopedPtrAVFreePacket> packet_; | 48 scoped_ptr_malloc<AVPacket, ScopedPtrAVFreePacket> packet_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(AVPacketBuffer); | 50 DISALLOW_COPY_AND_ASSIGN(AVPacketBuffer); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 | 53 |
| 54 // | 54 // |
| 55 // FFmpegDemuxerStream | 55 // FFmpegDemuxerStream |
| 56 // | 56 // |
| 57 FFmpegDemuxerStream::FFmpegDemuxerStream(FFmpegDemuxer* demuxer, | 57 FFmpegDemuxerStream::FFmpegDemuxerStream(FFmpegDemuxer* demuxer, |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 read_event_.Wait(); | 718 read_event_.Wait(); |
| 719 return last_read_bytes_; | 719 return last_read_bytes_; |
| 720 } | 720 } |
| 721 | 721 |
| 722 void FFmpegDemuxer::SignalReadCompleted(int size) { | 722 void FFmpegDemuxer::SignalReadCompleted(int size) { |
| 723 last_read_bytes_ = size; | 723 last_read_bytes_ = size; |
| 724 read_event_.Signal(); | 724 read_event_.Signal(); |
| 725 } | 725 } |
| 726 | 726 |
| 727 } // namespace media | 727 } // namespace media |
| OLD | NEW |