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_BASE_FAKE_DEMUXER_STREAM_H_ | 5 #ifndef MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ |
6 #define MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ | 6 #define MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // always clears |hold_next_read_|. | 62 // always clears |hold_next_read_|. |
63 void Reset(); | 63 void Reset(); |
64 | 64 |
65 // Reset() this demuxer stream and set the reading position to the start of | 65 // Reset() this demuxer stream and set the reading position to the start of |
66 // the stream. | 66 // the stream. |
67 void SeekToStart(); | 67 void SeekToStart(); |
68 | 68 |
69 // Sets further read requests to return EOS buffers. | 69 // Sets further read requests to return EOS buffers. |
70 void SeekToEndOfStream(); | 70 void SeekToEndOfStream(); |
71 | 71 |
72 // Sets the splice timestamp for all furture buffers returned via Read(). | |
73 void set_splice_timestamp(base::TimeDelta splice_timestamp) { | |
74 splice_timestamp_ = splice_timestamp; | |
75 } | |
76 | |
77 private: | 72 private: |
78 void UpdateVideoDecoderConfig(); | 73 void UpdateVideoDecoderConfig(); |
79 void DoRead(); | 74 void DoRead(); |
80 | 75 |
81 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 76 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
82 | 77 |
83 const int num_configs_; | 78 const int num_configs_; |
84 const int num_buffers_in_one_config_; | 79 const int num_buffers_in_one_config_; |
85 const bool config_changes_; | 80 const bool config_changes_; |
86 const bool is_encrypted_; | 81 const bool is_encrypted_; |
87 | 82 |
88 int num_configs_left_; | 83 int num_configs_left_; |
89 | 84 |
90 // Number of frames left with the current decoder config. | 85 // Number of frames left with the current decoder config. |
91 int num_buffers_left_in_current_config_; | 86 int num_buffers_left_in_current_config_; |
92 | 87 |
93 int num_buffers_returned_; | 88 int num_buffers_returned_; |
94 | 89 |
95 base::TimeDelta current_timestamp_; | 90 base::TimeDelta current_timestamp_; |
96 base::TimeDelta duration_; | 91 base::TimeDelta duration_; |
97 base::TimeDelta splice_timestamp_; | |
98 | 92 |
99 gfx::Size next_coded_size_; | 93 gfx::Size next_coded_size_; |
100 VideoDecoderConfig video_decoder_config_; | 94 VideoDecoderConfig video_decoder_config_; |
101 | 95 |
102 ReadCB read_cb_; | 96 ReadCB read_cb_; |
103 | 97 |
104 int next_read_num_; | 98 int next_read_num_; |
105 // Zero-based number indicating which read operation should be held. -1 means | 99 // Zero-based number indicating which read operation should be held. -1 means |
106 // no read shall be held. | 100 // no read shall be held. |
107 int read_to_hold_; | 101 int read_to_hold_; |
(...skipping 14 matching lines...) Expand all Loading... |
122 | 116 |
123 private: | 117 private: |
124 FakeDemuxerStream fake_video_stream_; | 118 FakeDemuxerStream fake_video_stream_; |
125 | 119 |
126 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStreamProvider); | 120 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStreamProvider); |
127 }; | 121 }; |
128 | 122 |
129 } // namespace media | 123 } // namespace media |
130 | 124 |
131 #endif // MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ | 125 #endif // MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ |
OLD | NEW |