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

Side by Side Diff: media/remoting/remote_renderer_impl.h

Issue 2566223005: Media Remoting: Update remoting interstitial when status changes. (Closed)
Patch Set: Rebased only. Created 4 years 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
« no previous file with comments | « no previous file | media/remoting/remote_renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_REMOTING_REMOTE_RENDERER_IMPL_H_ 5 #ifndef MEDIA_REMOTING_REMOTE_RENDERER_IMPL_H_
6 #define MEDIA_REMOTING_REMOTE_RENDERER_IMPL_H_ 6 #define MEDIA_REMOTING_REMOTE_RENDERER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 mojo::ScopedDataPipeProducerHandle video_handle); 60 mojo::ScopedDataPipeProducerHandle video_handle);
61 61
62 // Callback function when RPC message is received. The function is set to 62 // Callback function when RPC message is received. The function is set to
63 // static in order to post task to media thread in order to avoid threading 63 // static in order to post task to media thread in order to avoid threading
64 // race condition. 64 // race condition.
65 static void OnMessageReceivedOnMainThread( 65 static void OnMessageReceivedOnMainThread(
66 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner, 66 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner,
67 base::WeakPtr<RemoteRendererImpl> self, 67 base::WeakPtr<RemoteRendererImpl> self,
68 std::unique_ptr<remoting::pb::RpcMessage> message); 68 std::unique_ptr<remoting::pb::RpcMessage> message);
69 69
70 // Callback when remoting interstitial needs to be updated. Will post task to
71 // media thread to avoid threading race condition.
72 static void RequestUpdateInterstitialOnMainThread(
73 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner,
74 base::WeakPtr<RemoteRendererImpl> remote_renderer_impl,
75 const SkBitmap& background_image,
76 const gfx::Size& canvas_size,
77 RemotingInterstitialType interstitial_type);
78
70 public: 79 public:
71 // media::Renderer implementation. 80 // media::Renderer implementation.
72 void Initialize(DemuxerStreamProvider* demuxer_stream_provider, 81 void Initialize(DemuxerStreamProvider* demuxer_stream_provider,
73 media::RendererClient* client, 82 media::RendererClient* client,
74 const PipelineStatusCB& init_cb) final; 83 const PipelineStatusCB& init_cb) final;
75 void SetCdm(CdmContext* cdm_context, 84 void SetCdm(CdmContext* cdm_context,
76 const CdmAttachedCB& cdm_attached_cb) final; 85 const CdmAttachedCB& cdm_attached_cb) final;
77 void Flush(const base::Closure& flush_cb) final; 86 void Flush(const base::Closure& flush_cb) final;
78 void StartPlayingFrom(base::TimeDelta time) final; 87 void StartPlayingFrom(base::TimeDelta time) final;
79 void SetPlaybackRate(double playback_rate) final; 88 void SetPlaybackRate(double playback_rate) final;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void SetCdmCallback(std::unique_ptr<remoting::pb::RpcMessage> message); 123 void SetCdmCallback(std::unique_ptr<remoting::pb::RpcMessage> message);
115 void OnTimeUpdate(std::unique_ptr<remoting::pb::RpcMessage> message); 124 void OnTimeUpdate(std::unique_ptr<remoting::pb::RpcMessage> message);
116 void OnBufferingStateChange( 125 void OnBufferingStateChange(
117 std::unique_ptr<remoting::pb::RpcMessage> message); 126 std::unique_ptr<remoting::pb::RpcMessage> message);
118 void OnVideoNaturalSizeChange( 127 void OnVideoNaturalSizeChange(
119 std::unique_ptr<remoting::pb::RpcMessage> message); 128 std::unique_ptr<remoting::pb::RpcMessage> message);
120 void OnVideoOpacityChange(std::unique_ptr<remoting::pb::RpcMessage> message); 129 void OnVideoOpacityChange(std::unique_ptr<remoting::pb::RpcMessage> message);
121 void OnStatisticsUpdate(std::unique_ptr<remoting::pb::RpcMessage> message); 130 void OnStatisticsUpdate(std::unique_ptr<remoting::pb::RpcMessage> message);
122 void OnDurationChange(std::unique_ptr<remoting::pb::RpcMessage> message); 131 void OnDurationChange(std::unique_ptr<remoting::pb::RpcMessage> message);
123 132
133 // Called to update the remoting interstitial. Draw remoting interstitial on
134 // |interstitial_background_| if |background_image| is empty. Update
135 // |interstitial_background_| if |background_image| is not empty.
136 void UpdateInterstitial(const SkBitmap& background_image,
137 const gfx::Size& canvas_size,
138 RemotingInterstitialType interstitial_type);
139
124 // Shut down remoting session. 140 // Shut down remoting session.
125 void OnFatalError(PipelineStatus status); 141 void OnFatalError(PipelineStatus status);
126 142
127 // Show interstial accordingly.
128 void UpdateInterstitial();
129
130 State state_; 143 State state_;
131 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 144 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
132 const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; 145 const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
133 146
134 // Current renderer playback time information. 147 // Current renderer playback time information.
135 base::TimeDelta current_media_time_; 148 base::TimeDelta current_media_time_;
136 base::TimeDelta current_max_time_; 149 base::TimeDelta current_max_time_;
137 // Both |current_media_time_| and |current_max_time_| should be protected by 150 // Both |current_media_time_| and |current_max_time_| should be protected by
138 // lock because it can be accessed from both media and render main thread. 151 // lock because it can be accessed from both media and render main thread.
139 base::Lock time_lock_; 152 base::Lock time_lock_;
(...skipping 13 matching lines...) Expand all
153 const int rpc_handle_; 166 const int rpc_handle_;
154 167
155 // RPC handle value for render on receiver endpoint. 168 // RPC handle value for render on receiver endpoint.
156 int remote_renderer_handle_; 169 int remote_renderer_handle_;
157 170
158 // Callbacks. 171 // Callbacks.
159 PipelineStatusCB init_workflow_done_callback_; 172 PipelineStatusCB init_workflow_done_callback_;
160 CdmAttachedCB cdm_attached_cb_; 173 CdmAttachedCB cdm_attached_cb_;
161 base::Closure flush_cb_; 174 base::Closure flush_cb_;
162 175
163 RemotingInterstitialUI interstitial_ui_; 176 VideoRendererSink* const video_renderer_sink_; // Outlives this class.
177 // The background image for remoting interstitial. When |this| is destructed,
178 // |interstitial_background_| will be paint to clear the cast messages on
179 // the interstitial.
180 SkBitmap interstitial_background_;
181 gfx::Size canvas_size_;
164 182
165 base::WeakPtrFactory<RemoteRendererImpl> weak_factory_; 183 base::WeakPtrFactory<RemoteRendererImpl> weak_factory_;
166 184
167 DISALLOW_COPY_AND_ASSIGN(RemoteRendererImpl); 185 DISALLOW_COPY_AND_ASSIGN(RemoteRendererImpl);
168 }; 186 };
169 187
170 } // namespace media 188 } // namespace media
171 189
172 #endif // MEDIA_REMOTING_REMOTE_RENDERER_IMPL_H_ 190 #endif // MEDIA_REMOTING_REMOTE_RENDERER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/remoting/remote_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698