libva: basic tests
git-svn-id: svn://kolibrios.org@5366 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
@@ -43,13 +43,13 @@ void pre()
|
||||
int height = 288;
|
||||
int surface_count = 4;
|
||||
total_surfaces = surface_count;
|
||||
|
||||
|
||||
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, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0);
|
||||
ASSERT( VA_STATUS_SUCCESS == va_status );
|
||||
|
||||
|
||||
status("vaCreateContext with config %08x\n", config);
|
||||
int flags = 0;
|
||||
va_status = vaCreateContext( va_dpy, config, width, height, flags, surfaces, surface_count, &context );
|
||||
@@ -59,7 +59,7 @@ void pre()
|
||||
void test_unique_buffers(VABufferID *buffer_list, int buffer_count)
|
||||
{
|
||||
int i,j;
|
||||
|
||||
|
||||
for(i = 0; i < buffer_count; i++)
|
||||
{
|
||||
for(j = 0; j < i; j++)
|
||||
@@ -84,7 +84,7 @@ VABufferType buffer_types[] =
|
||||
|
||||
unsigned int buffer_sizes[] =
|
||||
{
|
||||
sizeof(VAPictureParameterBufferMPEG4),
|
||||
sizeof(VAPictureParameterBufferMPEG4),
|
||||
sizeof(VAIQMatrixBufferH264),
|
||||
32*1024,
|
||||
48*1024,
|
||||
@@ -113,7 +113,7 @@ void test()
|
||||
ASSERT( DEAD_BUFFER_ID == buffer_ids[i+1] ); /* Bounds check */
|
||||
}
|
||||
test_unique_buffers(buffer_ids, NUM_BUFFER_TYPES);
|
||||
|
||||
|
||||
for(i=0; i < NUM_BUFFER_TYPES; i++)
|
||||
{
|
||||
va_status = vaDestroyBuffer(va_dpy, buffer_ids[i]);
|
||||
@@ -130,10 +130,10 @@ void post()
|
||||
status("vaDestroyConfig for config %08x\n", config);
|
||||
va_status = vaDestroyConfig( va_dpy, config );
|
||||
ASSERT( VA_STATUS_SUCCESS == va_status );
|
||||
|
||||
|
||||
va_status = vaDestroySurfaces(va_dpy, surfaces, total_surfaces);
|
||||
ASSERT( VA_STATUS_SUCCESS == va_status );
|
||||
|
||||
|
||||
free(surfaces);
|
||||
|
||||
test_terminate();
|
||||
|
Reference in New Issue
Block a user