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

Unified Diff: webkit/media/webvideoframe_impl.cc

Issue 11754003: Move VideoFrameProvider to, and remove all usage of WebVideoFrame from cc/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | « webkit/media/webvideoframe_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webvideoframe_impl.cc
diff --git a/webkit/media/webvideoframe_impl.cc b/webkit/media/webvideoframe_impl.cc
index 16e04faf74b272a01c15f6ad5f8205324035a6c4..b1c1dc77ecd40cebd41a4d4cb831110a3cdc7994 100644
--- a/webkit/media/webvideoframe_impl.cc
+++ b/webkit/media/webvideoframe_impl.cc
@@ -2,89 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/media/webvideoframe_impl.h"
-
-#include "base/logging.h"
#include "media/base/video_frame.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h"
-
-using WebKit::WebVideoFrame;
+#include "webkit/media/webvideoframe_impl.h"
namespace webkit_media {
WebVideoFrameImpl::WebVideoFrameImpl(
scoped_refptr<media::VideoFrame> video_frame)
- : video_frame_(video_frame) {
+ : video_frame(video_frame) {
}
WebVideoFrameImpl::~WebVideoFrameImpl() {}
-#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, chromium_name) \
- COMPILE_ASSERT(int(WebKit::WebVideoFrame::webkit_name) == \
- int(media::VideoFrame::chromium_name), \
- mismatching_enums)
-COMPILE_ASSERT_MATCHING_ENUM(FormatInvalid, INVALID);
-COMPILE_ASSERT_MATCHING_ENUM(FormatRGB32, RGB32);
-COMPILE_ASSERT_MATCHING_ENUM(FormatYV12, YV12);
-COMPILE_ASSERT_MATCHING_ENUM(FormatYV16, YV16);
-COMPILE_ASSERT_MATCHING_ENUM(FormatEmpty, EMPTY);
-COMPILE_ASSERT_MATCHING_ENUM(FormatI420, I420);
-COMPILE_ASSERT_MATCHING_ENUM(FormatNativeTexture, NATIVE_TEXTURE);
-
-WebVideoFrame::Format WebVideoFrameImpl::format() const {
- if (video_frame_.get())
- return static_cast<WebVideoFrame::Format>(video_frame_->format());
- return WebVideoFrame::FormatInvalid;
-}
-
-unsigned WebVideoFrameImpl::planes() const {
- if (!video_frame_.get())
- return 0;
- switch (video_frame_->format()) {
- case media::VideoFrame::RGB32:
- return 1;
- case media::VideoFrame::YV12:
- case media::VideoFrame::YV16:
- return 3;
- case media::VideoFrame::INVALID:
- case media::VideoFrame::EMPTY:
- case media::VideoFrame::I420:
- break;
- case media::VideoFrame::NATIVE_TEXTURE:
- return 0;
- }
- NOTREACHED();
- return 0;
-}
-
-const void* WebVideoFrameImpl::data(unsigned plane) const {
- if (!video_frame_.get() || format() == FormatNativeTexture)
- return NULL;
- return static_cast<const void*>(video_frame_->data(plane));
-}
-
-unsigned WebVideoFrameImpl::textureId() const {
- if (!video_frame_.get() || format() != FormatNativeTexture)
- return 0;
- return video_frame_->texture_id();
-}
-
-unsigned WebVideoFrameImpl::textureTarget() const {
- if (!video_frame_.get() || format() != FormatNativeTexture)
- return 0;
- return video_frame_->texture_target();
-}
-
-WebKit::WebRect WebVideoFrameImpl::visibleRect() const {
- if (!video_frame_.get())
- return WebKit::WebRect(0, 0, 0, 0);
- return WebKit::WebRect(video_frame_->visible_rect());
-}
-
-WebKit::WebSize WebVideoFrameImpl::textureSize() const {
- if (!video_frame_.get() || format() != FormatNativeTexture)
- return WebKit::WebSize(0, 0);
- return WebKit::WebSize(video_frame_->coded_size());
-}
-
} // namespace webkit_media
« no previous file with comments | « webkit/media/webvideoframe_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698