Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gstreamer-vaapi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
140
Issues
140
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GStreamer
gstreamer-vaapi
Commits
cb92e7ca
Commit
cb92e7ca
authored
Jul 09, 2013
by
Gwenole Beauchesne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: port to new video format API.
parent
09397fa0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
25 deletions
+25
-25
tests/image.c
tests/image.c
+6
-6
tests/image.h
tests/image.h
+1
-1
tests/test-display.c
tests/test-display.c
+5
-5
tests/test-textures.c
tests/test-textures.c
+1
-1
tests/test-windows.c
tests/test-windows.c
+12
-12
No files found.
tests/image.c
View file @
cb92e7ca
...
...
@@ -24,7 +24,7 @@
GstVaapiImage
*
image_generate
(
GstVaapiDisplay
*
display
,
GstV
aapiImageFormat
format
,
GstV
ideoFormat
format
,
guint
width
,
guint
height
)
...
...
@@ -257,7 +257,7 @@ image_draw_rectangle(
guint32
color
)
{
const
GstV
aapiImageFormat
image_format
=
gst_vaapi_image_get_format
(
image
);
const
GstV
ideoFormat
image_format
=
gst_vaapi_image_get_format
(
image
);
const
guint
image_width
=
gst_vaapi_image_get_width
(
image
);
const
guint
image_height
=
gst_vaapi_image_get_height
(
image
);
GstVaapiDisplay
*
display
;
...
...
@@ -267,11 +267,11 @@ image_draw_rectangle(
guint
i
;
static
const
struct
{
GstV
aapiImageFormat
format
;
GstV
ideoFormat
format
;
DrawRectFunc
draw_rect
;
}
map
[]
=
{
#define _(FORMAT) { GST_V
AAPI_IMAGE
_##FORMAT, draw_rect_##FORMAT }
#define _(FORMAT) { GST_V
IDEO_FORMAT
_##FORMAT, draw_rect_##FORMAT }
_
(
ARGB
),
_
(
BGRA
),
_
(
RGBA
),
...
...
@@ -302,7 +302,7 @@ image_draw_rectangle(
stride
[
i
]
=
gst_vaapi_image_get_pitch
(
image
,
i
);
}
if
(
gst_v
aapi_image
_format_is_yuv
(
image_format
))
if
(
gst_v
ideo
_format_is_yuv
(
image_format
))
color
=
argb2yuv
(
color
);
if
(
x
<
0
)
...
...
@@ -324,7 +324,7 @@ gboolean
image_upload
(
GstVaapiImage
*
image
,
GstVaapiSurface
*
surface
)
{
GstVaapiDisplay
*
display
;
GstV
aapiImageFormat
format
;
GstV
ideoFormat
format
;
GstVaapiSubpicture
*
subpicture
;
display
=
gst_vaapi_object_get_display
(
GST_VAAPI_OBJECT
(
surface
));
...
...
tests/image.h
View file @
cb92e7ca
...
...
@@ -28,7 +28,7 @@
GstVaapiImage
*
image_generate
(
GstVaapiDisplay
*
display
,
GstV
aapiImageFormat
format
,
GstV
ideoFormat
format
,
guint
width
,
guint
height
);
...
...
tests/test-display.c
View file @
cb92e7ca
...
...
@@ -126,22 +126,22 @@ print_format_caps(GstCaps *caps, const gchar *name)
for
(
i
=
0
;
i
<
gst_caps_get_size
(
caps
);
i
++
)
{
GstStructure
*
const
structure
=
gst_caps_get_structure
(
caps
,
i
);
const
VAImageFormat
*
va_format
;
GstV
aapiImage
Format
format
;
GstV
ideo
Format
format
;
if
(
!
structure
)
g_error
(
"could not get caps structure %d"
,
i
);
g_print
(
" %s:"
,
gst_structure_get_name
(
structure
));
format
=
gst_v
aapi_image
_format_from_structure
(
structure
);
if
(
!
format
)
format
=
gst_v
ideo
_format_from_structure
(
structure
);
if
(
format
==
GST_VIDEO_FORMAT_UNKNOWN
)
g_error
(
"could not determine format"
);
va_format
=
gst_v
aapi_image_format_get
_va_format
(
format
);
va_format
=
gst_v
ideo_format_to
_va_format
(
format
);
if
(
!
va_format
)
g_error
(
"could not determine VA format"
);
if
(
gst_v
aapi_image
_format_is_yuv
(
format
))
if
(
gst_v
ideo
_format_is_yuv
(
format
))
print_format_caps_yuv
(
va_format
);
else
print_format_caps_rgb
(
va_format
);
...
...
tests/test-textures.c
View file @
cb92e7ca
...
...
@@ -71,7 +71,7 @@ main(int argc, char *argv[])
if
(
!
surface
)
g_error
(
"could not create VA surface"
);
image
=
image_generate
(
display
,
GST_V
AAPI_IMAGE
_NV12
,
width
,
height
);
image
=
image_generate
(
display
,
GST_V
IDEO_FORMAT
_NV12
,
width
,
height
);
if
(
!
image
)
g_error
(
"could not create VA image"
);
if
(
!
image_upload
(
image
,
surface
))
...
...
tests/test-windows.c
View file @
cb92e7ca
...
...
@@ -52,24 +52,24 @@ create_test_surface(GstVaapiDisplay *display, guint width, guint height)
guint
i
;
static
const
GstVaapiChromaType
chroma_type
=
GST_VAAPI_CHROMA_TYPE_YUV420
;
static
const
GstV
aapiImage
Format
image_formats
[]
=
{
GST_V
AAPI_IMAGE
_NV12
,
GST_V
AAPI_IMAGE
_YV12
,
GST_V
AAPI_IMAGE
_I420
,
GST_V
AAPI_IMAGE
_AYUV
,
GST_V
AAPI_IMAGE
_ARGB
,
GST_V
AAPI_IMAGE
_BGRA
,
GST_V
AAPI_IMAGE
_RGBA
,
GST_V
AAPI_IMAGE
_ABGR
,
0
static
const
GstV
ideo
Format
image_formats
[]
=
{
GST_V
IDEO_FORMAT
_NV12
,
GST_V
IDEO_FORMAT
_YV12
,
GST_V
IDEO_FORMAT
_I420
,
GST_V
IDEO_FORMAT
_AYUV
,
GST_V
IDEO_FORMAT
_ARGB
,
GST_V
IDEO_FORMAT
_BGRA
,
GST_V
IDEO_FORMAT
_RGBA
,
GST_V
IDEO_FORMAT
_ABGR
,
GST_VIDEO_FORMAT_UNKNOWN
};
surface
=
gst_vaapi_surface_new
(
display
,
chroma_type
,
width
,
height
);
if
(
!
surface
)
g_error
(
"could not create Gst/VA surface"
);
for
(
i
=
0
;
image_formats
[
i
];
i
++
)
{
const
GstV
aapiImage
Format
format
=
image_formats
[
i
];
for
(
i
=
0
;
image_formats
[
i
]
!=
GST_VIDEO_FORMAT_UNKNOWN
;
i
++
)
{
const
GstV
ideo
Format
format
=
image_formats
[
i
];
image
=
image_generate
(
display
,
format
,
width
,
height
);
if
(
!
image
)
...
...
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