Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ | 5 #ifndef MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ |
| 6 #define MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ | 6 #define MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 bool is_encrypted); | 28 bool is_encrypted); |
| 29 virtual ~FakeDemuxerStream(); | 29 virtual ~FakeDemuxerStream(); |
| 30 | 30 |
| 31 // DemuxerStream implementation. | 31 // DemuxerStream implementation. |
| 32 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 32 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
| 33 virtual const AudioDecoderConfig& audio_decoder_config() OVERRIDE; | 33 virtual const AudioDecoderConfig& audio_decoder_config() OVERRIDE; |
| 34 virtual const VideoDecoderConfig& video_decoder_config() OVERRIDE; | 34 virtual const VideoDecoderConfig& video_decoder_config() OVERRIDE; |
| 35 virtual Type type() OVERRIDE; | 35 virtual Type type() OVERRIDE; |
| 36 virtual void EnableBitstreamConverter() OVERRIDE; | 36 virtual void EnableBitstreamConverter() OVERRIDE; |
| 37 | 37 |
| 38 int num_buffers_returned() const { return num_buffers_returned_; } | |
| 39 | |
| 38 // Upon the next read, holds the read callback until SatisfyRead() or Reset() | 40 // Upon the next read, holds the read callback until SatisfyRead() or Reset() |
| 39 // is called. | 41 // is called. |
| 40 void HoldNextRead(); | 42 void HoldNextRead(); |
| 41 | 43 |
| 42 // Satisfies the pending read with the next scheduled status and buffer. | 44 // Satisfies the pending read with the next scheduled status and buffer. |
| 43 void SatisfyRead(); | 45 void SatisfyRead(); |
| 44 | 46 |
| 45 // Satisfies the pending read (if any) with kAborted and NULL. This call | 47 // Satisfies the pending read (if any) with kAborted and NULL. This call |
| 46 // always clears |hold_next_read_|. | 48 // always clears |hold_next_read_|. |
| 47 void Reset(); | 49 void Reset(); |
| 48 | 50 |
| 49 private: | 51 private: |
| 50 void UpdateVideoDecoderConfig(); | 52 void UpdateVideoDecoderConfig(); |
| 51 void DoRead(); | 53 void DoRead(); |
| 52 | 54 |
| 53 scoped_refptr<base::MessageLoopProxy> message_loop_; | 55 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 54 | 56 |
| 55 int num_configs_left_; | 57 int num_configs_left_; |
| 56 int num_buffers_in_one_config_; | 58 int num_buffers_in_one_config_; |
| 57 bool is_encrypted_; | 59 bool is_encrypted_; |
| 58 | 60 |
| 59 // Number of frames left with the current decoder config. | 61 // Number of frames left with the current decoder config. |
| 60 int num_buffers_left_in_current_config_; | 62 int num_buffers_left_in_current_config_; |
| 61 | 63 |
| 64 int num_buffers_returned_; | |
| 65 | |
| 62 base::TimeDelta current_timestamp_; | 66 base::TimeDelta current_timestamp_; |
| 63 base::TimeDelta duration_; | 67 base::TimeDelta duration_; |
| 64 | 68 |
| 65 AudioDecoderConfig audio_decoder_config_; | 69 AudioDecoderConfig audio_decoder_config_; |
| 66 | 70 |
| 67 gfx::Size next_coded_size_; | 71 gfx::Size next_coded_size_; |
| 68 VideoDecoderConfig video_decoder_config_; | 72 VideoDecoderConfig video_decoder_config_; |
| 69 | 73 |
| 70 ReadCB read_cb_; | 74 ReadCB read_cb_; |
| 71 bool hold_next_read_; | 75 bool hold_next_read_; |
|
scherkus (not reviewing)
2013/05/09 20:07:09
can this use your new CallbackHolder?
xhwang
2013/05/22 04:29:42
The only reason I am not using that is I want Rese
| |
| 72 | 76 |
| 73 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); | 77 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 } // namespace media | 80 } // namespace media |
| 77 | 81 |
| 78 #endif // MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ | 82 #endif // MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ |
| OLD | NEW |