Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libva
Commits
8428600c
Commit
8428600c
authored
Jul 01, 2010
by
Gwenole Beauchesne
Committed by
Xiang, Haihao
Jul 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call GLX Pixmap related functions through the vtable.
parent
4b53862d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
va/glx/va_glx_impl.c
va/glx/va_glx_impl.c
+22
-11
va/glx/va_glx_private.h
va/glx/va_glx_private.h
+10
-0
No files found.
va/glx/va_glx_impl.c
View file @
8428600c
...
@@ -222,6 +222,14 @@ static int load_tfp_extensions(VADriverContextP ctx)
...
@@ -222,6 +222,14 @@ static int load_tfp_extensions(VADriverContextP ctx)
{
{
VAOpenGLVTableP
pOpenGLVTable
=
gl_get_vtable
(
ctx
);
VAOpenGLVTableP
pOpenGLVTable
=
gl_get_vtable
(
ctx
);
pOpenGLVTable
->
glx_create_pixmap
=
(
PFNGLXCREATEPIXMAPPROC
)
get_proc_address
(
"glXCreatePixmap"
);
if
(
!
pOpenGLVTable
->
glx_create_pixmap
)
return
0
;
pOpenGLVTable
->
glx_destroy_pixmap
=
(
PFNGLXDESTROYPIXMAPPROC
)
get_proc_address
(
"glXDestroyPixmap"
);
if
(
!
pOpenGLVTable
->
glx_destroy_pixmap
)
return
0
;
pOpenGLVTable
->
glx_bind_tex_image
=
(
PFNGLXBINDTEXIMAGEEXTPROC
)
pOpenGLVTable
->
glx_bind_tex_image
=
(
PFNGLXBINDTEXIMAGEEXTPROC
)
get_proc_address
(
"glXBindTexImageEXT"
);
get_proc_address
(
"glXBindTexImageEXT"
);
if
(
!
pOpenGLVTable
->
glx_bind_tex_image
)
if
(
!
pOpenGLVTable
->
glx_bind_tex_image
)
...
@@ -451,15 +459,16 @@ struct VASurfaceGLX {
...
@@ -451,15 +459,16 @@ struct VASurfaceGLX {
// Create Pixmaps for GLX texture-from-pixmap extension
// Create Pixmaps for GLX texture-from-pixmap extension
static
int
create_tfp_surface
(
VADriverContextP
ctx
,
VASurfaceGLXP
pSurfaceGLX
)
static
int
create_tfp_surface
(
VADriverContextP
ctx
,
VASurfaceGLXP
pSurfaceGLX
)
{
{
const
unsigned
int
width
=
pSurfaceGLX
->
width
;
VAOpenGLVTableP
const
pOpenGLVTable
=
gl_get_vtable
(
ctx
);
const
unsigned
int
height
=
pSurfaceGLX
->
height
;
const
unsigned
int
width
=
pSurfaceGLX
->
width
;
Pixmap
pixmap
=
None
;
const
unsigned
int
height
=
pSurfaceGLX
->
height
;
GLXFBConfig
*
fbconfig
=
NULL
;
Pixmap
pixmap
=
None
;
GLXPixmap
glx_pixmap
=
None
;
GLXFBConfig
*
fbconfig
=
NULL
;
Window
root_window
;
GLXPixmap
glx_pixmap
=
None
;
XWindowAttributes
wattr
;
Window
root_window
;
int
*
attrib
;
XWindowAttributes
wattr
;
int
n_fbconfig_attrs
;
int
*
attrib
;
int
n_fbconfig_attrs
;
root_window
=
RootWindow
((
Display
*
)
ctx
->
native_dpy
,
ctx
->
x11_screen
);
root_window
=
RootWindow
((
Display
*
)
ctx
->
native_dpy
,
ctx
->
x11_screen
);
XGetWindowAttributes
((
Display
*
)
ctx
->
native_dpy
,
root_window
,
&
wattr
);
XGetWindowAttributes
((
Display
*
)
ctx
->
native_dpy
,
root_window
,
&
wattr
);
...
@@ -523,7 +532,7 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
...
@@ -523,7 +532,7 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
*
attrib
++
=
GL_NONE
;
*
attrib
++
=
GL_NONE
;
x11_trap_errors
();
x11_trap_errors
();
glx_pixmap
=
glXCreateP
ixmap
(
glx_pixmap
=
pOpenGLVTable
->
glx_create_p
ixmap
(
(
Display
*
)
ctx
->
native_dpy
,
(
Display
*
)
ctx
->
native_dpy
,
fbconfig
[
0
],
fbconfig
[
0
],
pixmap
,
pixmap
,
...
@@ -544,13 +553,15 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
...
@@ -544,13 +553,15 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
// Destroy Pixmaps used for TFP
// Destroy Pixmaps used for TFP
static
void
destroy_tfp_surface
(
VADriverContextP
ctx
,
VASurfaceGLXP
pSurfaceGLX
)
static
void
destroy_tfp_surface
(
VADriverContextP
ctx
,
VASurfaceGLXP
pSurfaceGLX
)
{
{
VAOpenGLVTableP
const
pOpenGLVTable
=
gl_get_vtable
(
ctx
);
if
(
pSurfaceGLX
->
pix_texture
)
{
if
(
pSurfaceGLX
->
pix_texture
)
{
glDeleteTextures
(
1
,
&
pSurfaceGLX
->
pix_texture
);
glDeleteTextures
(
1
,
&
pSurfaceGLX
->
pix_texture
);
pSurfaceGLX
->
pix_texture
=
0
;
pSurfaceGLX
->
pix_texture
=
0
;
}
}
if
(
pSurfaceGLX
->
glx_pixmap
)
{
if
(
pSurfaceGLX
->
glx_pixmap
)
{
glXDestroyP
ixmap
((
Display
*
)
ctx
->
native_dpy
,
pSurfaceGLX
->
glx_pixmap
);
pOpenGLVTable
->
glx_destroy_p
ixmap
((
Display
*
)
ctx
->
native_dpy
,
pSurfaceGLX
->
glx_pixmap
);
pSurfaceGLX
->
glx_pixmap
=
None
;
pSurfaceGLX
->
glx_pixmap
=
None
;
}
}
...
...
va/glx/va_glx_private.h
View file @
8428600c
...
@@ -31,15 +31,25 @@
...
@@ -31,15 +31,25 @@
#include "va_x11.h"
#include "va_x11.h"
#include "va_glx.h"
#include "va_glx.h"
#include "va_backend_glx.h"
#include "va_backend_glx.h"
#include <GL/glxext.h>
#if GLX_GLXEXT_VERSION < 18
#if GLX_GLXEXT_VERSION < 18
typedef
void
(
*
PFNGLXBINDTEXIMAGEEXTPROC
)(
Display
*
,
GLXDrawable
,
int
,
const
int
*
);
typedef
void
(
*
PFNGLXBINDTEXIMAGEEXTPROC
)(
Display
*
,
GLXDrawable
,
int
,
const
int
*
);
typedef
void
(
*
PFNGLXRELEASETEXIMAGEEXTPROC
)(
Display
*
,
GLXDrawable
,
int
);
typedef
void
(
*
PFNGLXRELEASETEXIMAGEEXTPROC
)(
Display
*
,
GLXDrawable
,
int
);
#endif
#endif
#if GLX_GLXEXT_VERSION < 27
/* XXX: this is not exactly that version but this is the only means to
make sure we have the correct <GL/glx.h> with those signatures */
typedef
GLXPixmap
(
*
PFNGLXCREATEPIXMAPPROC
)(
Display
*
,
GLXFBConfig
,
Pixmap
,
const
int
*
);
typedef
void
(
*
PFNGLXDESTROYPIXMAPPROC
)(
Display
*
,
GLXPixmap
);
#endif
typedef
struct
VAOpenGLVTable
*
VAOpenGLVTableP
;
typedef
struct
VAOpenGLVTable
*
VAOpenGLVTableP
;
struct
VAOpenGLVTable
{
struct
VAOpenGLVTable
{
PFNGLXCREATEPIXMAPPROC
glx_create_pixmap
;
PFNGLXDESTROYPIXMAPPROC
glx_destroy_pixmap
;
PFNGLXBINDTEXIMAGEEXTPROC
glx_bind_tex_image
;
PFNGLXBINDTEXIMAGEEXTPROC
glx_bind_tex_image
;
PFNGLXRELEASETEXIMAGEEXTPROC
glx_release_tex_image
;
PFNGLXRELEASETEXIMAGEEXTPROC
glx_release_tex_image
;
PFNGLGENFRAMEBUFFERSEXTPROC
gl_gen_framebuffers
;
PFNGLGENFRAMEBUFFERSEXTPROC
gl_gen_framebuffers
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment