OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class MediaPlayerManagerAndroid; | 18 class MediaPlayerManagerImpl; |
19 | 19 |
20 // Native mirror of ContentVideoView.java. This class is responsible for | 20 // Native mirror of ContentVideoView.java. This class is responsible for |
21 // creating the Java video view and pass all the player status change to | 21 // creating the Java video view and pass all the player status change to |
22 // it. It accepts media control from Java class, and forwards it to | 22 // it. It accepts media control from Java class, and forwards it to |
23 // MediaPlayerManagerAndroid. | 23 // MediaPlayerManagerImpl. |
24 class ContentVideoView { | 24 class ContentVideoView { |
25 public: | 25 public: |
26 // Construct a ContentVideoView object. The |manager| will handle all the | 26 // Construct a ContentVideoView object. The |manager| will handle all the |
27 // playback controls from the Java class. | 27 // playback controls from the Java class. |
28 explicit ContentVideoView(MediaPlayerManagerAndroid* manager); | 28 explicit ContentVideoView(MediaPlayerManagerImpl* manager); |
29 ~ContentVideoView(); | 29 ~ContentVideoView(); |
30 | 30 |
31 static bool RegisterContentVideoView(JNIEnv* env); | 31 static bool RegisterContentVideoView(JNIEnv* env); |
32 | 32 |
33 // Getter method called by the Java class to get the media information. | 33 // Getter method called by the Java class to get the media information. |
34 int GetVideoWidth(JNIEnv*, jobject obj) const; | 34 int GetVideoWidth(JNIEnv*, jobject obj) const; |
35 int GetVideoHeight(JNIEnv*, jobject obj) const; | 35 int GetVideoHeight(JNIEnv*, jobject obj) const; |
36 int GetDurationInMilliSeconds(JNIEnv*, jobject obj) const; | 36 int GetDurationInMilliSeconds(JNIEnv*, jobject obj) const; |
37 int GetCurrentPosition(JNIEnv*, jobject obj) const; | 37 int GetCurrentPosition(JNIEnv*, jobject obj) const; |
38 bool IsPlaying(JNIEnv*, jobject obj); | 38 bool IsPlaying(JNIEnv*, jobject obj); |
(...skipping 20 matching lines...) Expand all Loading... |
59 // change. | 59 // change. |
60 void UpdateMediaMetadata(); | 60 void UpdateMediaMetadata(); |
61 void OnMediaPlayerError(int errorType); | 61 void OnMediaPlayerError(int errorType); |
62 void OnVideoSizeChanged(int width, int height); | 62 void OnVideoSizeChanged(int width, int height); |
63 void OnBufferingUpdate(int percent); | 63 void OnBufferingUpdate(int percent); |
64 void OnPlaybackComplete(); | 64 void OnPlaybackComplete(); |
65 | 65 |
66 private: | 66 private: |
67 // Object that manages the fullscreen media player. It is responsible for | 67 // Object that manages the fullscreen media player. It is responsible for |
68 // handling all the playback controls. | 68 // handling all the playback controls. |
69 MediaPlayerManagerAndroid* manager_; | 69 MediaPlayerManagerImpl* manager_; |
70 | 70 |
71 // Reference to the Java object. | 71 // Reference to the Java object. |
72 base::android::ScopedJavaGlobalRef<jobject> j_content_video_view_; | 72 base::android::ScopedJavaGlobalRef<jobject> j_content_video_view_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); | 74 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace content | 77 } // namespace content |
78 | 78 |
79 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 79 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
OLD | NEW |