| 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_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 15 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 16 #include "base/time/default_tick_clock.h" | 18 #include "base/time/default_tick_clock.h" |
| 17 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 18 #include "cc/layers/video_frame_provider.h" | 20 #include "cc/layers/video_frame_provider.h" |
| 19 #include "content/common/media/media_player_messages_enums_android.h" | 21 #include "content/common/media/media_player_messages_enums_android.h" |
| 20 #include "content/public/renderer/render_frame_observer.h" | 22 #include "content/public/renderer/render_frame_observer.h" |
| 21 #include "content/renderer/media/android/media_info_loader.h" | 23 #include "content/renderer/media/android/media_info_loader.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 const blink::WebString& key_system, | 248 const blink::WebString& key_system, |
| 247 const blink::WebString& session_id) override; | 249 const blink::WebString& session_id) override; |
| 248 | 250 |
| 249 void setContentDecryptionModule( | 251 void setContentDecryptionModule( |
| 250 blink::WebContentDecryptionModule* cdm, | 252 blink::WebContentDecryptionModule* cdm, |
| 251 blink::WebContentDecryptionModuleResult result) override; | 253 blink::WebContentDecryptionModuleResult result) override; |
| 252 | 254 |
| 253 void OnKeyAdded(const std::string& session_id); | 255 void OnKeyAdded(const std::string& session_id); |
| 254 void OnKeyError(const std::string& session_id, | 256 void OnKeyError(const std::string& session_id, |
| 255 media::MediaKeys::KeyError error_code, | 257 media::MediaKeys::KeyError error_code, |
| 256 uint32 system_code); | 258 uint32_t system_code); |
| 257 void OnKeyMessage(const std::string& session_id, | 259 void OnKeyMessage(const std::string& session_id, |
| 258 const std::vector<uint8>& message, | 260 const std::vector<uint8_t>& message, |
| 259 const GURL& destination_url); | 261 const GURL& destination_url); |
| 260 | 262 |
| 261 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); | 263 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); |
| 262 | 264 |
| 263 void OnEncryptedMediaInitData(media::EmeInitDataType init_data_type, | 265 void OnEncryptedMediaInitData(media::EmeInitDataType init_data_type, |
| 264 const std::vector<uint8>& init_data); | 266 const std::vector<uint8_t>& init_data); |
| 265 | 267 |
| 266 // Called when a decoder detects that the key needed to decrypt the stream | 268 // Called when a decoder detects that the key needed to decrypt the stream |
| 267 // is not available. | 269 // is not available. |
| 268 void OnWaitingForDecryptionKey(); | 270 void OnWaitingForDecryptionKey(); |
| 269 | 271 |
| 270 protected: | 272 protected: |
| 271 // Helper method to update the playing state. | 273 // Helper method to update the playing state. |
| 272 void UpdatePlayingState(bool is_playing_); | 274 void UpdatePlayingState(bool is_playing_); |
| 273 | 275 |
| 274 // Helper methods for posting task for setting states and update WebKit. | 276 // Helper methods for posting task for setting states and update WebKit. |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 539 |
| 538 // NOTE: Weak pointers must be invalidated before all other member variables. | 540 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 539 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 541 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 540 | 542 |
| 541 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 543 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 542 }; | 544 }; |
| 543 | 545 |
| 544 } // namespace content | 546 } // namespace content |
| 545 | 547 |
| 546 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 548 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |