diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-04-03 09:43:42 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-05-16 17:13:44 +0200 |
commit | 94d89be839478fda123b178531cdc479f90e3006 (patch) | |
tree | 1e249b3d5015ec076bdf858a06e670b8262c45e7 | |
parent | 67cb0e1c53f0a7a7b5c8a726e7672366830f719f (diff) |
videoconvert: use new chroma API
-rw-r--r-- | gst/videoconvert/videoconvert.c | 17 | ||||
-rw-r--r-- | gst/videoconvert/videoconvert.h | 4 |
2 files changed, 10 insertions, 11 deletions
diff --git a/gst/videoconvert/videoconvert.c b/gst/videoconvert/videoconvert.c index d76d49263..f94b3f1db 100644 --- a/gst/videoconvert/videoconvert.c +++ b/gst/videoconvert/videoconvert.c @@ -379,7 +379,6 @@ videoconvert_convert_compute_resample (VideoConvert * convert) { GstVideoInfo *in_info, *out_info; const GstVideoFormatInfo *sfinfo, *dfinfo; - gint bits; in_info = &convert->in_info; out_info = &convert->out_info; @@ -387,13 +386,11 @@ videoconvert_convert_compute_resample (VideoConvert * convert) sfinfo = in_info->finfo; dfinfo = out_info->finfo; - bits = ((convert->in_bits == 16 || convert->out_bits == 16) ? 16 : 8); + convert->upsample_w = gst_video_chroma_h_resample_new (0, + in_info->chroma_site, 0, sfinfo->unpack_format, sfinfo->w_sub[2]); - convert->upsample_w = gst_video_chroma_get_h_upsample (0, - in_info->chroma_site, 0, bits, sfinfo->w_sub[2]); - - convert->downsample_w = gst_video_chroma_get_h_subsample (0, - out_info->chroma_site, 0, bits, dfinfo->w_sub[2]); + convert->downsample_w = gst_video_chroma_h_resample_new (0, + out_info->chroma_site, 0, dfinfo->unpack_format, -dfinfo->w_sub[2]); return TRUE; } @@ -451,7 +448,8 @@ videoconvert_convert_generic (VideoConvert * convert, GstVideoFrame * dest, } if (convert->upsample_w) - convert->upsample_w (tmpline8, width); + gst_video_chroma_h_resample (convert->upsample_w, + convert->tmpline, convert->tmpline, width); if (out_bits == 16 || in_bits == 16) { if (convert->matrix) @@ -470,7 +468,8 @@ videoconvert_convert_generic (VideoConvert * convert, GstVideoFrame * dest, tmpline16 = convert->tmpline; if (convert->downsample_w) - convert->downsample_w (tmpline8, width); + gst_video_chroma_h_resample (convert->downsample_w, + convert->tmpline, convert->tmpline, width); if (out_bits == 16) { PACK_FRAME (dest, tmpline16, j, width); diff --git a/gst/videoconvert/videoconvert.h b/gst/videoconvert/videoconvert.h index 17e76883c..a56eac91e 100644 --- a/gst/videoconvert/videoconvert.h +++ b/gst/videoconvert/videoconvert.h @@ -51,8 +51,8 @@ struct _VideoConvert { gpointer tmpline; guint16 *errline; - GstVideoChromaHResample upsample_w; - GstVideoChromaHResample downsample_w; + GstVideoChromaHResample *upsample_w; + GstVideoChromaHResample *downsample_w; void (*convert) (VideoConvert *convert, GstVideoFrame *dest, const GstVideoFrame *src); void (*matrix) (VideoConvert *convert, gpointer pixels); |