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 |
11 #include <list> | 11 #include <list> |
| 12 #include <memory> |
12 #include <string> | 13 #include <string> |
13 | 14 |
14 #include "base/callback.h" | 15 #include "base/callback.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/threading/thread_checker.h" | 19 #include "base/threading/thread_checker.h" |
20 #include "chromecast/media/cma/pipeline/av_pipeline_client.h" | 20 #include "chromecast/media/cma/pipeline/av_pipeline_client.h" |
21 #include "chromecast/public/media/media_pipeline_backend.h" | 21 #include "chromecast/public/media/media_pipeline_backend.h" |
22 #include "chromecast/public/media/stream_id.h" | 22 #include "chromecast/public/media/stream_id.h" |
23 #include "media/base/pipeline_status.h" | 23 #include "media/base/pipeline_status.h" |
24 | 24 |
25 namespace media { | 25 namespace media { |
26 class AudioDecoderConfig; | 26 class AudioDecoderConfig; |
27 class VideoDecoderConfig; | 27 class VideoDecoderConfig; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 State state() const { return state_; } | 72 State state() const { return state_; } |
73 void set_state(State state) { state_ = state; } | 73 void set_state(State state) { state_ = state; } |
74 const AvPipelineClient& client() const { return client_; } | 74 const AvPipelineClient& client() const { return client_; } |
75 | 75 |
76 virtual void OnUpdateConfig( | 76 virtual void OnUpdateConfig( |
77 StreamId id, | 77 StreamId id, |
78 const ::media::AudioDecoderConfig& audio_config, | 78 const ::media::AudioDecoderConfig& audio_config, |
79 const ::media::VideoDecoderConfig& video_config) = 0; | 79 const ::media::VideoDecoderConfig& video_config) = 0; |
80 | 80 |
81 // Setting the frame provider must be done in the |kUninitialized| state. | 81 // Setting the frame provider must be done in the |kUninitialized| state. |
82 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider, | 82 void SetCodedFrameProvider(std::unique_ptr<CodedFrameProvider> frame_provider, |
83 size_t max_buffer_size, | 83 size_t max_buffer_size, |
84 size_t max_frame_size); | 84 size_t max_frame_size); |
85 | 85 |
86 ::media::PipelineStatistics previous_stats_; | 86 ::media::PipelineStatistics previous_stats_; |
87 int bytes_decoded_since_last_update_; | 87 int bytes_decoded_since_last_update_; |
88 | 88 |
89 private: | 89 private: |
90 void OnFlushDone(); | 90 void OnFlushDone(); |
91 | 91 |
92 // MediaPipelineBackend::Decoder::Delegate implementation: | 92 // MediaPipelineBackend::Decoder::Delegate implementation: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // |playable_buffered_time_| is the maximum timestamp of buffered and | 144 // |playable_buffered_time_| is the maximum timestamp of buffered and |
145 // playable frames (i.e. the key id is available for those frames). | 145 // playable frames (i.e. the key id is available for those frames). |
146 base::TimeDelta buffered_time_; | 146 base::TimeDelta buffered_time_; |
147 base::TimeDelta playable_buffered_time_; | 147 base::TimeDelta playable_buffered_time_; |
148 | 148 |
149 // List of frames buffered but not playable right away due to a missing | 149 // List of frames buffered but not playable right away due to a missing |
150 // key id. | 150 // key id. |
151 std::list<scoped_refptr<DecoderBufferBase> > non_playable_frames_; | 151 std::list<scoped_refptr<DecoderBufferBase> > non_playable_frames_; |
152 | 152 |
153 // Buffer provider. | 153 // Buffer provider. |
154 scoped_ptr<BufferingFrameProvider> frame_provider_; | 154 std::unique_ptr<BufferingFrameProvider> frame_provider_; |
155 | 155 |
156 // Indicate whether the frame fetching process is active. | 156 // Indicate whether the frame fetching process is active. |
157 bool enable_feeding_; | 157 bool enable_feeding_; |
158 | 158 |
159 // Indicate whether there is a pending buffer read. | 159 // Indicate whether there is a pending buffer read. |
160 bool pending_read_; | 160 bool pending_read_; |
161 | 161 |
162 // Pending buffer (not pushed to device yet) | 162 // Pending buffer (not pushed to device yet) |
163 scoped_refptr<DecoderBufferBase> pending_buffer_; | 163 scoped_refptr<DecoderBufferBase> pending_buffer_; |
164 | 164 |
(...skipping 12 matching lines...) Expand all Loading... |
177 base::WeakPtr<AvPipelineImpl> weak_this_; | 177 base::WeakPtr<AvPipelineImpl> weak_this_; |
178 base::WeakPtrFactory<AvPipelineImpl> weak_factory_; | 178 base::WeakPtrFactory<AvPipelineImpl> weak_factory_; |
179 | 179 |
180 DISALLOW_COPY_AND_ASSIGN(AvPipelineImpl); | 180 DISALLOW_COPY_AND_ASSIGN(AvPipelineImpl); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace media | 183 } // namespace media |
184 } // namespace chromecast | 184 } // namespace chromecast |
185 | 185 |
186 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ | 186 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_AV_PIPELINE_IMPL_H_ |
OLD | NEW |