Chromium Code Reviews| 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 private: | 106 private: |
| 110 // This is private to enforce use of the Destroyer. | 107 // This is private to enforce use of the Destroyer. |
| 111 virtual ~MediaSourceDelegate(); | 108 virtual ~MediaSourceDelegate(); |
| 112 | 109 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 bool IsSeeking() const; | 170 bool IsSeeking() const; |
| 174 | 171 |
| 175 // Returns |seek_time| if it is still buffered or if there is no currently | 172 // Returns |seek_time| if it is still buffered or if there is no currently |
| 176 // buffered range including or soon after |seek_time|. If |seek_time| is not | 173 // buffered range including or soon after |seek_time|. If |seek_time| is not |
| 177 // buffered, but there is a later range buffered near to |seek_time|, returns | 174 // buffered, but there is a later range buffered near to |seek_time|, returns |
| 178 // next buffered range's start time instead. Only call this for browser seeks. | 175 // next buffered range's start time instead. Only call this for browser seeks. |
| 179 // |seeking_lock_| must be held by caller. | 176 // |seeking_lock_| must be held by caller. |
| 180 base::TimeDelta FindBufferedBrowserSeekTime_Locked( | 177 base::TimeDelta FindBufferedBrowserSeekTime_Locked( |
| 181 const base::TimeDelta& seek_time) const; | 178 const base::TimeDelta& seek_time) const; |
| 182 | 179 |
| 180 // Gets the demuxer configs from audio/video stream. | |
| 181 void GetDeumuxerConfigFromStream( | |
|
wolenetz
2014/04/25 23:13:13
nit: s/Deumuxer/Demuxer
qinmin
2014/04/26 01:30:11
Done.
| |
| 182 media::DemuxerConfigs* configs, bool is_audio); | |
| 183 | |
| 183 RendererDemuxerAndroid* demuxer_client_; | 184 RendererDemuxerAndroid* demuxer_client_; |
| 184 int demuxer_client_id_; | 185 int demuxer_client_id_; |
| 185 | 186 |
| 186 scoped_refptr<media::MediaLog> media_log_; | 187 scoped_refptr<media::MediaLog> media_log_; |
| 187 UpdateNetworkStateCB update_network_state_cb_; | 188 UpdateNetworkStateCB update_network_state_cb_; |
| 188 DurationChangeCB duration_change_cb_; | 189 DurationChangeCB duration_change_cb_; |
| 189 | 190 |
| 190 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_; | 191 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_; |
| 191 bool is_demuxer_ready_; | 192 bool is_demuxer_ready_; |
| 192 | 193 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; | 238 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; |
| 238 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; | 239 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; |
| 239 base::WeakPtr<MediaSourceDelegate> main_weak_this_; | 240 base::WeakPtr<MediaSourceDelegate> main_weak_this_; |
| 240 | 241 |
| 241 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); | 242 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); |
| 242 }; | 243 }; |
| 243 | 244 |
| 244 } // namespace content | 245 } // namespace content |
| 245 | 246 |
| 246 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 247 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
| OLD | NEW |