diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c index 4ccabe17c3..5123466e1b 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c @@ -8264,3 +8264,35 @@ video_converter_lookup_fastpath (GstVideoConverter * convert) GST_DEBUG ("no fastpath found"); return FALSE; } + +/** + * gst_video_converter_get_in_info: + * @in_info: a #GstVideoConverter + * + * Retrieve the input format of @convert. + * + * Returns: (transfer none): a #GstVideoInfo + * + * Since: 1.22 + */ +const GstVideoInfo * +gst_video_converter_get_in_info (GstVideoConverter * convert) +{ + return &convert->in_info; +} + +/** + * gst_video_converter_get_out_info: + * @in_info: a #GstVideoConverter + * + * Retrieve the output format of @convert. + * + * Returns: (transfer none): a #GstVideoInfo + * + * Since: 1.22 + */ +const GstVideoInfo * +gst_video_converter_get_out_info (GstVideoConverter * convert) +{ + return &convert->out_info; +} diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.h b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.h index 7175f42b12..f064d2e176 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.h @@ -313,6 +313,12 @@ void gst_video_converter_frame (GstVideoConverter * con GST_VIDEO_API void gst_video_converter_frame_finish (GstVideoConverter * convert); +GST_VIDEO_API +const GstVideoInfo * gst_video_converter_get_in_info (GstVideoConverter * convert); + +GST_VIDEO_API +const GstVideoInfo * gst_video_converter_get_out_info (GstVideoConverter * convert); + G_END_DECLS #endif /* __GST_VIDEO_CONVERTER_H__ */ diff --git a/subprojects/gst-plugins-base/tests/check/libs/video.c b/subprojects/gst-plugins-base/tests/check/libs/video.c index 5792364fa3..875f32296b 100644 --- a/subprojects/gst-plugins-base/tests/check/libs/video.c +++ b/subprojects/gst-plugins-base/tests/check/libs/video.c @@ -2739,6 +2739,11 @@ GST_START_TEST (test_video_convert) GST_VIDEO_CONVERTER_OPT_DEST_WIDTH, G_TYPE_INT, 300, GST_VIDEO_CONVERTER_OPT_DEST_HEIGHT, G_TYPE_INT, 220, NULL)); + g_assert (gst_video_info_is_equal (&ininfo, + gst_video_converter_get_in_info (convert))); + g_assert (gst_video_info_is_equal (&outinfo, + gst_video_converter_get_out_info (convert))); + gst_video_converter_frame (convert, &inframe, &outframe); gst_video_converter_free (convert);