base: video-converter: add accessors for input and output formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2905>
This commit is contained in:
Guillaume Desmottes 2022-08-17 12:53:02 +02:00 committed by GStreamer Marge Bot
parent 664c051d79
commit cb1dc5c9ac
3 changed files with 43 additions and 0 deletions

View file

@ -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;
}

View file

@ -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__ */

View file

@ -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);