OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ |
6 #define CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ | 6 #define CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // time, then start rendering samples. | 47 // time, then start rendering samples. |
48 bool StartPlayingFrom(base::TimeDelta time, | 48 bool StartPlayingFrom(base::TimeDelta time, |
49 const scoped_refptr<BufferingState>& buffering_state); | 49 const scoped_refptr<BufferingState>& buffering_state); |
50 void Flush(const base::Closure& flush_cb); | 50 void Flush(const base::Closure& flush_cb); |
51 | 51 |
52 // Stop feeding the backend. | 52 // Stop feeding the backend. |
53 void Stop(); | 53 void Stop(); |
54 | 54 |
55 virtual void UpdateStatistics() = 0; | 55 virtual void UpdateStatistics() = 0; |
56 | 56 |
57 int bytes_decoded_since_last_update() { | |
58 return bytes_decoded_since_last_update_; | |
59 } | |
halliwell
2016/03/11 02:04:32
nit: const
ejason
2016/03/11 17:33:41
Done.
| |
60 | |
57 protected: | 61 protected: |
58 // Pipeline states. | 62 // Pipeline states. |
59 enum State { | 63 enum State { |
60 kUninitialized, | 64 kUninitialized, |
61 kPlaying, | 65 kPlaying, |
62 kFlushing, | 66 kFlushing, |
63 kFlushed, | 67 kFlushed, |
64 kStopped, | 68 kStopped, |
65 kError, | 69 kError, |
66 }; | 70 }; |
67 | 71 |
68 State state() const { return state_; } | 72 State state() const { return state_; } |
69 void set_state(State state) { state_ = state; } | 73 void set_state(State state) { state_ = state; } |
70 const AvPipelineClient& client() const { return client_; } | 74 const AvPipelineClient& client() const { return client_; } |
71 | 75 |
72 virtual void OnUpdateConfig( | 76 virtual void OnUpdateConfig( |
73 StreamId id, | 77 StreamId id, |
74 const ::media::AudioDecoderConfig& audio_config, | 78 const ::media::AudioDecoderConfig& audio_config, |
75 const ::media::VideoDecoderConfig& video_config) = 0; | 79 const ::media::VideoDecoderConfig& video_config) = 0; |
76 | 80 |
77 // Setting the frame provider must be done in the |kUninitialized| state. | 81 // Setting the frame provider must be done in the |kUninitialized| state. |
78 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider, | 82 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider, |
79 size_t max_buffer_size, | 83 size_t max_buffer_size, |
80 size_t max_frame_size); | 84 size_t max_frame_size); |
81 | 85 |
82 ::media::PipelineStatistics previous_stats_; | 86 ::media::PipelineStatistics previous_stats_; |
87 int bytes_decoded_since_last_update_; | |
83 | 88 |
84 private: | 89 private: |
85 void OnFlushDone(); | 90 void OnFlushDone(); |
86 | 91 |
87 // MediaPipelineBackend::Decoder::Delegate implementation: | 92 // MediaPipelineBackend::Decoder::Delegate implementation: |
88 void OnPushBufferComplete(BufferStatus status) override; | 93 void OnPushBufferComplete(BufferStatus status) override; |
89 void OnEndOfStream() override; | 94 void OnEndOfStream() override; |
90 void OnDecoderError() override; | 95 void OnDecoderError() override; |
91 void OnKeyStatusChanged(const std::string& key_id, | 96 void OnKeyStatusChanged(const std::string& key_id, |
92 CastKeyStatus key_status, | 97 CastKeyStatus key_status, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 base::WeakPtr<AvPipelineImpl> weak_this_; | 177 base::WeakPtr<AvPipelineImpl> weak_this_; |
173 base::WeakPtrFactory<AvPipelineImpl> weak_factory_; | 178 base::WeakPtrFactory<AvPipelineImpl> weak_factory_; |
174 | 179 |
175 DISALLOW_COPY_AND_ASSIGN(AvPipelineImpl); | 180 DISALLOW_COPY_AND_ASSIGN(AvPipelineImpl); |
176 }; | 181 }; |
177 | 182 |
178 } // namespace media | 183 } // namespace media |
179 } // namespace chromecast | 184 } // namespace chromecast |
180 | 185 |
181 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ | 186 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ |
OLD | NEW |