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

Unified Diff: Source/WebKit/chromium/src/VideoFrameChromiumImpl.cpp

Issue 6578030: Merge 78787 - 2011-02-16 Victoria Kirst <vrk@google.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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 | « Source/WebKit/chromium/src/VideoFrameChromiumImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/VideoFrameChromiumImpl.cpp
===================================================================
--- Source/WebKit/chromium/src/VideoFrameChromiumImpl.cpp (revision 79604)
+++ Source/WebKit/chromium/src/VideoFrameChromiumImpl.cpp (working copy)
@@ -72,6 +72,14 @@
return 0;
}
+unsigned VideoFrameChromiumImpl::width(unsigned plane) const
+{
+ unsigned planeWidth = width();
+ if (format() == YV12 && plane != static_cast<unsigned>(yPlane))
+ planeWidth /= 2;
+ return planeWidth;
+}
+
unsigned VideoFrameChromiumImpl::height() const
{
if (m_webVideoFrame)
@@ -79,6 +87,14 @@
return 0;
}
+unsigned VideoFrameChromiumImpl::height(unsigned plane) const
+{
+ unsigned planeHeight = height();
+ if (format() == YV12 && plane != static_cast<unsigned>(yPlane))
+ planeHeight /= 2;
+ return planeHeight;
+}
+
unsigned VideoFrameChromiumImpl::planes() const
{
if (m_webVideoFrame)
@@ -109,21 +125,14 @@
const IntSize VideoFrameChromiumImpl::requiredTextureSize(unsigned plane) const
{
- switch (format()) {
- case RGBA:
- case YV16:
- 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();
+ return IntSize(stride(plane), height(plane));
}
+bool VideoFrameChromiumImpl::hasPaddingBytes(unsigned plane) const
+{
+ if (m_webVideoFrame)
+ return stride(plane) - width(plane) > 0;
+ return false;
+}
+
} // namespace WebKit
« no previous file with comments | « Source/WebKit/chromium/src/VideoFrameChromiumImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698