diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index 85336179fc..4338aec4f6 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -153,8 +153,18 @@ static const gchar *interlace_mode[] = { "fields" }; -static const gchar * -gst_interlace_mode_to_string (GstVideoInterlaceMode mode) +/** + * gst_video_interlace_mode_to_string: + * @mode: a #GstVideoInterlaceMode + * + * Convert @mode to its string representation. + * + * Returns: @mode as a string or NULL if @mode in invalid. + * + * Since: 1.6 + */ +const gchar * +gst_video_interlace_mode_to_string (GstVideoInterlaceMode mode) { if (((guint) mode) >= G_N_ELEMENTS (interlace_mode)) return NULL; @@ -162,8 +172,20 @@ gst_interlace_mode_to_string (GstVideoInterlaceMode mode) return interlace_mode[mode]; } -static GstVideoInterlaceMode -gst_interlace_mode_from_string (const gchar * mode) +/** + * gst_video_interlace_mode_from_string: + * @mode: a mode + * + * Convert @mode to a #GstVideoInterlaceMode + * + * Returns: the #GstVideoInterlaceMode of @mode or + * #GST_VIDEO_INTERLACE_MODE_PROGRESSIVE when @mode is not a valid + * string representation for a #GstVideoInterlaceMode. + * + * Since: 1.6 + */ +GstVideoInterlaceMode +gst_video_interlace_mode_from_string (const gchar * mode) { gint i; for (i = 0; i < G_N_ELEMENTS (interlace_mode); i++) { @@ -245,7 +267,7 @@ gst_video_info_from_caps (GstVideoInfo * info, const GstCaps * caps) } if ((s = gst_structure_get_string (structure, "interlace-mode"))) - info->interlace_mode = gst_interlace_mode_from_string (s); + info->interlace_mode = gst_video_interlace_mode_from_string (s); else info->interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE; @@ -388,7 +410,7 @@ gst_video_info_to_caps (GstVideoInfo * info) "pixel-aspect-ratio", GST_TYPE_FRACTION, info->par_n, info->par_d, NULL); gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING, - gst_interlace_mode_to_string (info->interlace_mode), NULL); + gst_video_interlace_mode_to_string (info->interlace_mode), NULL); if (info->chroma_site != GST_VIDEO_CHROMA_SITE_UNKNOWN) gst_caps_set_simple (caps, "chroma-site", G_TYPE_STRING, diff --git a/gst-libs/gst/video/video-info.h b/gst-libs/gst/video/video-info.h index 24098160c8..8b1210deb1 100644 --- a/gst-libs/gst/video/video-info.h +++ b/gst-libs/gst/video/video-info.h @@ -55,6 +55,9 @@ typedef enum { GST_VIDEO_INTERLACE_MODE_FIELDS } GstVideoInterlaceMode; +const gchar * gst_video_interlace_mode_to_string (GstVideoInterlaceMode mode); +GstVideoInterlaceMode gst_video_interlace_mode_from_string (const gchar * mode); + /** * GstVideoFlags: * @GST_VIDEO_FLAG_NONE: no flags diff --git a/win32/common/libgstvideo.def b/win32/common/libgstvideo.def index fcf719470b..14e512b854 100644 --- a/win32/common/libgstvideo.def +++ b/win32/common/libgstvideo.def @@ -177,7 +177,9 @@ EXPORTS gst_video_info_is_equal gst_video_info_set_format gst_video_info_to_caps + gst_video_interlace_mode_from_string gst_video_interlace_mode_get_type + gst_video_interlace_mode_to_string gst_video_meta_api_get_type gst_video_meta_get_info gst_video_meta_map