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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 void SatisfyReadAndHoldNext(); | 55 void SatisfyReadAndHoldNext(); |
56 | 56 |
57 // Satisfies the pending read (if any) with kAborted and NULL. This call | 57 // Satisfies the pending read (if any) with kAborted and NULL. This call |
58 // always clears |hold_next_read_|. | 58 // always clears |hold_next_read_|. |
59 void Reset(); | 59 void Reset(); |
60 | 60 |
61 // Reset() this demuxer stream and set the reading position to the start of | 61 // Reset() this demuxer stream and set the reading position to the start of |
62 // the stream. | 62 // the stream. |
63 void SeekToStart(); | 63 void SeekToStart(); |
64 | 64 |
| 65 // Sets the splice timestamp for all furture buffers returned via Read(). |
| 66 void set_splice_timestamp(base::TimeDelta splice_timestamp) { |
| 67 splice_timestamp_ = splice_timestamp; |
| 68 } |
| 69 |
65 private: | 70 private: |
66 void UpdateVideoDecoderConfig(); | 71 void UpdateVideoDecoderConfig(); |
67 void DoRead(); | 72 void DoRead(); |
68 | 73 |
69 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 74 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
70 | 75 |
71 const int num_configs_; | 76 const int num_configs_; |
72 const int num_buffers_in_one_config_; | 77 const int num_buffers_in_one_config_; |
73 const bool config_changes_; | 78 const bool config_changes_; |
74 const bool is_encrypted_; | 79 const bool is_encrypted_; |
75 | 80 |
76 int num_configs_left_; | 81 int num_configs_left_; |
77 | 82 |
78 // Number of frames left with the current decoder config. | 83 // Number of frames left with the current decoder config. |
79 int num_buffers_left_in_current_config_; | 84 int num_buffers_left_in_current_config_; |
80 | 85 |
81 int num_buffers_returned_; | 86 int num_buffers_returned_; |
82 | 87 |
83 base::TimeDelta current_timestamp_; | 88 base::TimeDelta current_timestamp_; |
84 base::TimeDelta duration_; | 89 base::TimeDelta duration_; |
| 90 base::TimeDelta splice_timestamp_; |
85 | 91 |
86 gfx::Size next_coded_size_; | 92 gfx::Size next_coded_size_; |
87 VideoDecoderConfig video_decoder_config_; | 93 VideoDecoderConfig video_decoder_config_; |
88 | 94 |
89 ReadCB read_cb_; | 95 ReadCB read_cb_; |
90 | 96 |
91 int next_read_num_; | 97 int next_read_num_; |
92 // Zero-based number indicating which read operation should be held. -1 means | 98 // Zero-based number indicating which read operation should be held. -1 means |
93 // no read shall be held. | 99 // no read shall be held. |
94 int read_to_hold_; | 100 int read_to_hold_; |
95 | 101 |
96 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); | 102 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); |
97 }; | 103 }; |
98 | 104 |
99 } // namespace media | 105 } // namespace media |
100 | 106 |
101 #endif // MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ | 107 #endif // MEDIA_FILTERS_FAKE_DEMUXER_STREAM_H_ |
OLD | NEW |