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 20 matching lines...) Expand all Loading... |
31 struct DemuxerConfigs; | 31 struct DemuxerConfigs; |
32 struct DemuxerData; | 32 struct DemuxerData; |
33 } | 33 } |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 | 36 |
37 class RendererDemuxerAndroid; | 37 class RendererDemuxerAndroid; |
38 | 38 |
39 class MediaSourceDelegate : public media::DemuxerHost { | 39 class MediaSourceDelegate : public media::DemuxerHost { |
40 public: | 40 public: |
41 typedef base::Callback<void(WebKit::WebMediaSource*)> | 41 typedef base::Callback<void(blink::WebMediaSource*)> |
42 MediaSourceOpenedCB; | 42 MediaSourceOpenedCB; |
43 typedef base::Callback<void(WebKit::WebMediaPlayer::NetworkState)> | 43 typedef base::Callback<void(blink::WebMediaPlayer::NetworkState)> |
44 UpdateNetworkStateCB; | 44 UpdateNetworkStateCB; |
45 typedef base::Callback<void(const base::TimeDelta&)> DurationChangeCB; | 45 typedef base::Callback<void(const base::TimeDelta&)> DurationChangeCB; |
46 | 46 |
47 // Helper class used by scoped_ptr to destroy an instance of | 47 // Helper class used by scoped_ptr to destroy an instance of |
48 // MediaSourceDelegate. | 48 // MediaSourceDelegate. |
49 class Destroyer { | 49 class Destroyer { |
50 public: | 50 public: |
51 inline void operator()(void* media_source_delegate) const { | 51 inline void operator()(void* media_source_delegate) const { |
52 static_cast<MediaSourceDelegate*>(media_source_delegate)->Destroy(); | 52 static_cast<MediaSourceDelegate*>(media_source_delegate)->Destroy(); |
53 } | 53 } |
(...skipping 12 matching lines...) Expand all Loading... |
66 const media::SetDecryptorReadyCB& set_decryptor_ready_cb, | 66 const media::SetDecryptorReadyCB& set_decryptor_ready_cb, |
67 const UpdateNetworkStateCB& update_network_state_cb, | 67 const UpdateNetworkStateCB& update_network_state_cb, |
68 const DurationChangeCB& duration_change_cb); | 68 const DurationChangeCB& duration_change_cb); |
69 | 69 |
70 #if defined(GOOGLE_TV) | 70 #if defined(GOOGLE_TV) |
71 void InitializeMediaStream( | 71 void InitializeMediaStream( |
72 media::Demuxer* demuxer, | 72 media::Demuxer* demuxer, |
73 const UpdateNetworkStateCB& update_network_state_cb); | 73 const UpdateNetworkStateCB& update_network_state_cb); |
74 #endif | 74 #endif |
75 | 75 |
76 const WebKit::WebTimeRanges& Buffered(); | 76 const blink::WebTimeRanges& Buffered(); |
77 size_t DecodedFrameCount() const; | 77 size_t DecodedFrameCount() const; |
78 size_t DroppedFrameCount() const; | 78 size_t DroppedFrameCount() const; |
79 size_t AudioDecodedByteCount() const; | 79 size_t AudioDecodedByteCount() const; |
80 size_t VideoDecodedByteCount() const; | 80 size_t VideoDecodedByteCount() const; |
81 | 81 |
82 // In MSE case, calls ChunkDemuxer::CancelPendingSeek(). Also sets the | 82 // In MSE case, calls ChunkDemuxer::CancelPendingSeek(). Also sets the |
83 // expectation that a regular seek will be arriving and to trivially finish | 83 // expectation that a regular seek will be arriving and to trivially finish |
84 // any browser seeks that may be requested prior to the regular seek. | 84 // any browser seeks that may be requested prior to the regular seek. |
85 void CancelPendingSeek(const base::TimeDelta& seek_time); | 85 void CancelPendingSeek(const base::TimeDelta& seek_time); |
86 | 86 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 scoped_ptr<media::DecryptingDemuxerStream> audio_decrypting_demuxer_stream_; | 212 scoped_ptr<media::DecryptingDemuxerStream> audio_decrypting_demuxer_stream_; |
213 scoped_ptr<media::DecryptingDemuxerStream> video_decrypting_demuxer_stream_; | 213 scoped_ptr<media::DecryptingDemuxerStream> video_decrypting_demuxer_stream_; |
214 | 214 |
215 media::DemuxerStream* audio_stream_; | 215 media::DemuxerStream* audio_stream_; |
216 media::DemuxerStream* video_stream_; | 216 media::DemuxerStream* video_stream_; |
217 | 217 |
218 media::PipelineStatistics statistics_; | 218 media::PipelineStatistics statistics_; |
219 media::Ranges<base::TimeDelta> buffered_time_ranges_; | 219 media::Ranges<base::TimeDelta> buffered_time_ranges_; |
220 // Keep a list of buffered time ranges. | 220 // Keep a list of buffered time ranges. |
221 WebKit::WebTimeRanges buffered_web_time_ranges_; | 221 blink::WebTimeRanges buffered_web_time_ranges_; |
222 | 222 |
223 MediaSourceOpenedCB media_source_opened_cb_; | 223 MediaSourceOpenedCB media_source_opened_cb_; |
224 media::Demuxer::NeedKeyCB need_key_cb_; | 224 media::Demuxer::NeedKeyCB need_key_cb_; |
225 | 225 |
226 // The currently selected key system. Empty string means that no key system | 226 // The currently selected key system. Empty string means that no key system |
227 // has been selected. | 227 // has been selected. |
228 WebKit::WebString current_key_system_; | 228 blink::WebString current_key_system_; |
229 | 229 |
230 // Temporary for EME v0.1. In the future the init data type should be passed | 230 // Temporary for EME v0.1. In the future the init data type should be passed |
231 // through GenerateKeyRequest() directly from WebKit. | 231 // through GenerateKeyRequest() directly from WebKit. |
232 std::string init_data_type_; | 232 std::string init_data_type_; |
233 | 233 |
234 // Lock used to serialize access for |seeking_|. | 234 // Lock used to serialize access for |seeking_|. |
235 mutable base::Lock seeking_lock_; | 235 mutable base::Lock seeking_lock_; |
236 bool seeking_; | 236 bool seeking_; |
237 | 237 |
238 // Track if we are currently performing a browser seek, and track whether or | 238 // Track if we are currently performing a browser seek, and track whether or |
(...skipping 11 matching lines...) Expand all Loading... |
250 #endif // defined(GOOGLE_TV) | 250 #endif // defined(GOOGLE_TV) |
251 | 251 |
252 size_t access_unit_size_; | 252 size_t access_unit_size_; |
253 | 253 |
254 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); | 254 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); |
255 }; | 255 }; |
256 | 256 |
257 } // namespace content | 257 } // namespace content |
258 | 258 |
259 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 259 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
OLD | NEW |