diff options
author | Seungha Yang <seungha@centricular.com> | 2020-09-18 01:41:35 +0900 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-09-18 14:47:21 +0000 |
commit | ea24a2e5279c7920ee925ef774e081a03c1650fc (patch) | |
tree | fb3fba74fa539f9e784d8c14f9b5b41123acd11a /tests/check/elements | |
parent | 63f06d16db1a972d8dcb6bb40653fbecc878dadc (diff) | |
download | gstreamer-plugins-bad-ea24a2e5279c7920ee925ef774e081a03c1650fc.tar.gz |
d3d11: Add support for packed 8bits 4:2:2 YUV formats
Note that newly added formats (YUY2, UYVY, and VYUY) are not supported
render target view formats. So such formats can be only input of d3d11convert
or d3d11videosink. Another note is that YUY2 format is a very common
format for hardware en/decoders on Windows.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1581>
Diffstat (limited to 'tests/check/elements')
-rw-r--r-- | tests/check/elements/d3d11colorconvert.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/tests/check/elements/d3d11colorconvert.c b/tests/check/elements/d3d11colorconvert.c index 67a831dc8..5665dcff1 100644 --- a/tests/check/elements/d3d11colorconvert.c +++ b/tests/check/elements/d3d11colorconvert.c @@ -53,7 +53,7 @@ static TestFrame test_rgba_reorder[] = { GST_START_TEST (test_d3d11_color_convert_rgba_reorder) { GstHarness *h = - gst_harness_new_parse ("d3d11upload ! d3d11colorconvert ! d3d11download"); + gst_harness_new_parse ("d3d11upload ! d3d11convert ! d3d11download"); gint i, j, k; for (i = 0; i < G_N_ELEMENTS (test_rgba_reorder); i++) { @@ -139,7 +139,7 @@ run_convert_pipelne (const gchar * in_format, const gchar * out_format) gchar *pipeline_str = g_strdup_printf ("videotestsrc num-buffers=1 is-live=true ! " "video/x-raw,format=%s,framerate=3/1 ! d3d11upload ! " - "d3d11colorconvert ! d3d11download ! video/x-raw,format=%s ! " + "d3d11convert ! d3d11download ! video/x-raw,format=%s ! " "videoconvert ! d3d11videosink", in_format, out_format); GstElement *pipeline; @@ -249,6 +249,50 @@ GST_START_TEST (test_d3d11_color_convert_rgb_rgb) } GST_END_TEST; + +GST_START_TEST (test_d3d11_color_convert_packed_yuv_yuv) +{ + const gchar *in_format_list[] = { + "YUY2", "UYVY", "VYUY", + }; + const gchar *out_format_list[] = { + "VUYA", "NV12", "P010_10LE", "P016_LE", "I420", "I420_10LE" + }; + + gint i, j; + + for (i = 0; i < G_N_ELEMENTS (in_format_list); i++) { + for (j = 0; j < G_N_ELEMENTS (out_format_list); j++) { + GST_DEBUG ("run conversion %s to %s", in_format_list[i], + out_format_list[j]); + run_convert_pipelne (in_format_list[i], out_format_list[j]); + } + } +} + +GST_END_TEST; + +GST_START_TEST (test_d3d11_color_convert_packed_yuv_rgb) +{ + const gchar *in_format_list[] = { + "YUY2", "UYVY", "VYUY", + }; + const gchar *out_format_list[] = { + "BGRA", "RGBA", "RGB10A2_LE", + }; + + gint i, j; + + for (i = 0; i < G_N_ELEMENTS (in_format_list); i++) { + for (j = 0; j < G_N_ELEMENTS (out_format_list); j++) { + GST_DEBUG ("run conversion %s to %s", in_format_list[i], + out_format_list[j]); + run_convert_pipelne (in_format_list[i], out_format_list[j]); + } + } +} + +GST_END_TEST; #endif /* RUN_VISUAL_TEST */ static Suite * @@ -264,6 +308,8 @@ d3d11colorconvert_suite (void) tcase_add_test (tc_basic, test_d3d11_color_convert_yuv_rgb); tcase_add_test (tc_basic, test_d3d11_color_convert_rgb_yuv); tcase_add_test (tc_basic, test_d3d11_color_convert_rgb_rgb); + tcase_add_test (tc_basic, test_d3d11_color_convert_packed_yuv_yuv); + tcase_add_test (tc_basic, test_d3d11_color_convert_packed_yuv_rgb); #endif return s; |