diff options
Diffstat (limited to 'WebKit/chromium/src/VideoFrameChromiumImpl.cpp')
-rw-r--r-- | WebKit/chromium/src/VideoFrameChromiumImpl.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/WebKit/chromium/src/VideoFrameChromiumImpl.cpp b/WebKit/chromium/src/VideoFrameChromiumImpl.cpp index 2b98320..a60fe28 100644 --- a/WebKit/chromium/src/VideoFrameChromiumImpl.cpp +++ b/WebKit/chromium/src/VideoFrameChromiumImpl.cpp @@ -38,14 +38,6 @@ using namespace WebCore; namespace WebKit { -const unsigned cMaxPlanes = 3; -const unsigned cNumRGBPlanes = 1; -const unsigned cRGBPlane = 0; -const unsigned cNumYUVPlanes = 3; -const unsigned cYPlane = 0; -const unsigned cUPlane = 1; -const unsigned cVPlane = 2; - WebVideoFrame* VideoFrameChromiumImpl::toWebVideoFrame(VideoFrameChromium* videoFrame) { VideoFrameChromiumImpl* wrappedFrame = static_cast<VideoFrameChromiumImpl*>(videoFrame); @@ -108,4 +100,22 @@ const void* VideoFrameChromiumImpl::data(unsigned plane) const return 0; } +const IntSize VideoFrameChromiumImpl::requiredTextureSize(unsigned plane) const +{ + switch (format()) { + case RGBA: + return IntSize(stride(plane), height()); + case YV12: + if (plane == static_cast<unsigned>(yPlane)) + return IntSize(stride(plane), height()); + else if (plane == static_cast<unsigned>(uPlane)) + return IntSize(stride(plane), height() / 2); + else if (plane == static_cast<unsigned>(vPlane)) + return IntSize(stride(plane), height() / 2); + default: + break; + } + return IntSize(); +} + } // namespace WebKit |