Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: media/base/android/media_player_bridge.h

Issue 15876006: Allow some Android media player implementation to be overridden by embedders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed indent Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 virtual void SetVolume(float leftVolume, float rightVolume) OVERRIDE; 58 virtual void SetVolume(float leftVolume, float rightVolume) OVERRIDE;
59 virtual int GetVideoWidth() OVERRIDE; 59 virtual int GetVideoWidth() OVERRIDE;
60 virtual int GetVideoHeight() OVERRIDE; 60 virtual int GetVideoHeight() OVERRIDE;
61 virtual base::TimeDelta GetCurrentTime() OVERRIDE; 61 virtual base::TimeDelta GetCurrentTime() OVERRIDE;
62 virtual base::TimeDelta GetDuration() OVERRIDE; 62 virtual base::TimeDelta GetDuration() OVERRIDE;
63 virtual bool IsPlaying() OVERRIDE; 63 virtual bool IsPlaying() OVERRIDE;
64 virtual bool CanPause() OVERRIDE; 64 virtual bool CanPause() OVERRIDE;
65 virtual bool CanSeekForward() OVERRIDE; 65 virtual bool CanSeekForward() OVERRIDE;
66 virtual bool CanSeekBackward() OVERRIDE; 66 virtual bool CanSeekBackward() OVERRIDE;
67 virtual bool IsPlayerReady() OVERRIDE; 67 virtual bool IsPlayerReady() OVERRIDE;
68 virtual GURL GetUrl() OVERRIDE;
69 virtual GURL GetFirstPartyForCookies() OVERRIDE;
68 70
69 protected: 71 protected:
70 void SetMediaPlayer(jobject j_media_player); 72 void SetMediaPlayer(jobject j_media_player);
71 void SetMediaPlayerListener(); 73 void SetMediaPlayerListener();
72 74
73 // MediaPlayerAndroid implementation. 75 // MediaPlayerAndroid implementation.
74 virtual void OnVideoSizeChanged(int width, int height) OVERRIDE; 76 virtual void OnVideoSizeChanged(int width, int height) OVERRIDE;
75 virtual void OnPlaybackComplete() OVERRIDE; 77 virtual void OnPlaybackComplete() OVERRIDE;
76 virtual void OnMediaInterrupted() OVERRIDE; 78 virtual void OnMediaInterrupted() OVERRIDE;
77 79
78 virtual void PendingSeekInternal(base::TimeDelta time); 80 virtual void PendingSeekInternal(base::TimeDelta time);
79 81
80 // Prepare the player for playback, asynchronously. When succeeds, 82 // Prepare the player for playback, asynchronously. When succeeds,
81 // OnMediaPrepared() will be called. Otherwise, OnMediaError() will 83 // OnMediaPrepared() will be called. Otherwise, OnMediaError() will
82 // be called with an error type. 84 // be called with an error type.
83 virtual void Prepare(); 85 virtual void Prepare();
84 void OnMediaPrepared(); 86 void OnMediaPrepared();
85 87
88 // Create the actual android media player.
89 virtual void CreateMediaPlayer();
bulach 2013/05/29 18:31:23 nit: OVERRIDE
whywhat 2013/05/29 18:50:12 Ack
90
86 private: 91 private:
87 // Create the actual android media player.
88 void CreateMediaPlayer();
89
90 // Set the data source for the media player. 92 // Set the data source for the media player.
91 void SetDataSource(const std::string& url); 93 void SetDataSource(const std::string& url);
92 94
93 // Functions that implements media player control. 95 // Functions that implements media player control.
94 void StartInternal(); 96 void StartInternal();
95 void PauseInternal(); 97 void PauseInternal();
96 void SeekInternal(base::TimeDelta time); 98 void SeekInternal(base::TimeDelta time);
97 99
98 // Get allowed operations from the player. 100 // Get allowed operations from the player.
99 void GetAllowedOperations(); 101 void GetAllowedOperations();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Listener object that listens to all the media player events. 152 // Listener object that listens to all the media player events.
151 MediaPlayerListener listener_; 153 MediaPlayerListener listener_;
152 154
153 friend class MediaPlayerListener; 155 friend class MediaPlayerListener;
154 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); 156 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge);
155 }; 157 };
156 158
157 } // namespace media 159 } // namespace media
158 160
159 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ 161 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698