OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // Delete this file when WMPI_CAST is no longer needed. | 5 // Delete this file when WMPI_CAST is no longer needed. |
6 | 6 |
7 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_CAST_H_ | 7 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_CAST_H_ |
8 #define MEDIA_BLINK_WEBMEDIAPLAYER_CAST_H_ | 8 #define MEDIA_BLINK_WEBMEDIAPLAYER_CAST_H_ |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 void OnWaitingForDecryptionKey() override; | 100 void OnWaitingForDecryptionKey() override; |
101 | 101 |
102 bool paused() const override; | 102 bool paused() const override; |
103 bool hasVideo() const override; | 103 bool hasVideo() const override; |
104 | 104 |
105 void SetDeviceScaleFactor(float scale_factor); | 105 void SetDeviceScaleFactor(float scale_factor); |
106 scoped_refptr<VideoFrame> GetCastingBanner(); | 106 scoped_refptr<VideoFrame> GetCastingBanner(); |
107 | 107 |
108 private: | 108 private: |
| 109 base::TimeDelta GetDuration(); |
| 110 |
109 WebMediaPlayerImpl* webmediaplayer_; | 111 WebMediaPlayerImpl* webmediaplayer_; |
110 blink::WebMediaPlayerClient* client_; | 112 blink::WebMediaPlayerClient* client_; |
111 WebMediaPlayerParams::Context3DCB context_3d_cb_; | 113 WebMediaPlayerParams::Context3DCB context_3d_cb_; |
112 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 114 base::WeakPtr<WebMediaPlayerDelegate> delegate_; |
113 | 115 |
114 // Manages this object and delegates player calls to the browser process. | 116 // Manages this object and delegates player calls to the browser process. |
115 // Owned by RenderFrameImpl. | 117 // Owned by RenderFrameImpl. |
116 RendererMediaPlayerManagerInterface* player_manager_ = nullptr; | 118 RendererMediaPlayerManagerInterface* player_manager_ = nullptr; |
117 | 119 |
118 // Player ID assigned by the |player_manager_|. | 120 // Player ID assigned by the |player_manager_|. |
119 int player_id_; | 121 int player_id_; |
120 | 122 |
121 // Whether the browser is currently connected to a remote media player. | 123 // Whether the browser is currently connected to a remote media player. |
122 bool is_remote_ = false; | 124 bool is_remote_ = false; |
123 | 125 |
124 bool paused_ = true; | 126 bool paused_ = true; |
125 bool initializing_ = false; | 127 bool initializing_ = false; |
126 bool should_notify_time_changed_ = false; | 128 bool should_notify_time_changed_ = false; |
127 | 129 |
128 // Last reported playout time. | 130 // Last reported playout time. |
129 base::TimeDelta remote_time_; | 131 base::TimeDelta remote_time_; |
130 base::TimeTicks remote_time_at_; | 132 base::TimeTicks remote_time_at_; |
| 133 base::TimeDelta duration_; |
131 | 134 |
132 // Whether the media player has been initialized. | 135 // Whether the media player has been initialized. |
133 bool is_player_initialized_ = false; | 136 bool is_player_initialized_ = false; |
134 | 137 |
135 std::string remote_playback_message_; | 138 std::string remote_playback_message_; |
136 | 139 |
137 float device_scale_factor_ = 1.0; | 140 float device_scale_factor_ = 1.0; |
138 | 141 |
139 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerCast); | 142 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerCast); |
140 }; | 143 }; |
141 | 144 |
142 // Make a texture-backed video of the given size containing the given message. | 145 // Make a texture-backed video of the given size containing the given message. |
143 MEDIA_BLINK_EXPORT scoped_refptr<VideoFrame> MakeTextFrameForCast( | 146 MEDIA_BLINK_EXPORT scoped_refptr<VideoFrame> MakeTextFrameForCast( |
144 const std::string& remote_playback_message, | 147 const std::string& remote_playback_message, |
145 gfx::Size canvas_size, | 148 gfx::Size canvas_size, |
146 gfx::Size natural_size, | 149 gfx::Size natural_size, |
147 const base::Callback<gpu::gles2::GLES2Interface*()>& context_3d_cb); | 150 const base::Callback<gpu::gles2::GLES2Interface*()>& context_3d_cb); |
148 | 151 |
149 } // namespace media | 152 } // namespace media |
150 | 153 |
151 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_CAST_H_ | 154 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_CAST_H_ |
OLD | NEW |