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
4a9db082
Commit
4a9db082
authored
Oct 29, 2007
by
Waldo Bastian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to VA API v0.25
parent
12e8a228
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
597 additions
and
428 deletions
+597
-428
dummy_drv_video/dummy_drv_video.c
dummy_drv_video/dummy_drv_video.c
+103
-100
dummy_drv_video/dummy_drv_video.h
dummy_drv_video/dummy_drv_video.h
+9
-3
src/va.c
src/va.c
+107
-39
src/va.h
src/va.h
+251
-192
src/va_backend.h
src/va_backend.h
+78
-52
src/va_x11.h
src/va_x11.h
+8
-1
test/test.c
test/test.c
+9
-9
test/test_07.c
test/test_07.c
+20
-20
test/test_08.c
test/test_08.c
+7
-7
test/test_09.c
test/test_09.c
+5
-5
No files found.
dummy_drv_video/dummy_drv_video.c
View file @
4a9db082
This diff is collapsed.
Click to expand it.
dummy_drv_video/dummy_drv_video.h
View file @
4a9db082
...
...
@@ -34,6 +34,7 @@
#define DUMMY_MAX_IMAGE_FORMATS 10
#define DUMMY_MAX_SUBPIC_FORMATS 4
#define DUMMY_MAX_DISPLAY_ATTRIBUTES 4
#define DUMMY_STR_VENDOR "Dummy-dummy-1.0-dummy"
struct
dummy_driver_data
{
struct
object_heap
config_heap
;
...
...
@@ -52,14 +53,19 @@ struct object_config {
struct
object_context
{
struct
object_base
base
;
VAContext
*
context
;
VAConfigID
config
;
VAContext
ID
context_id
;
VAConfigID
config
_id
;
VASurfaceID
current_render_target
;
int
picture_width
;
int
picture_height
;
int
num_render_targets
;
int
flags
;
VASurfaceID
*
render_targets
;
};
struct
object_surface
{
struct
object_base
base
;
VASurface
*
surface
;
VASurface
ID
surface_id
;
};
struct
object_buffer
{
...
...
src/va.c
View file @
4a9db082
This diff is collapsed.
Click to expand it.
src/va.h
View file @
4a9db082
This diff is collapsed.
Click to expand it.
src/va_backend.h
View file @
4a9db082
...
...
@@ -34,28 +34,14 @@
#include <stdlib.h>
typedef
struct
VADriverContext
*
VADriverContextP
;
struct
VADriver
Context
struct
VADriver
VTable
{
VADriverContextP
pNext
;
Display
*
x11_dpy
;
int
x11_screen
;
int
version_major
;
int
version_minor
;
int
max_profiles
;
int
max_entrypoints
;
int
max_attributes
;
int
max_image_formats
;
int
max_subpic_formats
;
int
max_display_attributes
;
void
*
handle
;
/* dlopen handle */
void
*
pDriverData
;
struct
VADriverVTable
{
VAStatus
(
*
vaTerminate
)
(
VADriverContextP
ctx
);
VAStatus
(
*
vaTerminate
)
(
VADriverContextP
ctx
);
VAStatus
(
*
vaQueryConfigProfiles
)
(
VAStatus
(
*
vaQueryConfigProfiles
)
(
VADriverContextP
ctx
,
VAProfile
*
profile_list
,
/* out */
int
*
num_profiles
/* out */
...
...
@@ -105,12 +91,12 @@ struct VADriverContext
int
height
,
int
format
,
int
num_surfaces
,
VASurface
*
surfaces
/* out */
VASurface
ID
*
surfaces
/* out */
);
VAStatus
(
*
vaDestroySurface
)
(
VAStatus
(
*
vaDestroySurface
s
)
(
VADriverContextP
ctx
,
VASurface
*
surface_list
,
VASurface
ID
*
surface_list
,
int
num_surfaces
);
...
...
@@ -120,14 +106,14 @@ struct VADriverContext
int
picture_width
,
int
picture_height
,
int
flag
,
VASurface
*
render_targets
,
VASurface
ID
*
render_targets
,
int
num_render_targets
,
VAContext
*
context
/* out */
VAContext
ID
*
context
/* out */
);
VAStatus
(
*
vaDestroyContext
)
(
VADriverContextP
ctx
,
VAContext
*
context
VAContext
ID
context
);
VAStatus
(
*
vaCreateBuffer
)
(
...
...
@@ -168,38 +154,37 @@ struct VADriverContext
VAStatus
(
*
vaBeginPicture
)
(
VADriverContextP
ctx
,
VAContext
*
context
,
VASurface
*
render_target
VAContext
ID
context
,
VASurface
ID
render_target
);
VAStatus
(
*
vaRenderPicture
)
(
VADriverContextP
ctx
,
VAContext
*
context
,
VAContext
ID
context
,
VABufferID
*
buffers
,
int
num_buffers
);
VAStatus
(
*
vaEndPicture
)
(
VADriverContextP
ctx
,
VAContext
*
context
VAContext
ID
context
);
VAStatus
(
*
vaSyncSurface
)
(
VADriverContextP
ctx
,
VAContext
*
context
,
VASurface
*
render_target
VAContext
ID
context
,
VASurface
ID
render_target
);
VAStatus
(
*
vaQuerySurfaceStatus
)
(
VADriverContextP
ctx
,
VAContext
*
context
,
VASurface
*
render_target
,
VASurfaceID
render_target
,
VASurfaceStatus
*
status
/* out */
);
VAStatus
(
*
vaPutSurface
)
(
VADriverContextP
ctx
,
VASurface
*
surface
,
VASurface
ID
surface
,
Drawable
draw
,
/* X Drawable */
short
srcx
,
short
srcy
,
...
...
@@ -230,23 +215,34 @@ struct VADriverContext
VAStatus
(
*
vaDestroyImage
)
(
VADriverContextP
ctx
,
VAImage
*
image
VAImage
ID
image
);
VAStatus
(
*
vaSetImagePalette
)
(
VADriverContextP
ctx
,
VAImageID
image
,
/*
* pointer to an array holding the palette data. The size of the array is
* num_palette_entries * entry_bytes in size. The order of the components
* in the palette is described by the component_order in VAImage struct
*/
unsigned
char
*
palette
);
VAStatus
(
*
vaGetImage
)
(
VADriverContextP
ctx
,
VASurface
*
surface
,
VASurface
ID
surface
,
int
x
,
/* coordinates of the upper left source pixel */
int
y
,
unsigned
int
width
,
/* width and height of the region */
unsigned
int
height
,
VAImage
*
image
VAImage
ID
image
);
VAStatus
(
*
vaPutImage
)
(
VADriverContextP
ctx
,
VASurface
*
surface
,
VAImage
*
image
,
VASurface
ID
surface
,
VAImage
ID
image
,
int
src_x
,
int
src_y
,
unsigned
int
width
,
...
...
@@ -264,24 +260,24 @@ struct VADriverContext
VAStatus
(
*
vaCreateSubpicture
)
(
VADriverContextP
ctx
,
VAImage
*
image
,
VASubpicture
*
subpicture
/* out */
VAImage
ID
image
,
VASubpicture
ID
*
subpicture
/* out */
);
VAStatus
(
*
vaDestroySubpicture
)
(
VADriverContextP
ctx
,
VASubpicture
*
subpicture
VASubpicture
ID
subpicture
);
VAStatus
(
*
vaSetSubpictureImage
)
(
VADriverContextP
ctx
,
VASubpicture
*
subpicture
,
VAImage
*
image
VASubpicture
ID
subpicture
,
VAImage
ID
image
);
VAStatus
(
*
vaSetSubpicturePalette
)
(
VADriverContextP
ctx
,
VASubpicture
*
subpicture
,
VASubpicture
ID
subpicture
,
/*
* pointer to an array holding the palette data. The size of the array is
* num_palette_entries * entry_bytes in size. The order of the components
...
...
@@ -292,21 +288,23 @@ struct VADriverContext
VAStatus
(
*
vaSetSubpictureChromakey
)
(
VADriverContextP
ctx
,
VASubpicture
*
subpicture
,
VASubpicture
ID
subpicture
,
unsigned
int
chromakey_min
,
unsigned
int
chromakey_max
unsigned
int
chromakey_max
,
unsigned
int
chromakey_mask
);
VAStatus
(
*
vaSetSubpictureGlobalAlpha
)
(
VADriverContextP
ctx
,
VASubpicture
*
subpicture
,
VASubpicture
ID
subpicture
,
float
global_alpha
);
VAStatus
(
*
vaAssociateSubpicture
)
(
VADriverContextP
ctx
,
VASurface
*
target_surface
,
VASubpicture
*
subpicture
,
VASubpictureID
subpicture
,
VASurfaceID
*
target_surfaces
,
int
num_surfaces
,
short
src_x
,
/* upper left offset in subpicture */
short
src_y
,
short
dest_x
,
/* upper left offset in surface */
...
...
@@ -320,6 +318,13 @@ struct VADriverContext
unsigned
int
flags
);
VAStatus
(
*
vaDeassociateSubpicture
)
(
VADriverContextP
ctx
,
VASubpictureID
subpicture
,
VASurfaceID
*
target_surfaces
,
int
num_surfaces
);
VAStatus
(
*
vaQueryDisplayAttributes
)
(
VADriverContextP
ctx
,
VADisplayAttribute
*
attr_list
,
/* out */
...
...
@@ -341,12 +346,33 @@ struct VADriverContext
VAStatus
(
*
vaDbgCopySurfaceToBuffer
)
(
VADriverContextP
ctx
,
VASurface
*
surface
,
VASurface
ID
surface
,
void
**
buffer
,
/* out */
unsigned
int
*
stride
/* out */
);
};
struct
VADriverContext
{
VADriverContextP
pNext
;
void
*
pDriverData
;
struct
VADriverVTable
vtable
;
Display
*
x11_dpy
;
int
x11_screen
;
}
vtable
;
int
version_major
;
int
version_minor
;
int
max_profiles
;
int
max_entrypoints
;
int
max_attributes
;
int
max_image_formats
;
int
max_subpic_formats
;
int
max_display_attributes
;
const
char
*
str_vendor
;
void
*
handle
;
/* dlopen handle */
};
typedef
VAStatus
(
*
VADriverInit
)
(
...
...
src/va_x11.h
View file @
4a9db082
...
...
@@ -36,9 +36,16 @@ extern "C" {
#define VA_TOP_FIELD 0x00000001
#define VA_BOTTOM_FIELD 0x00000002
#define VA_FRAME_PICTURE 0x00000004
/* weave */
/*
* clears the drawable with background color.
* for hardware overlay based implementation this flag
* can be used to turn off the overlay
*/
#define VA_CLEAR_DRAWABLE 0x00000008
VAStatus
vaPutSurface
(
VADisplay
dpy
,
VASurface
*
surface
,
VASurface
ID
surface
,
Drawable
draw
,
/* X Drawable */
short
srcx
,
short
srcy
,
...
...
test/test.c
View file @
4a9db082
...
...
@@ -53,23 +53,23 @@ int main(int argc, const char* argv[])
printf
(
"vaInitialize: major = %d minor = %d
\n
"
,
major_version
,
minor_version
);
{
VASurface
surfaces
[
21
];
VASurface
ID
surfaces
[
21
];
int
i
;
surfaces
[
20
]
.
surface_id
=
-
1
;
surfaces
[
20
]
=
-
1
;
va_status
=
vaCreateSurfaces
(
va_dpy
,
720
,
480
,
VA_RT_FORMAT_YUV420
,
20
,
surfaces
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
ASSERT
(
-
1
==
surfaces
[
20
]
.
surface_id
);
/* bounds check */
ASSERT
(
-
1
==
surfaces
[
20
]
);
/* bounds check */
for
(
i
=
0
;
i
<
20
;
i
++
)
{
printf
(
"Surface %d surface_id = %08x
\n
"
,
i
,
surfaces
[
i
]
.
surface_id
);
printf
(
"Surface %d surface_id = %08x
\n
"
,
i
,
surfaces
[
i
]);
}
Window
win
=
XCreateSimpleWindow
(
dpy
,
RootWindow
(
dpy
,
0
),
0
,
0
,
720
,
480
,
0
,
0
,
WhitePixel
(
dpy
,
0
));
printf
(
"Window = %08x
\n
"
,
win
);
XMapWindow
(
dpy
,
win
);
XSync
(
dpy
,
False
);
vaPutSurface
(
va_dpy
,
&
(
surfaces
[
0
])
,
win
,
0
,
0
,
720
,
480
,
0
,
0
,
720
,
480
,
0
);
vaPutSurface
(
va_dpy
,
surfaces
[
0
]
,
win
,
0
,
0
,
720
,
480
,
0
,
0
,
720
,
480
,
0
);
sleep
(
10
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces
,
20
);
...
...
@@ -94,14 +94,14 @@ int main(int argc, const char* argv[])
}
{
VASurface
surfaces
[
20
];
VAContext
context
;
VASurface
ID
surfaces
[
20
];
VAContext
ID
context
;
VAConfigAttrib
attrib
;
VAConfigID
config_id
;
int
i
;
attrib
.
type
=
VAConfigAttribRTFormat
;
va_status
=
va
Query
ConfigAttributes
(
va_dpy
,
VAProfileMPEG2Main
,
VAEntrypointVLD
,
va_status
=
va
Get
ConfigAttributes
(
va_dpy
,
VAProfileMPEG2Main
,
VAEntrypointVLD
,
&
attrib
,
1
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
...
...
@@ -118,7 +118,7 @@ int main(int argc, const char* argv[])
va_status
=
vaCreateContext
(
va_dpy
,
config_id
,
720
,
480
,
0
/* flag */
,
surfaces
,
20
,
&
context
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
va_status
=
vaDestroyContext
(
va_dpy
,
&
context
);
va_status
=
vaDestroyContext
(
va_dpy
,
context
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces
,
20
);
...
...
test/test_07.c
View file @
4a9db082
...
...
@@ -33,7 +33,7 @@ void pre()
#define DEAD_SURFACE_ID (VASurfaceID) 0xbeefdead
void
test_unique_surfaces
(
VASurface
*
surface_list1
,
int
surface_count1
,
VASurface
*
surface_list2
,
int
surface_count2
)
void
test_unique_surfaces
(
VASurface
ID
*
surface_list1
,
int
surface_count1
,
VASurfaceID
*
surface_list2
,
int
surface_count2
)
{
int
i
,
j
;
...
...
@@ -42,9 +42,9 @@ void test_unique_surfaces(VASurface *surface_list1, int surface_count1, VASurfac
for
(
j
=
0
;
j
<
surface_count2
;
j
++
)
{
if
((
surface_list1
==
surface_list2
)
&&
(
i
==
j
))
continue
;
ASSERT
(
surface_list1
[
i
]
.
surface_id
!=
VA_INVALID_SURFACE
);
ASSERT
(
surface_list2
[
j
]
.
surface_id
!=
VA_INVALID_SURFACE
);
ASSERT
(
surface_list1
[
i
]
.
surface_id
!=
surface_list2
[
j
].
surface_id
);
ASSERT
(
surface_list1
[
i
]
!=
VA_INVALID_SURFACE
);
ASSERT
(
surface_list2
[
j
]
!=
VA_INVALID_SURFACE
);
ASSERT
(
surface_list1
[
i
]
!=
surface_list2
[
j
]
);
}
}
}
...
...
@@ -52,10 +52,10 @@ void test_unique_surfaces(VASurface *surface_list1, int surface_count1, VASurfac
void
test
()
{
VASurface
surfaces_1
[
1
+
1
];
VASurface
surfaces_4
[
4
+
1
];
VASurface
surfaces_16
[
16
+
1
];
VASurface
surfaces_6
[
6
+
1
];
VASurface
ID
surfaces_1
[
1
+
1
];
VASurface
ID
surfaces_4
[
4
+
1
];
VASurface
ID
surfaces_16
[
16
+
1
];
VASurface
ID
surfaces_6
[
6
+
1
];
memset
(
surfaces_1
,
0xff
,
sizeof
(
surfaces_1
));
memset
(
surfaces_4
,
0xff
,
sizeof
(
surfaces_4
));
...
...
@@ -63,22 +63,22 @@ void test()
memset
(
surfaces_6
,
0xff
,
sizeof
(
surfaces_6
));
status
(
"vaCreateSurfaces 1 surface
\n
"
);
surfaces_1
[
1
]
.
surface_id
=
DEAD_SURFACE_ID
;
surfaces_1
[
1
]
=
DEAD_SURFACE_ID
;
va_status
=
vaCreateSurfaces
(
va_dpy
,
352
,
288
,
VA_RT_FORMAT_YUV420
,
1
,
surfaces_1
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_1
[
1
]
.
surface_id
);
/* bounds check */
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_1
[
1
]
);
/* bounds check */
status
(
"vaCreateSurfaces 4 surfaces
\n
"
);
surfaces_4
[
4
]
.
surface_id
=
DEAD_SURFACE_ID
;
surfaces_4
[
4
]
=
DEAD_SURFACE_ID
;
va_status
=
vaCreateSurfaces
(
va_dpy
,
352
,
288
,
VA_RT_FORMAT_YUV420
,
4
,
surfaces_4
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_4
[
4
]
.
surface_id
);
/* bounds check */
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_4
[
4
]
);
/* bounds check */
status
(
"vaCreateSurfaces 16 surfaces
\n
"
);
surfaces_16
[
16
]
.
surface_id
=
DEAD_SURFACE_ID
;
surfaces_16
[
16
]
=
DEAD_SURFACE_ID
;
va_status
=
vaCreateSurfaces
(
va_dpy
,
352
,
288
,
VA_RT_FORMAT_YUV420
,
16
,
surfaces_16
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_16
[
16
]
.
surface_id
);
/* bounds check */
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_16
[
16
]
);
/* bounds check */
test_unique_surfaces
(
surfaces_1
,
1
,
surfaces_4
,
4
);
test_unique_surfaces
(
surfaces_4
,
4
,
surfaces_16
,
4
);
...
...
@@ -87,29 +87,29 @@ void test()
test_unique_surfaces
(
surfaces_1
,
16
,
surfaces_16
,
16
);
status
(
"vaDestroySurface 4 surfaces
\n
"
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces_4
,
4
);
va_status
=
vaDestroySurface
s
(
va_dpy
,
surfaces_4
,
4
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
status
(
"vaCreateSurfaces 6 surfaces
\n
"
);
surfaces_6
[
6
]
.
surface_id
=
DEAD_SURFACE_ID
;
surfaces_6
[
6
]
=
DEAD_SURFACE_ID
;
va_status
=
vaCreateSurfaces
(
va_dpy
,
352
,
288
,
VA_RT_FORMAT_YUV420
,
6
,
surfaces_6
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_6
[
6
]
.
surface_id
);
/* bounds check */
ASSERT
(
DEAD_SURFACE_ID
==
surfaces_6
[
6
]
);
/* bounds check */
test_unique_surfaces
(
surfaces_1
,
1
,
surfaces_6
,
6
);
test_unique_surfaces
(
surfaces_6
,
6
,
surfaces_16
,
16
);
test_unique_surfaces
(
surfaces_1
,
6
,
surfaces_16
,
6
);
status
(
"vaDestroySurface 16 surfaces
\n
"
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces_16
,
16
);
va_status
=
vaDestroySurface
s
(
va_dpy
,
surfaces_16
,
16
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
status
(
"vaDestroySurface 1 surface
\n
"
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces_1
,
1
);
va_status
=
vaDestroySurface
s
(
va_dpy
,
surfaces_1
,
1
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
status
(
"vaDestroySurface 6 surfaces
\n
"
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces_6
,
6
);
va_status
=
vaDestroySurface
s
(
va_dpy
,
surfaces_6
,
6
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
}
...
...
test/test_08.c
View file @
4a9db082
...
...
@@ -33,17 +33,17 @@ void pre()
#define DEAD_SURFACE_ID (VASurfaceID) 0xbeefdead
void
test_unique_surfaces
(
VASurface
*
surface_list
,
int
surface_count
)
void
test_unique_surfaces
(
VASurface
ID
*
surface_list
,
int
surface_count
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
surface_count
;
i
++
)
{
ASSERT
(
surface_list
[
i
]
.
surface_id
!=
VA_INVALID_SURFACE
);
ASSERT
(
surface_list
[
i
]
!=
VA_INVALID_SURFACE
);
for
(
j
=
0
;
j
<
i
;
j
++
)
{
if
(
i
==
j
)
continue
;
ASSERT
(
surface_list
[
i
]
.
surface_id
!=
surface_list
[
j
].
surface_id
);
ASSERT
(
surface_list
[
i
]
!=
surface_list
[
j
]
);
}
}
}
...
...
@@ -65,7 +65,7 @@ test_size_t test_sizes[] = {
void
test
()
{
VASurface
surfaces
[
NUM_SIZES
+
1
];
VASurface
ID
surfaces
[
NUM_SIZES
+
1
];
int
i
;
memset
(
surfaces
,
0xff
,
sizeof
(
surfaces
));
...
...
@@ -73,16 +73,16 @@ void test()
for
(
i
=
0
;
i
<
NUM_SIZES
;
i
++
)
{
status
(
"vaCreateSurfaces create %dx%d surface
\n
"
,
test_sizes
[
i
].
w
,
test_sizes
[
i
].
h
);
surfaces
[
i
+
1
]
.
surface_id
=
DEAD_SURFACE_ID
;
surfaces
[
i
+
1
]
=
DEAD_SURFACE_ID
;
va_status
=
vaCreateSurfaces
(
va_dpy
,
test_sizes
[
i
].
w
,
test_sizes
[
i
].
h
,
VA_RT_FORMAT_YUV420
,
1
,
&
surfaces
[
i
]);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
ASSERT
(
DEAD_SURFACE_ID
==
surfaces
[
i
+
1
]
.
surface_id
);
ASSERT
(
DEAD_SURFACE_ID
==
surfaces
[
i
+
1
]
);
}
test_unique_surfaces
(
surfaces
,
NUM_SIZES
);
status
(
"vaDestroySurface all surfaces
\n
"
);
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces
,
NUM_SIZES
);
va_status
=
vaDestroySurface
s
(
va_dpy
,
surfaces
,
NUM_SIZES
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
}
...
...
test/test_09.c
View file @
4a9db082
...
...
@@ -44,7 +44,7 @@ void test()
ASSERT
(
entrypoints
);
VAConfigID
*
configs
=
malloc
(
max_entrypoints
*
num_profiles
*
sizeof
(
VAConfigID
));
VAContext
*
contexts
=
malloc
(
max_entrypoints
*
num_profiles
*
sizeof
(
VAContext
));
VAContext
ID
*
contexts
=
malloc
(
max_entrypoints
*
num_profiles
*
sizeof
(
VAContextID
));
for
(
i
=
0
;
i
<
num_profiles
;
i
++
)
{
...
...
@@ -66,7 +66,7 @@ void test()
int
surface_count
=
4
;
int
total_surfaces
=
config_count
*
surface_count
;
VASurface
*
surfaces
=
malloc
(
total_surfaces
*
sizeof
(
VASurface
));
VASurface
ID
*
surfaces
=
malloc
(
total_surfaces
*
sizeof
(
VASurfaceID
));
// TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config
va_status
=
vaCreateSurfaces
(
va_dpy
,
width
,
height
,
VA_RT_FORMAT_YUV420
,
total_surfaces
,
surfaces
);
...
...
@@ -82,8 +82,8 @@ void test()
for
(
i
=
0
;
i
<
config_count
;
i
++
)
{
status
(
"vaDestroyContext for context %08x
\n
"
,
contexts
[
i
]
.
context_id
);
va_status
=
vaDestroyContext
(
va_dpy
,
&
contexts
[
i
]
);
status
(
"vaDestroyContext for context %08x
\n
"
,
contexts
[
i
]);
va_status
=
vaDestroyContext
(
va_dpy
,
contexts
[
i
]
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
}
...
...
@@ -94,7 +94,7 @@ void test()
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
}
va_status
=
vaDestroySurface
(
va_dpy
,
surfaces
,
total_surfaces
);
va_status
=
vaDestroySurface
s
(
va_dpy
,
surfaces
,
total_surfaces
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
free
(
contexts
);
...
...
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