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
de4abcf3
Commit
de4abcf3
authored
Sep 20, 2007
by
Waldo Bastian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to libva 0.24
parent
379f90c0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
287 additions
and
116 deletions
+287
-116
dummy_drv_video/Makefile.am
dummy_drv_video/Makefile.am
+2
-2
dummy_drv_video/dummy_drv_video.c
dummy_drv_video/dummy_drv_video.c
+72
-17
dummy_drv_video/dummy_drv_video.h
dummy_drv_video/dummy_drv_video.h
+1
-0
src/va.c
src/va.c
+88
-26
src/va.h
src/va.h
+98
-12
src/va_backend.h
src/va_backend.h
+26
-15
src/va_x11.h
src/va_x11.h
+0
-44
No files found.
dummy_drv_video/Makefile.am
View file @
de4abcf3
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
dummy_drv_video_la_LTLIBRARIES
=
dummy_drv_video.la
dummy_drv_video_la_LTLIBRARIES
=
dummy_drv_video.la
dummy_drv_video_ladir
=
/usr/X11R6/lib/modules/dri
dummy_drv_video_ladir
=
/usr/X11R6/lib/modules/dri
dummy_drv_video_la_LDFLAGS
=
-
no-undefined
-module
-Wl
,--no-undefined
dummy_drv_video_la_LDFLAGS
=
-
module
-avoid-version
-no-undefined
-Wl
,--no-undefined
dummy_drv_video_la_LIBADD
=
-lv
a
dummy_drv_video_la_LIBADD
=
../src/libva.l
a
AM_CFLAGS
=
-I
$(top_srcdir)
/src
-I
$(top_srcdir)
/../../include/external/
-I
$(top_srcdir)
/../../include/kmd
AM_CFLAGS
=
-I
$(top_srcdir)
/src
-I
$(top_srcdir)
/../../include/external/
-I
$(top_srcdir)
/../../include/kmd
dummy_drv_video_la_SOURCES
=
dummy_drv_video.c object_heap.c
dummy_drv_video_la_SOURCES
=
dummy_drv_video.c object_heap.c
...
...
dummy_drv_video/dummy_drv_video.c
View file @
de4abcf3
...
@@ -312,6 +312,26 @@ VAStatus dummy_CreateConfig(
...
@@ -312,6 +312,26 @@ VAStatus dummy_CreateConfig(
return
vaStatus
;
return
vaStatus
;
}
}
VAStatus
dummy_DestroyConfig
(
VADriverContextP
ctx
,
VAConfigID
config_id
)
{
INIT_DRIVER_DATA
VAStatus
vaStatus
;
object_config_p
obj_config
;
obj_config
=
CONFIG
(
config_id
);
if
(
NULL
==
obj_config
)
{
vaStatus
=
VA_STATUS_ERROR_INVALID_CONFIG
;
return
vaStatus
;
}
object_heap_free
(
&
driver_data
->
config_heap
,
(
object_base_p
)
obj_config
);
return
VA_STATUS_SUCCESS
;
}
VAStatus
dummy_GetConfigAttributes
(
VAStatus
dummy_GetConfigAttributes
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VAConfigID
config_id
,
VAConfigID
config_id
,
...
@@ -1010,32 +1030,62 @@ VAStatus dummy_PutSurface(
...
@@ -1010,32 +1030,62 @@ VAStatus dummy_PutSurface(
unsigned
short
desth
,
unsigned
short
desth
,
VARectangle
*
cliprects
,
/* client supplied clip list */
VARectangle
*
cliprects
,
/* client supplied clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
int
flags
/* de-interlacing flags */
unsigned
int
flags
/* de-interlacing flags */
)
{
/* TODO */
return
VA_STATUS_ERROR_UNKNOWN
;
}
/*
* Query display attributes
* The caller must provide a "attr_list" array that can hold at
* least vaMaxNumDisplayAttributes() entries. The actual number of attributes
* returned in "attr_list" is returned in "num_attributes".
*/
VAStatus
dummy_QueryDisplayAttributes
(
VADriverContextP
ctx
,
VADisplayAttribute
*
attr_list
,
/* out */
int
*
num_attributes
/* out */
)
)
{
{
/* TODO */
/* TODO */
return
VA_STATUS_ERROR_UNKNOWN
;
return
VA_STATUS_ERROR_UNKNOWN
;
}
}
/*
* Get display attributes
* This function returns the current attribute values in "attr_list".
* Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can have their values retrieved.
*/
VAStatus
dummy_GetDisplayAttributes
(
VADriverContextP
ctx
,
VADisplayAttribute
*
attr_list
,
/* in/out */
int
num_attributes
)
{
/* TODO */
return
VA_STATUS_ERROR_UNKNOWN
;
}
VAStatus
dummy_CopySurfaceToGLXPbuffer
(
/*
* Set display attributes
* Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can be set. If the attribute is not settable or
* the value is out of range, the function returns VA_STATUS_ERROR_ATTR_NOT_SUPPORTED
*/
VAStatus
dummy_SetDisplayAttributes
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurface
*
surface
,
VADisplayAttribute
*
attr_list
,
XID
pbuffer_id
,
int
num_attributes
short
srcx
,
)
short
srcy
,
unsigned
short
width
,
unsigned
short
height
,
short
destx
,
short
desty
,
unsigned
int
draw_buffer
,
unsigned
int
flags
/* de-interlacing flags */
)
{
{
/* TODO */
/* TODO */
return
VA_STATUS_ERROR_UNKNOWN
;
return
VA_STATUS_ERROR_UNKNOWN
;
}
}
VAStatus
dummy_DbgCopySurfaceToBuffer
(
VAStatus
dummy_DbgCopySurfaceToBuffer
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurface
*
surface
,
VASurface
*
surface
,
...
@@ -1087,7 +1137,7 @@ VAStatus dummy_Terminate( VADriverContextP ctx )
...
@@ -1087,7 +1137,7 @@ VAStatus dummy_Terminate( VADriverContextP ctx )
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
}
}
VAStatus
__vaDriverInit_0_2
3
(
VADriverContextP
ctx
)
VAStatus
__vaDriverInit_0_2
4
(
VADriverContextP
ctx
)
{
{
object_base_p
obj
;
object_base_p
obj
;
int
result
;
int
result
;
...
@@ -1095,12 +1145,13 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
...
@@ -1095,12 +1145,13 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
int
i
;
int
i
;
ctx
->
version_major
=
0
;
ctx
->
version_major
=
0
;
ctx
->
version_minor
=
2
2
;
ctx
->
version_minor
=
2
4
;
ctx
->
max_profiles
=
DUMMY_MAX_PROFILES
;
ctx
->
max_profiles
=
DUMMY_MAX_PROFILES
;
ctx
->
max_entrypoints
=
DUMMY_MAX_ENTRYPOINTS
;
ctx
->
max_entrypoints
=
DUMMY_MAX_ENTRYPOINTS
;
ctx
->
max_attributes
=
DUMMY_MAX_CONFIG_ATTRIBUTES
;
ctx
->
max_attributes
=
DUMMY_MAX_CONFIG_ATTRIBUTES
;
ctx
->
max_image_formats
=
DUMMY_MAX_IMAGE_FORMATS
;
ctx
->
max_image_formats
=
DUMMY_MAX_IMAGE_FORMATS
;
ctx
->
max_subpic_formats
=
DUMMY_MAX_SUBPIC_FORMATS
;
ctx
->
max_subpic_formats
=
DUMMY_MAX_SUBPIC_FORMATS
;
ctx
->
max_display_attributes
=
DUMMY_MAX_DISPLAY_ATTRIBUTES
;
ctx
->
vtable
.
vaTerminate
=
dummy_Terminate
;
ctx
->
vtable
.
vaTerminate
=
dummy_Terminate
;
ctx
->
vtable
.
vaQueryConfigEntrypoints
=
dummy_QueryConfigEntrypoints
;
ctx
->
vtable
.
vaQueryConfigEntrypoints
=
dummy_QueryConfigEntrypoints
;
...
@@ -1108,6 +1159,7 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
...
@@ -1108,6 +1159,7 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
ctx
->
vtable
.
vaQueryConfigEntrypoints
=
dummy_QueryConfigEntrypoints
;
ctx
->
vtable
.
vaQueryConfigEntrypoints
=
dummy_QueryConfigEntrypoints
;
ctx
->
vtable
.
vaQueryConfigAttributes
=
dummy_QueryConfigAttributes
;
ctx
->
vtable
.
vaQueryConfigAttributes
=
dummy_QueryConfigAttributes
;
ctx
->
vtable
.
vaCreateConfig
=
dummy_CreateConfig
;
ctx
->
vtable
.
vaCreateConfig
=
dummy_CreateConfig
;
ctx
->
vtable
.
vaDestroyConfig
=
dummy_DestroyConfig
;
ctx
->
vtable
.
vaGetConfigAttributes
=
dummy_GetConfigAttributes
;
ctx
->
vtable
.
vaGetConfigAttributes
=
dummy_GetConfigAttributes
;
ctx
->
vtable
.
vaCreateSurfaces
=
dummy_CreateSurfaces
;
ctx
->
vtable
.
vaCreateSurfaces
=
dummy_CreateSurfaces
;
ctx
->
vtable
.
vaDestroySurface
=
dummy_DestroySurface
;
ctx
->
vtable
.
vaDestroySurface
=
dummy_DestroySurface
;
...
@@ -1125,7 +1177,6 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
...
@@ -1125,7 +1177,6 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
ctx
->
vtable
.
vaSyncSurface
=
dummy_SyncSurface
;
ctx
->
vtable
.
vaSyncSurface
=
dummy_SyncSurface
;
ctx
->
vtable
.
vaQuerySurfaceStatus
=
dummy_QuerySurfaceStatus
;
ctx
->
vtable
.
vaQuerySurfaceStatus
=
dummy_QuerySurfaceStatus
;
ctx
->
vtable
.
vaPutSurface
=
dummy_PutSurface
;
ctx
->
vtable
.
vaPutSurface
=
dummy_PutSurface
;
ctx
->
vtable
.
vaCopySurfaceToGLXPbuffer
=
dummy_CopySurfaceToGLXPbuffer
;
ctx
->
vtable
.
vaQueryImageFormats
=
dummy_QueryImageFormats
;
ctx
->
vtable
.
vaQueryImageFormats
=
dummy_QueryImageFormats
;
ctx
->
vtable
.
vaCreateImage
=
dummy_CreateImage
;
ctx
->
vtable
.
vaCreateImage
=
dummy_CreateImage
;
ctx
->
vtable
.
vaDestroyImage
=
dummy_DestroyImage
;
ctx
->
vtable
.
vaDestroyImage
=
dummy_DestroyImage
;
...
@@ -1139,6 +1190,10 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
...
@@ -1139,6 +1190,10 @@ VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
ctx
->
vtable
.
vaSetSubpictureChromakey
=
dummy_SetSubpictureChromakey
;
ctx
->
vtable
.
vaSetSubpictureChromakey
=
dummy_SetSubpictureChromakey
;
ctx
->
vtable
.
vaSetSubpictureGlobalAlpha
=
dummy_SetSubpictureGlobalAlpha
;
ctx
->
vtable
.
vaSetSubpictureGlobalAlpha
=
dummy_SetSubpictureGlobalAlpha
;
ctx
->
vtable
.
vaAssociateSubpicture
=
dummy_AssociateSubpicture
;
ctx
->
vtable
.
vaAssociateSubpicture
=
dummy_AssociateSubpicture
;
ctx
->
vtable
.
vaQueryDisplayAttributes
=
dummy_QueryDisplayAttributes
;
ctx
->
vtable
.
vaGetDisplayAttributes
=
dummy_GetDisplayAttributes
;
ctx
->
vtable
.
vaSetDisplayAttributes
=
dummy_SetDisplayAttributes
;
ctx
->
vtable
.
vaDbgCopySurfaceToBuffer
=
dummy_DbgCopySurfaceToBuffer
;
ctx
->
vtable
.
vaDbgCopySurfaceToBuffer
=
dummy_DbgCopySurfaceToBuffer
;
driver_data
=
(
struct
dummy_driver_data
*
)
malloc
(
sizeof
(
*
driver_data
)
);
driver_data
=
(
struct
dummy_driver_data
*
)
malloc
(
sizeof
(
*
driver_data
)
);
...
...
dummy_drv_video/dummy_drv_video.h
View file @
de4abcf3
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#define DUMMY_MAX_CONFIG_ATTRIBUTES 10
#define DUMMY_MAX_CONFIG_ATTRIBUTES 10
#define DUMMY_MAX_IMAGE_FORMATS 10
#define DUMMY_MAX_IMAGE_FORMATS 10
#define DUMMY_MAX_SUBPIC_FORMATS 4
#define DUMMY_MAX_SUBPIC_FORMATS 4
#define DUMMY_MAX_DISPLAY_ATTRIBUTES 4
struct
dummy_driver_data
{
struct
dummy_driver_data
{
struct
object_heap
config_heap
;
struct
object_heap
config_heap
;
...
...
src/va.c
View file @
de4abcf3
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
#define DRIVER_EXTENSION "_drv_video.so"
#define DRIVER_EXTENSION "_drv_video.so"
#define DRIVER_INIT_FUNC "__vaDriverInit_0_2
3
"
#define DRIVER_INIT_FUNC "__vaDriverInit_0_2
4
"
#define CTX(dpy) ((VADriverContextP) dpy );
#define CTX(dpy) ((VADriverContextP) dpy );
#define ASSERT_CONTEXT(dpy) assert( vaDbgContextIsValid(dpy) )
#define ASSERT_CONTEXT(dpy) assert( vaDbgContextIsValid(dpy) )
...
@@ -254,11 +254,13 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
...
@@ -254,11 +254,13 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
attributes
);
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
attributes
);
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
image_formats
);
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
image_formats
);
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
subpic_formats
);
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
subpic_formats
);
CHECK_MAXIMUM
(
vaStatus
,
ctx
,
display_attributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
Terminate
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
Terminate
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryConfigProfiles
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryConfigProfiles
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryConfigEntrypoints
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryConfigEntrypoints
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryConfigAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryConfigAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CreateConfig
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CreateConfig
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DestroyConfig
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
GetConfigAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
GetConfigAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CreateSurfaces
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CreateSurfaces
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DestroySurface
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DestroySurface
);
...
@@ -276,7 +278,6 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
...
@@ -276,7 +278,6 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
CHECK_VTABLE
(
vaStatus
,
ctx
,
SyncSurface
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
SyncSurface
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QuerySurfaceStatus
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QuerySurfaceStatus
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
PutSurface
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
PutSurface
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CopySurfaceToGLXPbuffer
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryImageFormats
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryImageFormats
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CreateImage
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
CreateImage
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DestroyImage
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DestroyImage
);
...
@@ -290,6 +291,9 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
...
@@ -290,6 +291,9 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
CHECK_VTABLE
(
vaStatus
,
ctx
,
SetSubpictureChromakey
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
SetSubpictureChromakey
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
SetSubpictureGlobalAlpha
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
SetSubpictureGlobalAlpha
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
AssociateSubpicture
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
AssociateSubpicture
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
QueryDisplayAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
GetDisplayAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
SetDisplayAttributes
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DbgCopySurfaceToBuffer
);
CHECK_VTABLE
(
vaStatus
,
ctx
,
DbgCopySurfaceToBuffer
);
}
}
if
(
VA_STATUS_SUCCESS
!=
vaStatus
)
if
(
VA_STATUS_SUCCESS
!=
vaStatus
)
...
@@ -517,6 +521,18 @@ VAStatus vaCreateConfig (
...
@@ -517,6 +521,18 @@ VAStatus vaCreateConfig (
return
ctx
->
vtable
.
vaCreateConfig
(
ctx
,
profile
,
entrypoint
,
attrib_list
,
num_attribs
,
config_id
);
return
ctx
->
vtable
.
vaCreateConfig
(
ctx
,
profile
,
entrypoint
,
attrib_list
,
num_attribs
,
config_id
);
}
}
VAStatus
vaDestroyConfig
(
VADisplay
dpy
,
VAConfigID
config_id
)
{
VADriverContextP
ctx
=
CTX
(
dpy
);
ASSERT_CONTEXT
(
ctx
);
TRACE
(
vaDestroyConfig
);
return
ctx
->
vtable
.
vaDestroyConfig
(
ctx
,
config_id
);
}
VAStatus
vaGetConfigAttributes
(
VAStatus
vaGetConfigAttributes
(
VADisplay
dpy
,
VADisplay
dpy
,
VAConfigID
config_id
,
VAConfigID
config_id
,
...
@@ -752,7 +768,7 @@ VAStatus vaPutSurface (
...
@@ -752,7 +768,7 @@ VAStatus vaPutSurface (
unsigned
short
desth
,
unsigned
short
desth
,
VARectangle
*
cliprects
,
/* client supplied clip list */
VARectangle
*
cliprects
,
/* client supplied clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
int
flags
/* de-interlacing flags */
unsigned
int
flags
/* de-interlacing flags */
)
)
{
{
VADriverContextP
ctx
=
CTX
(
dpy
);
VADriverContextP
ctx
=
CTX
(
dpy
);
...
@@ -764,29 +780,6 @@ VAStatus vaPutSurface (
...
@@ -764,29 +780,6 @@ VAStatus vaPutSurface (
cliprects
,
number_cliprects
,
flags
);
cliprects
,
number_cliprects
,
flags
);
}
}
VAStatus
vaCopySurfaceToGLXPbuffer
(
VADisplay
dpy
,
VASurface
*
surface
,
XID
pbuffer_id
,
short
srcx
,
short
srcy
,
unsigned
short
width
,
unsigned
short
height
,
short
destx
,
short
desty
,
unsigned
int
draw_buffer
,
unsigned
int
flags
/* de-interlacing flags */
)
{
VADriverContextP
ctx
=
CTX
(
dpy
);
ASSERT_CONTEXT
(
ctx
);
TRACE
(
vaCopySurfaceToGLXPbuffer
);
return
ctx
->
vtable
.
vaCopySurfaceToGLXPbuffer
(
ctx
,
surface
,
pbuffer_id
,
srcx
,
srcy
,
width
,
height
,
destx
,
desty
,
draw_buffer
,
flags
);
}
/* Get maximum number of image formats supported by the implementation */
/* Get maximum number of image formats supported by the implementation */
int
vaMaxNumImageFormats
(
int
vaMaxNumImageFormats
(
VADisplay
dpy
VADisplay
dpy
...
@@ -1056,6 +1049,75 @@ VAStatus vaAssociateSubpicture (
...
@@ -1056,6 +1049,75 @@ VAStatus vaAssociateSubpicture (
return
ctx
->
vtable
.
vaAssociateSubpicture
(
ctx
,
target_surface
,
subpicture
,
src_x
,
src_y
,
dest_x
,
dest_y
,
width
,
height
,
flags
);
return
ctx
->
vtable
.
vaAssociateSubpicture
(
ctx
,
target_surface
,
subpicture
,
src_x
,
src_y
,
dest_x
,
dest_y
,
width
,
height
,
flags
);
}
}
/* Get maximum number of display attributes supported by the implementation */
int
vaMaxNumDisplayAttributes
(
VADisplay
dpy
)
{
VADriverContextP
ctx
=
CTX
(
dpy
);
ASSERT_CONTEXT
(
ctx
);
return
ctx
->
max_display_attributes
;
}
/*
* Query display attributes
* The caller must provide a "attr_list" array that can hold at
* least vaMaxNumDisplayAttributes() entries. The actual number of attributes
* returned in "attr_list" is returned in "num_attributes".
*/
VAStatus
vaQueryDisplayAttributes
(
VADisplay
dpy
,
VADisplayAttribute
*
attr_list
,
/* out */
int
*
num_attributes
/* out */
)
{
VADriverContextP
ctx
=
CTX
(
dpy
);
ASSERT_CONTEXT
(
ctx
);
TRACE
(
vaQueryDisplayAttributes
);
return
ctx
->
vtable
.
vaQueryDisplayAttributes
(
ctx
,
attr_list
,
num_attributes
);
}
/*
* Get display attributes
* This function returns the current attribute values in "attr_list".
* Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can have their values retrieved.
*/
VAStatus
vaGetDisplayAttributes
(
VADisplay
dpy
,
VADisplayAttribute
*
attr_list
,
/* in/out */
int
num_attributes
)
{
VADriverContextP
ctx
=
CTX
(
dpy
);
ASSERT_CONTEXT
(
ctx
);
TRACE
(
vaGetDisplayAttributes
);
return
ctx
->
vtable
.
vaGetDisplayAttributes
(
ctx
,
attr_list
,
num_attributes
);
}
/*
* Set display attributes
* Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can be set. If the attribute is not settable or
* the value is out of range, the function returns VA_STATUS_ERROR_ATTR_NOT_SUPPORTED
*/
VAStatus
vaSetDisplayAttributes
(
VADisplay
dpy
,
VADisplayAttribute
*
attr_list
,
int
num_attributes
)
{
VADriverContextP
ctx
=
CTX
(
dpy
);
ASSERT_CONTEXT
(
ctx
);
TRACE
(
vaSetDisplayAttributes
);
return
ctx
->
vtable
.
vaSetDisplayAttributes
(
ctx
,
attr_list
,
num_attributes
);
}
VAStatus
vaDbgCopySurfaceToBuffer
(
VADisplay
dpy
,
VAStatus
vaDbgCopySurfaceToBuffer
(
VADisplay
dpy
,
VASurface
*
surface
,
VASurface
*
surface
,
...
...
src/va.h
View file @
de4abcf3
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
/*
/*
* Video Decode Acceleration API Specification
* Video Decode Acceleration API Specification
*
*
* Rev. 0.2
3
* Rev. 0.2
4
* <jonathan.bian@intel.com>
* <jonathan.bian@intel.com>
*
*
* Revision History:
* Revision History:
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
* rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support.
* rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support.
* rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha.
* rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha.
* rev 0.23 (09/07/2007 Jonathan Bian) - Fixed some issues with images and subpictures.
* rev 0.23 (09/07/2007 Jonathan Bian) - Fixed some issues with images and subpictures.
* rev 0.24 (09/18/2007 Jonathan Bian) - Added display attributes.
*
*
* Acknowledgements:
* Acknowledgements:
* Some concepts borrowed from XvMC and XvImage.
* Some concepts borrowed from XvMC and XvImage.
...
@@ -90,7 +91,7 @@ typedef int VAStatus; /* Return status type from functions */
...
@@ -90,7 +91,7 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000003
#define VA_STATUS_ERROR_INVALID_CONTEXT 0x00000003
#define VA_STATUS_ERROR_INVALID_SURFACE 0x00000004
#define VA_STATUS_ERROR_INVALID_SURFACE 0x00000004
#define VA_STATUS_ERROR_INVALID_BUFFER 0x00000005
#define VA_STATUS_ERROR_INVALID_BUFFER 0x00000005
#define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x00000006
/* Todo: Remove */
#define VA_STATUS_ERROR_ATTR_NOT_SUPPORTED 0x00000006
#define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x00000007
#define VA_STATUS_ERROR_MAX_NUM_EXCEEDED 0x00000007
#define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x00000008
#define VA_STATUS_ERROR_UNSUPPORTED_PROFILE 0x00000008
#define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x00000009
#define VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT 0x00000009
...
@@ -245,7 +246,10 @@ VAStatus vaQueryConfigAttributes (
...
@@ -245,7 +246,10 @@ VAStatus vaQueryConfigAttributes (
int
num_attribs
int
num_attribs
);
);
typedef
int
VAConfigID
;
/* Generic ID type, can be re-typed for specific implementation */
typedef
unsigned
int
VAGenericID
;
typedef
VAGenericID
VAConfigID
;
/*
/*
* Create a configuration for the decode pipeline
* Create a configuration for the decode pipeline
...
@@ -261,6 +265,14 @@ VAStatus vaCreateConfig (
...
@@ -261,6 +265,14 @@ VAStatus vaCreateConfig (
VAConfigID
*
config_id
/* out */
VAConfigID
*
config_id
/* out */
);
);
/*
* Free resources associdated with a given config
*/
VAStatus
vaDestroyConfig
(
VADisplay
dpy
,
VAConfigID
config_id
);
/*
/*
* Get all attributes for a given configuration
* Get all attributes for a given configuration
* The profile of the configuration is returned in “profile”
* The profile of the configuration is returned in “profile”
...
@@ -285,11 +297,9 @@ VAStatus vaGetConfigAttributes (
...
@@ -285,11 +297,9 @@ VAStatus vaGetConfigAttributes (
* Context represents a "virtual" video decode pipeline
* Context represents a "virtual" video decode pipeline
*/
*/
/* generic context ID type, can be re-typed for specific implementation */
typedef
VAGenericID
VAContextID
;
typedef
int
VAContextID
;
/* generic surface ID type, can be re-typed for specific implementation */
typedef
VAGenericID
VASurfaceID
;
typedef
int
VASurfaceID
;
#define VA_INVALID_SURFACE -1
#define VA_INVALID_SURFACE -1
...
@@ -386,7 +396,7 @@ VAStatus vaDestroyContext (
...
@@ -386,7 +396,7 @@ VAStatus vaDestroyContext (
*
*
*/
*/
typedef
int
VABufferID
;
typedef
VAGenericID
VABufferID
;
typedef
enum
typedef
enum
{
{
...
@@ -1075,7 +1085,7 @@ typedef struct _VAImageFormat
...
@@ -1075,7 +1085,7 @@ typedef struct _VAImageFormat
unsigned
int
alpha_mask
;
unsigned
int
alpha_mask
;
}
VAImageFormat
;
}
VAImageFormat
;
typedef
int
VAImageID
;
typedef
VAGenericID
VAImageID
;
typedef
struct
_VAImage
typedef
struct
_VAImage
{
{
...
@@ -1187,7 +1197,7 @@ VAStatus vaPutImage (
...
@@ -1187,7 +1197,7 @@ VAStatus vaPutImage (
* DVD sub-titles or closed captioning text etc.
* DVD sub-titles or closed captioning text etc.
*/
*/
typedef
int
VASubpictureID
;
typedef
VAGenericID
VASubpictureID
;
typedef
struct
_VASubpicture
typedef
struct
_VASubpicture
{
{
...
@@ -1333,6 +1343,79 @@ typedef struct _VARectangle
...
@@ -1333,6 +1343,79 @@ typedef struct _VARectangle
unsigned
short
height
;
unsigned
short
height
;
}
VARectangle
;
}
VARectangle
;
/*
* Display attributes
* Display attributes are used to control things such as contrast, hue, saturation,
* brightness etc. in the rendering process. The application can query what
* attributes are supported by the driver, and then set the appropriate attributes
* before calling vaPutSurface()
*/
/* Currently defined display attribute types */
typedef
enum
{
VADisplayAttribBrightness
=
0
,
VADisplayAttribContrast
=
1
,
VADisplayAttribHue
=
2
,
VADisplayAttribSaturation
=
3
,
}
VADisplayAttribType
;
/* flags for VADisplayAttribute */
#define VA_DISPLAY_ATTRIB_NOT_SUPPORTED 0x0000
#define VA_DISPLAY_ATTRIB_GETTABLE 0x0001
#define VA_DISPLAY_ATTRIB_SETTABLE 0x0002
typedef
struct
_VADisplayAttribute
{
VADisplayAttribType
type
;
int
min_value
;
int
max_value
;
int
value
;
/* used by the set/get attribute functions */
/* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
unsigned
int
flags
;
}
VADisplayAttribute
;
/* Get maximum number of display attributs supported by the implementation */
int
vaMaxNumDisplayAttributes
(
VADisplay
dpy
);
/*
* Query display attributes
* The caller must provide a "attr_list" array that can hold at
* least vaMaxNumDisplayAttributes() entries. The actual number of attributes
* returned in "attr_list" is returned in "num_attributes".
*/
VAStatus
vaQueryDisplayAttributes
(
VADisplay
dpy
,
VADisplayAttribute
*
attr_list
,
/* out */
int
*
num_attributes
/* out */
);
/*
* Get display attributes
* This function returns the current attribute values in "attr_list".
* Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can have their values retrieved.
*/
VAStatus
vaGetDisplayAttributes
(
VADisplay
dpy
,
VADisplayAttribute
*
attr_list
,
/* in/out */
int
num_attributes
);
/*
* Set display attributes
* Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can be set. If the attribute is not settable or
* the value is out of range, the function returns VA_STATUS_ERROR_ATTR_NOT_SUPPORTED
*/
VAStatus
vaSetDisplayAttributes
(
VADisplay
dpy
,
VADisplayAttribute
*
attr_list
,
int
num_attributes
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
@@ -1476,8 +1559,11 @@ Mostly to demonstrate program flow with no error handling ...
...
@@ -1476,8 +1559,11 @@ Mostly to demonstrate program flow with no error handling ...
VAImage sub_image;
VAImage sub_image;
VASubpicture subpicture;
VASubpicture subpicture;
unsigned char sub_data[128][16];
unsigned char sub_data[128][16];
/* fill sub_data with subtitle in AI44 */
/* create an image for the subtitle */
vaCreateImage(dpy, sub_formats, 128, 16,&sub_image);
vaCreateImage(dpy, sub_formats, 128, 16, &sub_image);
vaCreateBuffer(dpy, VAImageBufferType, &sub_image->buf);
/* fill the image data */
vaBufferData(dpy, sub_image->buf, sub_image->data_size, sub_data);
vaCreateSubpicture(dpy, &sub_image, &subpicture);
vaCreateSubpicture(dpy, &sub_image, &subpicture);
unsigned char palette[3][16];
unsigned char palette[3][16];
/* fill the palette data */
/* fill the palette data */
...
...
src/va_backend.h
View file @
de4abcf3
...
@@ -48,6 +48,7 @@ struct VADriverContext
...
@@ -48,6 +48,7 @@ struct VADriverContext
int
max_attributes
;
int
max_attributes
;
int
max_image_formats
;
int
max_image_formats
;
int
max_subpic_formats
;
int
max_subpic_formats
;
int
max_display_attributes
;
void
*
handle
;
/* dlopen handle */
void
*
handle
;
/* dlopen handle */
void
*
pDriverData
;
void
*
pDriverData
;
struct
struct
...
@@ -84,6 +85,11 @@ struct VADriverContext
...
@@ -84,6 +85,11 @@ struct VADriverContext
VAConfigID
*
config_id
/* out */
VAConfigID
*
config_id
/* out */
);
);
VAStatus
(
*
vaDestroyConfig
)
(
VADriverContextP
ctx
,
VAConfigID
config_id
);
VAStatus
(
*
vaGetConfigAttributes
)
(
VAStatus
(
*
vaGetConfigAttributes
)
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VAConfigID
config_id
,
VAConfigID
config_id
,
...
@@ -205,20 +211,6 @@ struct VADriverContext
...
@@ -205,20 +211,6 @@ struct VADriverContext
unsigned
short
desth
,
unsigned
short
desth
,
VARectangle
*
cliprects
,
/* client supplied clip list */
VARectangle
*
cliprects
,
/* client supplied clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
int
flags
/* de-interlacing flags */
);
VAStatus
(
*
vaCopySurfaceToGLXPbuffer
)
(
VADriverContextP
ctx
,
VASurface
*
surface
,
XID
pbuffer_id
,
short
srcx
,
short
srcy
,
unsigned
short
width
,
unsigned
short
height
,
short
destx
,
short
desty
,
unsigned
int
draw_buffer
,
unsigned
int
flags
/* de-interlacing flags */
unsigned
int
flags
/* de-interlacing flags */
);
);
...
@@ -328,6 +320,25 @@ struct VADriverContext
...
@@ -328,6 +320,25 @@ struct VADriverContext
unsigned
int
flags
unsigned
int
flags
);
);
VAStatus
(
*
vaQueryDisplayAttributes
)
(
VADriverContextP
ctx
,
VADisplayAttribute
*
attr_list
,
/* out */
int
*
num_attributes
/* out */
);
VAStatus
(
*
vaGetDisplayAttributes
)
(
VADriverContextP
ctx
,
VADisplayAttribute
*
attr_list
,
/* in/out */
int
num_attributes
);
VAStatus
(
*
vaSetDisplayAttributes
)
(
VADriverContextP
ctx
,
VADisplayAttribute
*
attr_list
,
int
num_attributes
);
VAStatus
(
*
vaDbgCopySurfaceToBuffer
)
(
VAStatus
(
*
vaDbgCopySurfaceToBuffer
)
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurface
*
surface
,
VASurface
*
surface
,
...
...
src/va_x11.h
View file @
de4abcf3
...
@@ -50,53 +50,9 @@ VAStatus vaPutSurface (
...
@@ -50,53 +50,9 @@ VAStatus vaPutSurface (
unsigned
short
desth
,
unsigned
short
desth
,
VARectangle
*
cliprects
,
/* client supplied clip list */
VARectangle
*
cliprects
,
/* client supplied clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
unsigned
int
number_cliprects
,
/* number of clip rects in the clip list */
int
flags
/* de-interlacing flags */
);
/*
This function copies a rectangle of dimension "width" by "height"
from the VASurface indicated by "surface" to the GLXPbuffer
identified by its XID "pbuffer_id". The locations of source and
destination rectangles are specified differently for the VASurface
source and the GLXPbuffer destination as follows. On the VASurface,
the rectangle location is specified in the usual X-Window fashion
with srcx and srcy indicating the location of the upper left hand
corner of the rectangle relative to the VASurface origin (the upper
left hand corner of the XvMCSurface with positive Y axis going in the
down direction). On the GLXPbuffer the rectangle location is
specified in the usual OpenGL fashion with the dstx and dsty
indicating the location of the lower left hand corner of the
rectangle relative to the GLXPbuffer origin (the lower left hand
corner of the GLXPbuffer with the positive Y axis going in the
up direction).
The "draw_buffer" takes the same OpenGL enums that glDrawBuffer()
takes (ie. GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT,
GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT or GL_FRONT_AND_BACK). This
indicates which buffer of the GLXPbuffer is to be used for the
destination of the copy. Buffers specified in the "draw_buffer"
that do not exist in the GLXPbuffer are ignored.
"flags" may be VA_TOP_FIELD, VA_BOTTOM_FIELD or VA_FRAME_PICTURE.
If flags is not VA_FRAME_PICTURE, the srcy and height are in field
coordinates, not frame. That is, the total copyable height is half
the height of the VASurface.
*/
VAStatus
vaCopySurfaceToGLXPbuffer
(
VADisplay
dpy
,
VASurface
*
surface
,
XID
pbuffer_id
,
short
srcx
,
short
srcy
,
unsigned
short
width
,
unsigned
short
height
,
short
destx
,
short
desty
,
unsigned
int
draw_buffer
,
unsigned
int
flags
/* de-interlacing flags */
unsigned
int
flags
/* de-interlacing flags */
);
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
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