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

Unified Diff: media/remoting/courier_renderer.cc

Issue 2801853002: Media Remoting: Remove old interstitial implementation. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/remoting/courier_renderer.h ('k') | media/remoting/interstitial.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/courier_renderer.cc
diff --git a/media/remoting/courier_renderer.cc b/media/remoting/courier_renderer.cc
index 33a11e58deaddfbb5f726039f815ee8b46754152..6bc07eccca295340c570a8f14866abbf1bb61831 100644
--- a/media/remoting/courier_renderer.cc
+++ b/media/remoting/courier_renderer.cc
@@ -79,9 +79,6 @@ CourierRenderer::CourierRenderer(
// Note: The constructor is running on the main thread, but will be destroyed
// on the media thread. Therefore, all weak pointers must be dereferenced on
// the media thread.
- controller_->SetShowInterstitialCallback(
- base::Bind(&CourierRenderer::RenderInterstitialAndShow,
- media_task_runner_, weak_factory_.GetWeakPtr()));
const RpcBroker::ReceiveMessageCallback receive_callback =
base::Bind(&CourierRenderer::OnMessageReceivedOnMainThread,
media_task_runner_, weak_factory_.GetWeakPtr());
@@ -92,23 +89,14 @@ CourierRenderer::~CourierRenderer() {
VLOG(2) << __func__;
DCHECK(media_task_runner_->BelongsToCurrentThread());
- // Post task on main thread to unset the interstial callback.
- main_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&RendererController::SetShowInterstitialCallback, controller_,
- RendererController::ShowInterstitialCallback()));
-
// Post task on main thread to unregister message receiver.
main_task_runner_->PostTask(
FROM_HERE, base::Bind(&RpcBroker::UnregisterMessageReceiverCallback,
rpc_broker_, rpc_handle_));
- // If the "between sessions" interstitial is not the one currently showing,
- // paint a blank black frame to clear remoting messaging.
- if (interstitial_type_ != InterstitialType::BETWEEN_SESSIONS) {
- scoped_refptr<VideoFrame> frame =
- VideoFrame::CreateBlackFrame(gfx::Size(1280, 720));
- PaintInterstitial(frame, InterstitialType::BETWEEN_SESSIONS);
+ if (video_renderer_sink_) {
+ video_renderer_sink_->PaintSingleFrame(
+ VideoFrame::CreateBlackFrame(gfx::Size(1280, 720)));
}
}
@@ -697,35 +685,6 @@ void CourierRenderer::OnFatalError(StopTrigger stop_trigger) {
base::ResetAndReturn(&flush_cb_).Run();
}
-// static
-void CourierRenderer::RenderInterstitialAndShow(
- scoped_refptr<base::SingleThreadTaskRunner> media_task_runner,
- base::WeakPtr<CourierRenderer> self,
- const SkBitmap& background,
- const gfx::Size& natural_size,
- InterstitialType type) {
- // Note: This is running on the main thread. |self| must only be dereferenced
- // on the media thread.
- scoped_refptr<VideoFrame> frame =
- RenderInterstitialFrame(background, natural_size, type);
- if (!frame) {
- NOTREACHED();
- return;
- }
- media_task_runner->PostTask(
- FROM_HERE, base::Bind(&CourierRenderer::PaintInterstitial, self,
- std::move(frame), type));
-}
-
-void CourierRenderer::PaintInterstitial(scoped_refptr<VideoFrame> frame,
- InterstitialType type) {
- DCHECK(media_task_runner_->BelongsToCurrentThread());
- interstitial_type_ = type;
- if (!video_renderer_sink_)
- return;
- video_renderer_sink_->PaintSingleFrame(frame);
-}
-
void CourierRenderer::OnMediaTimeUpdated() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
if (!flush_cb_.is_null())
« no previous file with comments | « media/remoting/courier_renderer.h ('k') | media/remoting/interstitial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698