OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // process when this method is called. | 90 // process when this method is called. |
91 // If |is_browser_seek| is true, then this is a short-term hack browser | 91 // If |is_browser_seek| is true, then this is a short-term hack browser |
92 // seek. | 92 // seek. |
93 // TODO(wolenetz): Instead of doing browser seek, browser player should replay | 93 // TODO(wolenetz): Instead of doing browser seek, browser player should replay |
94 // cached data since last keyframe. See http://crbug.com/304234. | 94 // cached data since last keyframe. See http://crbug.com/304234. |
95 void Seek(const base::TimeDelta& seek_time, bool is_browser_seek); | 95 void Seek(const base::TimeDelta& seek_time, bool is_browser_seek); |
96 | 96 |
97 // Called when DemuxerStreamPlayer needs to read data from ChunkDemuxer. | 97 // Called when DemuxerStreamPlayer needs to read data from ChunkDemuxer. |
98 void OnReadFromDemuxer(media::DemuxerStream::Type type); | 98 void OnReadFromDemuxer(media::DemuxerStream::Type type); |
99 | 99 |
100 // Called when the player needs the new config data from ChunkDemuxer. | |
101 void OnMediaConfigRequest(); | |
102 | |
103 // Called by the Destroyer to destroy an instance of this object. | 100 // Called by the Destroyer to destroy an instance of this object. |
104 void Destroy(); | 101 void Destroy(); |
105 | 102 |
106 // Called on the main thread to check whether the video stream is encrypted. | 103 // Called on the main thread to check whether the video stream is encrypted. |
107 bool IsVideoEncrypted(); | 104 bool IsVideoEncrypted(); |
108 | 105 |
109 // Gets the ChunkDemuxer timeline offset. | 106 // Gets the ChunkDemuxer timeline offset. |
110 base::Time GetTimelineOffset() const; | 107 base::Time GetTimelineOffset() const; |
111 | 108 |
112 private: | 109 private: |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 bool IsSeeking() const; | 173 bool IsSeeking() const; |
177 | 174 |
178 // Returns |seek_time| if it is still buffered or if there is no currently | 175 // Returns |seek_time| if it is still buffered or if there is no currently |
179 // buffered range including or soon after |seek_time|. If |seek_time| is not | 176 // buffered range including or soon after |seek_time|. If |seek_time| is not |
180 // buffered, but there is a later range buffered near to |seek_time|, returns | 177 // buffered, but there is a later range buffered near to |seek_time|, returns |
181 // next buffered range's start time instead. Only call this for browser seeks. | 178 // next buffered range's start time instead. Only call this for browser seeks. |
182 // |seeking_lock_| must be held by caller. | 179 // |seeking_lock_| must be held by caller. |
183 base::TimeDelta FindBufferedBrowserSeekTime_Locked( | 180 base::TimeDelta FindBufferedBrowserSeekTime_Locked( |
184 const base::TimeDelta& seek_time) const; | 181 const base::TimeDelta& seek_time) const; |
185 | 182 |
| 183 // Get the demuxer configs for a particular stream identified by |is_audio|. |
| 184 // Returns true on success, of false otherwise. |
| 185 bool GetDemuxerConfigFromStream(media::DemuxerConfigs* configs, |
| 186 bool is_audio); |
| 187 |
186 RendererDemuxerAndroid* demuxer_client_; | 188 RendererDemuxerAndroid* demuxer_client_; |
187 int demuxer_client_id_; | 189 int demuxer_client_id_; |
188 | 190 |
189 scoped_refptr<media::MediaLog> media_log_; | 191 scoped_refptr<media::MediaLog> media_log_; |
190 UpdateNetworkStateCB update_network_state_cb_; | 192 UpdateNetworkStateCB update_network_state_cb_; |
191 DurationChangeCB duration_change_cb_; | 193 DurationChangeCB duration_change_cb_; |
192 | 194 |
193 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_; | 195 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_; |
194 bool is_demuxer_ready_; | 196 bool is_demuxer_ready_; |
195 | 197 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; | 242 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; |
241 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; | 243 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; |
242 base::WeakPtr<MediaSourceDelegate> main_weak_this_; | 244 base::WeakPtr<MediaSourceDelegate> main_weak_this_; |
243 | 245 |
244 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); | 246 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); |
245 }; | 247 }; |
246 | 248 |
247 } // namespace content | 249 } // namespace content |
248 | 250 |
249 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 251 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
OLD | NEW |