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

Unified Diff: cc/video_layer_impl.cc

Issue 12255032: Implement "hole" video frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 | « no previous file | content/browser/renderer_host/media/video_capture_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/video_layer_impl.cc
diff --git a/cc/video_layer_impl.cc b/cc/video_layer_impl.cc
index 8a624bfa678eb242bc4553b27aad42be5596ef39..502ccc2599823a1b435465439e06314d20cf2183 100644
--- a/cc/video_layer_impl.cc
+++ b/cc/video_layer_impl.cc
@@ -20,6 +20,10 @@
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
+#if defined(GOOGLE_TV)
+#include "cc/solid_color_draw_quad.h"
+#endif
+
namespace cc {
// static
@@ -89,6 +93,10 @@ static GLenum convertVFCFormatToGLenum(const media::VideoFrame& frame)
return GL_LUMINANCE;
case media::VideoFrame::NATIVE_TEXTURE:
return frame.texture_target();
+#if defined(GOOGLE_TV)
+ case media::VideoFrame::HOLE:
+ return GL_INVALID_VALUE;
+#endif
case media::VideoFrame::INVALID:
case media::VideoFrame::RGB32:
case media::VideoFrame::EMPTY:
@@ -108,6 +116,10 @@ size_t VideoLayerImpl::numPlanes() const
return 1;
switch (m_frame->format()) {
+#if defined(GOOGLE_TV)
+ case media::VideoFrame::HOLE:
+ return 0;
+#endif
case media::VideoFrame::RGB32:
return 1;
case media::VideoFrame::YV12:
@@ -152,6 +164,11 @@ void VideoLayerImpl::willDrawInternal(ResourceProvider* resourceProvider)
if (!m_frame)
return;
+#if defined(GOOGLE_TV)
+ if (m_frame->format() == media::VideoFrame::HOLE)
+ return;
+#endif
+
m_format = convertVFCFormatToGLenum(*m_frame);
// If these fail, we'll have to add draw logic that handles offset bitmap/
@@ -215,6 +232,27 @@ void VideoLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
const float texHeightScale =
static_cast<float>(visibleRect.height()) / codedSize.height();
+#if defined(GOOGLE_TV)
+ // This block and other blocks wrapped around #if defined(GOOGLE_TV) is not
+ // maintained by the general compositor team. Please contact the following
+ // people instead:
+ //
+ // wonsik@chromium.org
+ // ycheo@chromium.org
+
+ if (m_frame->format() == media::VideoFrame::HOLE) {
+ scoped_ptr<SolidColorDrawQuad> solidColorDrawQuad =
+ SolidColorDrawQuad::Create();
+ // Create a solid color quad with transparent black and force no
+ // blending.
+ solidColorDrawQuad->SetAll(
+ sharedQuadState, quadRect, quadRect, quadRect, false,
+ SK_ColorTRANSPARENT);
+ quadSink.append(solidColorDrawQuad.PassAs<DrawQuad>(), appendQuadsData);
+ return;
+ }
+#endif
+
switch (m_format) {
case GL_LUMINANCE: {
// YUV software decoder.
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698