video-converter: define some options

This commit is contained in:
Wim Taymans 2014-10-24 16:42:11 +02:00
parent ad0e0006b2
commit c409a45d13
2 changed files with 32 additions and 4 deletions

View file

@ -604,8 +604,8 @@ gst_video_converter_set_config (GstVideoConverter * convert,
g_return_val_if_fail (convert != NULL, FALSE);
g_return_val_if_fail (config != NULL, FALSE);
if (gst_structure_get_enum (config, "dither", GST_TYPE_VIDEO_DITHER_METHOD,
&dither)) {
if (gst_structure_get_enum (config, GST_VIDEO_CONVERTER_OPT_DITHER_METHOD,
GST_TYPE_VIDEO_DITHER_METHOD, &dither)) {
gboolean update = TRUE;
switch (dither) {
@ -623,7 +623,7 @@ gst_video_converter_set_config (GstVideoConverter * convert,
break;
}
if (update)
gst_structure_set (convert->config, "dither",
gst_structure_set (convert->config, GST_VIDEO_CONVERTER_OPT_DITHER_METHOD,
GST_TYPE_VIDEO_DITHER_METHOD, dither, NULL);
else
res = FALSE;

View file

@ -24,12 +24,40 @@
G_BEGIN_DECLS
/**
* GstVideoDitherMethod:
* @GST_VIDEO_DITHER_NONE: no dithering
* @GST_VIDEO_DITHER_VERTERR: propagate rounding errors downwards
* @GST_VIDEO_DITHER_HALFTONE: Dither with halftone pattern
* @GST_VIDEO_DITHER_HORIZERR: propagate rounding errors right
*
* Different dithering methods to use.
*/
typedef enum {
GST_VIDEO_DITHER_NONE,
GST_VIDEO_DITHER_VERTERR,
GST_VIDEO_DITHER_HALFTONE
GST_VIDEO_DITHER_HALFTONE,
GST_VIDEO_DITHER_HORIZERR
} GstVideoDitherMethod;
/**
* GST_VIDEO_CONVERTER_OPT_RESAMPLE_METHOD:
*
* #GST_TYPE_RESAMPLER_METHOD, The resampler method to use for
* resampling. Other options for the resampler can be used, see
* the #GstResampler.
*/
#define GST_VIDEO_CONVERTER_OPT_RESAMPLE_METHOD "GstVideoConverter.resample-method"
/**
* GST_VIDEO_CONVERTER_OPT_DITHER_METHOD:
*
* #GST_TYPE_VIDEO_DITHER_METHOD, The dither method to use when
* changing bit depth.
*/
#define GST_VIDEO_CONVERTER_OPT_DITHER_METHOD "GstVideoConverter.dither-method"
typedef struct _GstVideoConverter GstVideoConverter;
GstVideoConverter * gst_video_converter_new (GstVideoInfo *in_info,