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
a0c4efd2
Commit
a0c4efd2
authored
Sep 25, 2007
by
Waldo Bastian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests
parent
d41a2e44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
227 additions
and
1 deletion
+227
-1
test/Makefile.am
test/Makefile.am
+7
-1
test/test_10.c
test/test_10.c
+89
-0
test/test_11.c
test/test_11.c
+130
-0
test/test_common.c
test/test_common.c
+1
-0
No files found.
test/Makefile.am
View file @
a0c4efd2
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
check_PROGRAMS
=
test_01 test_02 test_03 test_04 test_05 test_06
\
check_PROGRAMS
=
test_01 test_02 test_03 test_04 test_05 test_06
\
test_07 test_08 test_09
test_07 test_08 test_09
test_10 test_11
testdir
=
$(bindir)
testdir
=
$(bindir)
...
@@ -58,6 +58,12 @@ test_08_SOURCES = test_08.c
...
@@ -58,6 +58,12 @@ test_08_SOURCES = test_08.c
test_09_LDADD
=
$(TEST_LIBS)
test_09_LDADD
=
$(TEST_LIBS)
test_09_SOURCES
=
test_09.c
test_09_SOURCES
=
test_09.c
test_10_LDADD
=
$(TEST_LIBS)
test_10_SOURCES
=
test_10.c
test_11_LDADD
=
$(TEST_LIBS)
test_11_SOURCES
=
test_11.c
valgrind
:
$(check_PROGRAMS)
valgrind
:
$(check_PROGRAMS)
for
a
in
$(check_PROGRAMS)
;
do
\
for
a
in
$(check_PROGRAMS)
;
do
\
...
...
test/test_10.c
0 → 100644
View file @
a0c4efd2
/*
* Copyright (c) 2007 Intel Corporation. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* 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.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define TEST_DESCRIPTION "Create and destroy buffers"
#include "test_common.c"
void
pre
()
{
test_init
();
}
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
++
)
{
ASSERT
(
buffer_list
[
i
]
!=
buffer_list
[
j
]);
}
}
}
VABufferType
buffer_types
[]
=
{
VAPictureParameterBufferType
,
VAIQMatrixBufferType
,
VABitPlaneBufferType
,
VASliceGroupMapBufferType
,
VASliceParameterBufferType
,
VASliceDataBufferType
,
VAMacroblockParameterBufferType
,
VAResidualDataBufferType
,
VADeblockingParameterBufferType
,
VAImageBufferType
};
#define NUM_BUFFER_TYPES (sizeof(buffer_types) / sizeof(VABufferType))
#define DEAD_BUFFER_ID ((VABufferID) 0x1234ffff)
void
test
()
{
VABufferID
buffer_ids
[
NUM_BUFFER_TYPES
+
1
];
int
i
;
memset
(
buffer_ids
,
0xff
,
sizeof
(
buffer_ids
));
for
(
i
=
0
;
i
<
NUM_BUFFER_TYPES
;
i
++
)
{
buffer_ids
[
i
+
1
]
=
DEAD_BUFFER_ID
;
va_status
=
vaCreateBuffer
(
va_dpy
,
buffer_types
[
i
],
&
buffer_ids
[
i
]);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
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
]);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
}
}
void
post
()
{
test_terminate
();
}
test/test_11.c
0 → 100644
View file @
a0c4efd2
/*
* Copyright (c) 2007 Intel Corporation. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* 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.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define TEST_DESCRIPTION "Map and unmap buffers"
#include "test_common.c"
void
pre
()
{
test_init
();
}
VABufferType
buffer_types
[]
=
{
VAPictureParameterBufferType
,
VAIQMatrixBufferType
,
VABitPlaneBufferType
,
VASliceGroupMapBufferType
,
VASliceParameterBufferType
,
VASliceDataBufferType
,
VAMacroblockParameterBufferType
,
VAResidualDataBufferType
,
VADeblockingParameterBufferType
,
VAImageBufferType
};
unsigned
int
buffer_sizes
[]
=
{
sizeof
(
VAPictureParameterBufferMPEG4
),
sizeof
(
VAIQMatrixBufferH264
),
32
*
1024
,
48
*
1024
,
sizeof
(
VASliceParameterBufferMPEG2
),
128
*
1024
,
sizeof
(
VAMacroblockParameterBufferMPEG2
),
32
*
1024
,
15
*
1024
,
32
*
1024
,
};
#define NUM_BUFFER_TYPES (sizeof(buffer_types) / sizeof(VABufferType))
void
test
()
{
VABufferID
buffer_ids
[
NUM_BUFFER_TYPES
+
1
];
uint32_t
*
input_data
[
NUM_BUFFER_TYPES
];
int
i
,
j
;
memset
(
buffer_ids
,
0xff
,
sizeof
(
buffer_ids
));
for
(
i
=
0
;
i
<
NUM_BUFFER_TYPES
;
i
++
)
{
uint32_t
*
data
;
va_status
=
vaCreateBuffer
(
va_dpy
,
buffer_types
[
i
],
&
buffer_ids
[
i
]);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
status
(
"vaCreateBuffer created buffer %08x of type %d
\n
"
,
buffer_ids
[
i
],
buffer_types
[
i
]);
input_data
[
i
]
=
malloc
(
buffer_sizes
[
i
]
+
4
);
ASSERT
(
input_data
[
i
]);
/* Generate input data */
for
(
j
=
buffer_sizes
[
i
]
/
4
;
j
--
;)
{
input_data
[
i
][
j
]
=
random
();
}
/* Copy to secondary buffer */
data
=
malloc
(
buffer_sizes
[
i
]);
ASSERT
(
data
);
memcpy
(
data
,
input_data
[
i
],
buffer_sizes
[
i
]);
/* Send to VA Buffer */
va_status
=
vaBufferData
(
va_dpy
,
buffer_ids
[
i
],
buffer_sizes
[
i
],
1
,
data
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
/* Wipe secondary buffer */
memset
(
data
,
0
,
buffer_sizes
[
i
]);
free
(
data
);
}
for
(
i
=
0
;
i
<
NUM_BUFFER_TYPES
;
i
++
)
{
void
*
data
=
NULL
;
/* Fetch VA Buffer */
va_status
=
vaBufferData
(
va_dpy
,
buffer_ids
[
i
],
buffer_sizes
[
i
],
1
,
NULL
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
va_status
=
vaMapBuffer
(
va_dpy
,
buffer_ids
[
i
],
&
data
);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
status
(
"vaMapBuffer mapped buffer %08x
\n
"
,
buffer_ids
[
i
]);
/* Compare data */
ASSERT
(
memcmp
(
input_data
[
i
],
data
,
buffer_sizes
[
i
])
==
0
);
}
for
(
i
=
0
;
i
<
NUM_BUFFER_TYPES
;
i
++
)
{
va_status
=
vaUnmapBuffer
(
va_dpy
,
buffer_ids
[
i
]);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
va_status
=
vaDestroyBuffer
(
va_dpy
,
buffer_ids
[
i
]);
ASSERT
(
VA_STATUS_SUCCESS
==
va_status
);
free
(
input_data
[
i
]);
}
}
void
post
()
{
test_terminate
();
}
test/test_common.c
View file @
a0c4efd2
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <stdint.h>
#include <dlfcn.h>
#include <dlfcn.h>
#define ASSERT assert
#define ASSERT assert
...
...
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