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

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

Issue 302453012: Support casting for embedded YT videos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged parameters into struct to avoid 2 IPC calls, updated nits Created 6 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
OLDNEW
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
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // with MediaPlayerHostMsg_Seek. If eventual success, OnSeekComplete() will be 53 // with MediaPlayerHostMsg_Seek. If eventual success, OnSeekComplete() will be
54 // called. 54 // called.
55 virtual void SeekTo(base::TimeDelta timestamp) = 0; 55 virtual void SeekTo(base::TimeDelta timestamp) = 0;
56 56
57 // Release the player resources. 57 // Release the player resources.
58 virtual void Release() = 0; 58 virtual void Release() = 0;
59 59
60 // Set the player volume. 60 // Set the player volume.
61 virtual void SetVolume(double volume) = 0; 61 virtual void SetVolume(double volume) = 0;
62 62
63 // Sets the url of the frame that contains this player.
64 void set_frame_url(const GURL& frame_url) {
65 frame_url_ = frame_url;
acolwell GONE FROM CHROMIUM 2014/06/09 20:02:09 nit: ISTM this value should be passed in via the c
May 2014/06/10 18:22:20 Done.
66 }
67
63 // Get the media information from the player. 68 // Get the media information from the player.
64 virtual int GetVideoWidth() = 0; 69 virtual int GetVideoWidth() = 0;
65 virtual int GetVideoHeight() = 0; 70 virtual int GetVideoHeight() = 0;
66 virtual base::TimeDelta GetDuration() = 0; 71 virtual base::TimeDelta GetDuration() = 0;
67 virtual base::TimeDelta GetCurrentTime() = 0; 72 virtual base::TimeDelta GetCurrentTime() = 0;
68 virtual bool IsPlaying() = 0; 73 virtual bool IsPlaying() = 0;
69 virtual bool IsPlayerReady() = 0; 74 virtual bool IsPlayerReady() = 0;
70 virtual bool CanPause() = 0; 75 virtual bool CanPause() = 0;
71 virtual bool CanSeekForward() = 0; 76 virtual bool CanSeekForward() = 0;
72 virtual bool CanSeekBackward() = 0; 77 virtual bool CanSeekBackward() = 0;
73 virtual GURL GetUrl(); 78 virtual GURL GetUrl();
74 virtual GURL GetFirstPartyForCookies(); 79 virtual GURL GetFirstPartyForCookies();
75 80
76 // Associates the |cdm| with this player. 81 // Associates the |cdm| with this player.
77 virtual void SetCdm(MediaKeys* cdm); 82 virtual void SetCdm(MediaKeys* cdm);
78 83
79 // Notifies the player that a decryption key has been added. The player 84 // 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. 85 // may want to start/resume playback if it is waiting for a key.
81 virtual void OnKeyAdded(); 86 virtual void OnKeyAdded();
82 87
83 // Check whether the player still uses the current surface. 88 // Check whether the player still uses the current surface.
84 virtual bool IsSurfaceInUse() const = 0; 89 virtual bool IsSurfaceInUse() const = 0;
85 90
86 int player_id() { return player_id_; } 91 int player_id() { return player_id_; }
87 92
93 GURL frame_url() { return frame_url_; }
94
88 protected: 95 protected:
89 MediaPlayerAndroid(int player_id, 96 MediaPlayerAndroid(int player_id,
90 MediaPlayerManager* manager, 97 MediaPlayerManager* manager,
91 const RequestMediaResourcesCB& request_media_resources_cb, 98 const RequestMediaResourcesCB& request_media_resources_cb,
92 const ReleaseMediaResourcesCB& release_media_resources_cb); 99 const ReleaseMediaResourcesCB& release_media_resources_cb);
93 100
94 MediaPlayerManager* manager() { return manager_; } 101 MediaPlayerManager* manager() { return manager_; }
95 102
96 RequestMediaResourcesCB request_media_resources_cb_; 103 RequestMediaResourcesCB request_media_resources_cb_;
97 104
98 ReleaseMediaResourcesCB release_media_resources_cb_; 105 ReleaseMediaResourcesCB release_media_resources_cb_;
99 106
100 private: 107 private:
101 // Player ID assigned to this player. 108 // Player ID assigned to this player.
102 int player_id_; 109 int player_id_;
103 110
104 // Resource manager for all the media players. 111 // Resource manager for all the media players.
105 MediaPlayerManager* manager_; 112 MediaPlayerManager* manager_;
106 113
114 // Url for the frame that contains this player.
115 GURL frame_url_;
116
107 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); 117 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid);
108 }; 118 };
109 119
110 } // namespace media 120 } // namespace media
111 121
112 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ 122 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698