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

Unified Diff: content/renderer/media/video_frame_compositor.cc

Issue 495353003: Move WebMediaPlayerImpl and its dependencies to media/blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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
Index: content/renderer/media/video_frame_compositor.cc
diff --git a/content/renderer/media/video_frame_compositor.cc b/content/renderer/media/video_frame_compositor.cc
deleted file mode 100644
index 50dd8c992feed292750851dcfef7b0167482f1bf..0000000000000000000000000000000000000000
--- a/content/renderer/media/video_frame_compositor.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/media/video_frame_compositor.h"
-
-#include "media/base/video_frame.h"
-
-namespace content {
-
-static bool IsOpaque(const scoped_refptr<media::VideoFrame>& frame) {
- switch (frame->format()) {
- case media::VideoFrame::UNKNOWN:
- case media::VideoFrame::YV12:
- case media::VideoFrame::YV12J:
- case media::VideoFrame::YV16:
- case media::VideoFrame::I420:
- case media::VideoFrame::YV24:
- case media::VideoFrame::NV12:
- return true;
-
- case media::VideoFrame::YV12A:
-#if defined(VIDEO_HOLE)
- case media::VideoFrame::HOLE:
-#endif // defined(VIDEO_HOLE)
- case media::VideoFrame::NATIVE_TEXTURE:
- break;
- }
- return false;
-}
-
-VideoFrameCompositor::VideoFrameCompositor(
- const base::Callback<void(gfx::Size)>& natural_size_changed_cb,
- const base::Callback<void(bool)>& opacity_changed_cb)
- : natural_size_changed_cb_(natural_size_changed_cb),
- opacity_changed_cb_(opacity_changed_cb),
- client_(NULL) {
-}
-
-VideoFrameCompositor::~VideoFrameCompositor() {
- if (client_)
- client_->StopUsingProvider();
-}
-
-void VideoFrameCompositor::SetVideoFrameProviderClient(
- cc::VideoFrameProvider::Client* client) {
- if (client_)
- client_->StopUsingProvider();
- client_ = client;
-}
-
-scoped_refptr<media::VideoFrame> VideoFrameCompositor::GetCurrentFrame() {
- return current_frame_;
-}
-
-void VideoFrameCompositor::PutCurrentFrame(
- const scoped_refptr<media::VideoFrame>& frame) {
-}
-
-void VideoFrameCompositor::UpdateCurrentFrame(
- const scoped_refptr<media::VideoFrame>& frame) {
- if (current_frame_.get() &&
- current_frame_->natural_size() != frame->natural_size()) {
- natural_size_changed_cb_.Run(frame->natural_size());
- }
-
- if (!current_frame_.get() || IsOpaque(current_frame_) != IsOpaque(frame)) {
- opacity_changed_cb_.Run(IsOpaque(frame));
- }
-
- current_frame_ = frame;
-
- if (client_)
- client_->DidReceiveFrame();
-}
-
-} // namespace content
« no previous file with comments | « content/renderer/media/video_frame_compositor.h ('k') | content/renderer/media/video_frame_compositor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698