OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 #include "ui/gl/android/scoped_java_surface.h" | 14 #include "ui/gl/android/scoped_java_surface.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 class MediaKeys; | 19 class BrowserCdm; |
20 class MediaPlayerManager; | 20 class MediaPlayerManager; |
21 | 21 |
22 // This class serves as the base class for different media player | 22 // This class serves as the base class for different media player |
23 // implementations on Android. Subclasses need to provide their own | 23 // implementations on Android. Subclasses need to provide their own |
24 // MediaPlayerAndroid::Create() implementation. | 24 // MediaPlayerAndroid::Create() implementation. |
25 class MEDIA_EXPORT MediaPlayerAndroid { | 25 class MEDIA_EXPORT MediaPlayerAndroid { |
26 public: | 26 public: |
27 virtual ~MediaPlayerAndroid(); | 27 virtual ~MediaPlayerAndroid(); |
28 | 28 |
29 // Error types for MediaErrorCB. | 29 // Error types for MediaErrorCB. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual base::TimeDelta GetCurrentTime() = 0; | 67 virtual base::TimeDelta GetCurrentTime() = 0; |
68 virtual bool IsPlaying() = 0; | 68 virtual bool IsPlaying() = 0; |
69 virtual bool IsPlayerReady() = 0; | 69 virtual bool IsPlayerReady() = 0; |
70 virtual bool CanPause() = 0; | 70 virtual bool CanPause() = 0; |
71 virtual bool CanSeekForward() = 0; | 71 virtual bool CanSeekForward() = 0; |
72 virtual bool CanSeekBackward() = 0; | 72 virtual bool CanSeekBackward() = 0; |
73 virtual GURL GetUrl(); | 73 virtual GURL GetUrl(); |
74 virtual GURL GetFirstPartyForCookies(); | 74 virtual GURL GetFirstPartyForCookies(); |
75 | 75 |
76 // Associates the |cdm| with this player. | 76 // Associates the |cdm| with this player. |
77 virtual void SetCdm(MediaKeys* cdm); | 77 virtual void SetCdm(BrowserCdm* cdm); |
78 | |
79 // Notifies the player that a decryption key has been added. The player | |
80 // may want to start/resume playback if it is waiting for a key. | |
81 virtual void OnKeyAdded(); | |
82 | 78 |
83 // Check whether the player still uses the current surface. | 79 // Check whether the player still uses the current surface. |
84 virtual bool IsSurfaceInUse() const = 0; | 80 virtual bool IsSurfaceInUse() const = 0; |
85 | 81 |
86 int player_id() { return player_id_; } | 82 int player_id() { return player_id_; } |
87 | 83 |
88 protected: | 84 protected: |
89 MediaPlayerAndroid(int player_id, | 85 MediaPlayerAndroid(int player_id, |
90 MediaPlayerManager* manager, | 86 MediaPlayerManager* manager, |
91 const RequestMediaResourcesCB& request_media_resources_cb, | 87 const RequestMediaResourcesCB& request_media_resources_cb, |
(...skipping 11 matching lines...) Expand all Loading... |
103 | 99 |
104 // Resource manager for all the media players. | 100 // Resource manager for all the media players. |
105 MediaPlayerManager* manager_; | 101 MediaPlayerManager* manager_; |
106 | 102 |
107 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); | 103 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); |
108 }; | 104 }; |
109 | 105 |
110 } // namespace media | 106 } // namespace media |
111 | 107 |
112 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ | 108 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
OLD | NEW |