mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
tests: add support for global-alpha subpictures.
Add --global-alpha option to test-subpicture.
This commit is contained in:
parent
cbf2f27168
commit
bfc4e6e4f6
1 changed files with 11 additions and 0 deletions
|
@ -34,12 +34,17 @@ static inline void pause(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *g_codec_str;
|
static gchar *g_codec_str;
|
||||||
|
static gdouble g_global_alpha = 1.0;
|
||||||
|
|
||||||
static GOptionEntry g_options[] = {
|
static GOptionEntry g_options[] = {
|
||||||
{ "codec", 'c',
|
{ "codec", 'c',
|
||||||
0,
|
0,
|
||||||
G_OPTION_ARG_STRING, &g_codec_str,
|
G_OPTION_ARG_STRING, &g_codec_str,
|
||||||
"codec to test", NULL },
|
"codec to test", NULL },
|
||||||
|
{ "global-alpha", 'g',
|
||||||
|
0,
|
||||||
|
G_OPTION_ARG_DOUBLE, &g_global_alpha,
|
||||||
|
"global-alpha value", NULL },
|
||||||
{ NULL, }
|
{ NULL, }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,6 +82,9 @@ main(int argc, char *argv[])
|
||||||
if (!video_output_init(&argc, argv, g_options))
|
if (!video_output_init(&argc, argv, g_options))
|
||||||
g_error("failed to initialize video output subsystem");
|
g_error("failed to initialize video output subsystem");
|
||||||
|
|
||||||
|
if (g_global_alpha != 1.0)
|
||||||
|
flags |= GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA;
|
||||||
|
|
||||||
g_print("Test subpicture\n");
|
g_print("Test subpicture\n");
|
||||||
|
|
||||||
display = video_output_create_display(NULL);
|
display = video_output_create_display(NULL);
|
||||||
|
@ -115,6 +123,9 @@ main(int argc, char *argv[])
|
||||||
g_error("could not create video overlay");
|
g_error("could not create video overlay");
|
||||||
gst_buffer_unref(buffer);
|
gst_buffer_unref(buffer);
|
||||||
|
|
||||||
|
if (flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA)
|
||||||
|
gst_video_overlay_rectangle_set_global_alpha(overlay, g_global_alpha);
|
||||||
|
|
||||||
compo = gst_video_overlay_composition_new(overlay);
|
compo = gst_video_overlay_composition_new(overlay);
|
||||||
if (!compo)
|
if (!compo)
|
||||||
g_error("could not create video overlay composition");
|
g_error("could not create video overlay composition");
|
||||||
|
|
Loading…
Reference in a new issue