diff options
author | posciak@chromium.org <posciak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-27 22:09:11 +0000 |
---|---|---|
committer | posciak@chromium.org <posciak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-27 22:09:11 +0000 |
commit | 4d47e6c7655f215bc4f56ff8b9d925aa99edf48d (patch) | |
tree | 8ad9c3d1d5f2701ed87f0180c5e97d51996ac24d /content/common/gpu/media/vaapi_h264_decoder.cc | |
parent | 06ac889f146c2f1d59684e2613f6884cfe14ff64 (diff) | |
download | chromium_src-4d47e6c7655f215bc4f56ff8b9d925aa99edf48d.zip chromium_src-4d47e6c7655f215bc4f56ff8b9d925aa99edf48d.tar.gz chromium_src-4d47e6c7655f215bc4f56ff8b9d925aa99edf48d.tar.bz2 |
Extract Scoped{FrameBuffer,Texture}Binder and clean up TFP in VAVDA.
Clean up TFP in VAVDA:
- properly restore currently bound texture after binding our own
- use the extracted Binders for the above
- use glXDestroyPixmap instead of glXDestroyPixmapGLX
- do not bind texture twice
Also modify TextureImageTransportSurface to use the extracted Binders.
BUG=
TEST=manual runs of VAVDA
Review URL: https://chromiumcodereview.appspot.com/10827052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/gpu/media/vaapi_h264_decoder.cc')
-rw-r--r-- | content/common/gpu/media/vaapi_h264_decoder.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/common/gpu/media/vaapi_h264_decoder.cc b/content/common/gpu/media/vaapi_h264_decoder.cc index d65c575..cb716b2 100644 --- a/content/common/gpu/media/vaapi_h264_decoder.cc +++ b/content/common/gpu/media/vaapi_h264_decoder.cc @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/stl_util.h" +#include "content/common/gpu/gl_scoped_binders.h" #include "content/common/gpu/media/vaapi_h264_decoder.h" #include "third_party/libva/va/va.h" #include "third_party/libva/va/va_x11.h" @@ -255,14 +256,14 @@ VaapiH264Decoder::DecodeSurface::DecodeSurface( if (!make_context_current_.Run()) return; - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, texture_id_); + content::ScopedTextureBinder texture_binder(texture_id_); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); XWindowAttributes win_attr; int screen = DefaultScreen(x_display_); XGetWindowAttributes(x_display_, RootWindow(x_display_, screen), &win_attr); + //TODO(posciak): pass the depth required by libva, not the RootWindow's depth x_pixmap_ = XCreatePixmap(x_display_, RootWindow(x_display_, screen), width_, height_, win_attr.depth); if (!x_pixmap_) { @@ -283,7 +284,6 @@ VaapiH264Decoder::DecodeSurface::DecodeSurface( return; } - glBindTexture(GL_TEXTURE_2D, texture_id_); glXBindTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL); available_ = true; @@ -293,7 +293,7 @@ VaapiH264Decoder::DecodeSurface::~DecodeSurface() { // Unbind surface from texture and deallocate resources. if (glx_pixmap_ && make_context_current_.Run()) { glXReleaseTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT); - glXDestroyGLXPixmap(x_display_, glx_pixmap_); + glXDestroyPixmap(x_display_, glx_pixmap_); } if (x_pixmap_) |