GstVideoInfo in_info;
GstVideoInfo out_info;
- gint width;
- gint height;
+ gint in_width;
+ gint in_height;
+ gint out_width;
+ gint out_height;
+ gint v_scale_width;
gint in_bits;
gint out_bits;
void (*dither16) (GstVideoConverter * convert, guint16 * pixels, int j);
GstLineCache *upsample_lines;
+ GstLineCache *hscale_lines;
+ GstLineCache *vscale_lines;
GstLineCache *convert_lines;
GstLineCache *downsample_lines;
GstLineCache *pack_lines;
+ GstVideoScaler *h_scaler;
+ GstVideoScaler *v_scaler;
+
const GstVideoFrame *src;
GstVideoFrame *dest;
};
GstVideoConverter * convert);
static gboolean do_upsample_lines (GstLineCache * cache, gint line,
GstVideoConverter * convert);
+static gboolean do_vscale_lines (GstLineCache * cache, gint line,
+ GstVideoConverter * convert);
+static gboolean do_hscale_lines (GstLineCache * cache, gint line,
+ GstVideoConverter * convert);
static void
free_pack_line (GstLineCache * cache, gint idx,
}
static GstLineCacheNeedLineFunc
+chain_hscale (GstVideoConverter * convert, GstLineCacheNeedLineFunc need_line)
+{
+ convert->hscale_lines = gst_line_cache_new ();
+ gst_line_cache_set_need_line_func (convert->hscale_lines,
+ need_line, convert, NULL);
+ convert->h_scaler =
+ gst_video_scaler_new (GST_RESAMPLER_METHOD_BICUBIC,
+ GST_VIDEO_SCALER_FLAG_NONE, 4, convert->in_width, convert->out_width);
+ return (GstLineCacheNeedLineFunc) do_hscale_lines;
+}
+
+static GstLineCacheNeedLineFunc
+chain_vscale (GstVideoConverter * convert, GstLineCacheNeedLineFunc need_line)
+{
+ GstVideoScalerFlags flags;
+
+ flags = GST_VIDEO_INFO_IS_INTERLACED (&convert->in_info) ?
+ GST_VIDEO_SCALER_FLAG_INTERLACED : 0;
+
+ convert->vscale_lines = gst_line_cache_new ();
+ gst_line_cache_set_need_line_func (convert->vscale_lines,
+ need_line, convert, NULL);
+ convert->v_scaler =
+ gst_video_scaler_new (GST_RESAMPLER_METHOD_BICUBIC, flags, 4,
+ convert->in_height, convert->out_height);
+ return (GstLineCacheNeedLineFunc) do_vscale_lines;
+}
+
+static GstLineCacheNeedLineFunc
chain_downsample (GstVideoConverter * convert,
GstLineCacheNeedLineFunc need_line)
{
GstVideoConverter *convert;
gint width;
GstLineCacheNeedLineFunc need_line;
+ gint s2, s3;
g_return_val_if_fail (in_info != NULL, NULL);
g_return_val_if_fail (out_info != NULL, NULL);
- /* FIXME can't do scaling yet */
- g_return_val_if_fail (in_info->width == out_info->width, NULL);
- g_return_val_if_fail (in_info->height == out_info->height, NULL);
- g_return_val_if_fail (in_info->par_n == out_info->par_n, NULL);
- g_return_val_if_fail (in_info->par_d == out_info->par_d, NULL);
/* we won't ever do framerate conversion */
g_return_val_if_fail (in_info->fps_n == out_info->fps_n, NULL);
g_return_val_if_fail (in_info->fps_d == out_info->fps_d, NULL);
convert->in_info = *in_info;
convert->out_info = *out_info;
- convert->width = GST_VIDEO_INFO_WIDTH (in_info);
- convert->height = GST_VIDEO_INFO_HEIGHT (in_info);
-
+ convert->in_width = GST_VIDEO_INFO_WIDTH (in_info);
+ convert->in_height = GST_VIDEO_INFO_HEIGHT (in_info);
+ convert->out_width = GST_VIDEO_INFO_WIDTH (out_info);
+ convert->out_height = GST_VIDEO_INFO_HEIGHT (out_info);
/* default config */
convert->config = gst_structure_new ("GstVideoConverter",
convert->convert = video_converter_generic;
+ s2 = convert->in_width * convert->out_height;
+ s3 = convert->out_width * convert->in_height;
+ convert->v_scale_width = convert->in_width;
+
video_converter_compute_matrix (convert);
video_converter_compute_resample (convert);
/* upsample chroma */
if (convert->upsample)
need_line = chain_upsample (convert, need_line);
- /* convert */
- need_line = chain_convert (convert, need_line);
+
+ if (s3 <= s2) {
+ /* horizontal scaling first produces less pixels */
+ if (convert->in_width <= convert->out_width) {
+ /* upscaling, first convert then */
+ need_line = chain_convert (convert, need_line);
+ }
+ if (convert->in_width != convert->out_width) {
+ need_line = chain_hscale (convert, need_line);
+ convert->v_scale_width = convert->out_width;
+ }
+ if (convert->in_width > convert->out_width) {
+ /* downscaling, convert after scaling then */
+ need_line = chain_convert (convert, need_line);
+ }
+ }
+ /* v-scale */
+ if (convert->in_height != convert->out_height) {
+ need_line = chain_vscale (convert, need_line);
+ }
+ if (s3 > s2) {
+ /* vertical scaling first produced less pixels */
+ if (convert->in_width <= convert->out_width) {
+ /* upscaling, first convert then */
+ need_line = chain_convert (convert, need_line);
+ }
+ if (convert->in_width != convert->out_width) {
+ need_line = chain_hscale (convert, need_line);
+ }
+ if (convert->in_width > convert->out_width) {
+ /* downscaling, convert after scaling then */
+ need_line = chain_convert (convert, need_line);
+ }
+ }
/* downsample chroma */
if (convert->downsample)
need_line = chain_downsample (convert, need_line);
need_line = chain_pack (convert, need_line);
convert->lines = out_info->finfo->pack_lines;
- width = convert->width;
+ width = MAX (convert->in_width, convert->out_width);
convert->errline = g_malloc0 (sizeof (guint16) * width * 4);
/* FIXME */
alloc_tmplines (convert, 64, width);
gst_video_chroma_resample_free (convert->upsample);
if (convert->downsample)
gst_video_chroma_resample_free (convert->downsample);
+ if (convert->v_scaler)
+ gst_video_scaler_free (convert->v_scaler);
+ if (convert->h_scaler)
+ gst_video_scaler_free (convert->h_scaler);
if (convert->upsample_lines)
gst_line_cache_free (convert->upsample_lines);
+ if (convert->hscale_lines)
+ gst_line_cache_free (convert->hscale_lines);
+ if (convert->vscale_lines)
+ gst_line_cache_free (convert->vscale_lines);
if (convert->convert_lines)
gst_line_cache_free (convert->convert_lines);
if (convert->downsample_lines)
guint16 *errline = convert->errline;
unsigned int mask = 0xff;
- for (i = 0; i < 4 * convert->width; i++) {
+ for (i = 0; i < 4 * convert->in_width; i++) {
int x = pixels[i] + errline[i];
if (x > 65535)
x = 65535;
{252, 142, 220, 92, 244, 116, 212, 84}
};
- for (i = 0; i < convert->width * 4; i++) {
+ for (i = 0; i < convert->in_width * 4; i++) {
int x;
x = pixels[i] + halftone[(i >> 2) & 7][j & 7];
if (x > 65535)
{
#if 1
video_orc_matrix8 (pixels, pixels, convert->orc_p1, convert->orc_p2,
- convert->orc_p3, convert->width);
+ convert->orc_p3, convert->in_width);
#elif 0
/* FIXME we would like to set this as a backup function, it's faster than the
* orc generated one */
int y, u, v;
guint8 *p = pixels;
- for (i = 0; i < convert->width; i++) {
+ for (i = 0; i < convert->in_width; i++) {
r = p[i * 4 + 1];
g = p[i * 4 + 2];
b = p[i * 4 + 3];
video_orc_convert_AYUV_ARGB (pixels, 0, pixels, 0,
convert->cmatrix[0][0], convert->cmatrix[0][2],
convert->cmatrix[2][1], convert->cmatrix[1][1], convert->cmatrix[1][2],
- convert->width, 1);
+ convert->in_width, 1);
}
static void
int y, u, v;
guint16 *p = pixels;
- for (i = 0; i < convert->width; i++) {
+ for (i = 0; i < convert->in_width; i++) {
r = p[i * 4 + 1];
g = p[i * 4 + 2];
b = p[i * 4 + 3];
guint cline;;
tmpline = get_temp_line (convert);
- cline = CLAMP (line, 0, convert->height - 1);
+ cline = CLAMP (line, 0, convert->in_height - 1);
GST_DEBUG ("unpack line %d (%u)", line, cline);
- UNPACK_FRAME (convert->src, tmpline, cline, convert->width);
+ UNPACK_FRAME (convert->src, tmpline, cline, convert->in_width);
gst_line_cache_add_line (cache, line, tmpline);
gst_line_cache_get_lines (convert->upsample_lines, start_line, n_lines);
GST_DEBUG ("doing upsample %d-%d", start_line, start_line + n_lines - 1);
- gst_video_chroma_resample (convert->upsample, lines, convert->width);
+ gst_video_chroma_resample (convert->upsample, lines, convert->in_width);
for (i = 0; i < n_lines; i++)
gst_line_cache_add_line (cache, start_line + i, lines[i]);
return TRUE;
}
+static gboolean
+do_hscale_lines (GstLineCache * cache, gint line, GstVideoConverter * convert)
+{
+ gpointer *lines, destline;
+
+ lines = gst_line_cache_get_lines (convert->hscale_lines, line, 1);
+
+ destline = get_temp_line (convert);
+
+ GST_DEBUG ("hresample line %d", line);
+ gst_video_scaler_horizontal (convert->h_scaler, GST_VIDEO_FORMAT_AYUV,
+ GST_VIDEO_COLOR_RANGE_0_255, lines[0], destline, 0, convert->out_width);
+
+ gst_line_cache_add_line (cache, line, destline);
+
+ return TRUE;
+}
+
+static gboolean
+do_vscale_lines (GstLineCache * cache, gint line, GstVideoConverter * convert)
+{
+ gpointer *lines, destline;
+ guint sline, n_lines;
+
+ gst_video_scaler_get_coeff (convert->v_scaler, line, &sline, &n_lines);
+ lines = gst_line_cache_get_lines (convert->vscale_lines, sline, n_lines);
+
+ destline = get_temp_line (convert);
+
+ GST_DEBUG ("vresample line %d %d-%d", line, sline, sline + n_lines - 1);
+ gst_video_scaler_vertical (convert->v_scaler, GST_VIDEO_FORMAT_AYUV,
+ GST_VIDEO_COLOR_RANGE_0_255, lines, destline, line,
+ convert->v_scale_width);
+
+ gst_line_cache_add_line (cache, line, destline);
+
+ return TRUE;
+}
static gboolean
do_convert_lines (GstLineCache * cache, gint line, GstVideoConverter * convert)
if (out_bits == 16 || in_bits == 16) {
/* FIXME, we can scale in the conversion matrix */
if (in_bits == 8)
- convert_to16 (lines[0], convert->width);
+ convert_to16 (lines[0], convert->out_width);
if (convert->matrix)
convert->matrix (convert, lines[0]);
convert->dither16 (convert, lines[0], line);
if (out_bits == 8)
- convert_to8 (lines[0], convert->width);
+ convert_to8 (lines[0], convert->out_width);
} else {
if (convert->matrix)
convert->matrix (convert, lines[0]);
GST_DEBUG ("downsample line %d %d-%d", line, start_line,
start_line + n_lines - 1);
- gst_video_chroma_resample (convert->downsample, lines, convert->width);
+ gst_video_chroma_resample (convert->downsample, lines, convert->out_width);
for (i = 0; i < n_lines; i++)
gst_line_cache_add_line (cache, start_line + i, lines[i]);
GstVideoFrame * dest)
{
gint i;
- gint width, height;
+ gint out_width, out_height;
gint pack_lines;
- width = convert->width;
- height = convert->height;
+ out_width = convert->out_width;
+ out_height = convert->out_height;
convert->src = src;
convert->dest = dest;
pack_lines = convert->lines; /* only 1 for now */
- for (i = 0; i < height; i += pack_lines) {
+ for (i = 0; i < out_height; i += pack_lines) {
gpointer *lines;
/* load the lines needed to pack */
/* and pack into destination */
GST_DEBUG ("pack line %d", i);
- PACK_FRAME (dest, lines[0], i, width);
+ PACK_FRAME (dest, lines[0], i, out_width);
}
}
GstVideoFrame * dest)
{
int i;
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
gint l1, l2;
GstVideoFrame * dest)
{
int i;
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
gint l1, l2;
GstVideoFrame * dest)
{
int i;
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
gint l1, l2;
convert_I420_Y42B (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_memcpy_2d (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_I420_Y444 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_memcpy_2d (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
GstVideoFrame * dest)
{
int i;
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
gint l1, l2;
convert_YUY2_AYUV (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_YUY2_AYUV (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
convert_YUY2_Y42B (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_YUY2_Y42B (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_U_LINE (dest, 0),
convert_YUY2_Y444 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_YUY2_Y444 (FRAME_GET_COMP_LINE (dest, 0, 0),
FRAME_GET_COMP_STRIDE (dest, 0), FRAME_GET_COMP_LINE (dest, 1, 0),
GstVideoFrame * dest)
{
int i;
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
gint l1, l2;
convert_UYVY_AYUV (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_UYVY_AYUV (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
convert_UYVY_YUY2 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_UYVY_YUY2 (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
convert_UYVY_Y42B (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_UYVY_Y42B (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_U_LINE (dest, 0),
convert_UYVY_Y444 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_UYVY_Y444 (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_U_LINE (dest, 0),
convert_AYUV_I420 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
/* only for even width/height */
video_orc_convert_AYUV_I420 (FRAME_GET_Y_LINE (dest, 0),
convert_AYUV_YUY2 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
/* only for even width */
video_orc_convert_AYUV_YUY2 (FRAME_GET_LINE (dest, 0),
convert_AYUV_UYVY (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
/* only for even width */
video_orc_convert_AYUV_UYVY (FRAME_GET_LINE (dest, 0),
convert_AYUV_Y42B (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
/* only works for even width */
video_orc_convert_AYUV_Y42B (FRAME_GET_Y_LINE (dest, 0),
convert_AYUV_Y444 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_AYUV_Y444 (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_U_LINE (dest, 0),
convert_Y42B_I420 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_memcpy_2d (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y42B_Y444 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_memcpy_2d (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y42B_YUY2 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_Y42B_YUY2 (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y42B_UYVY (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_Y42B_UYVY (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y42B_AYUV (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
/* only for even width */
video_orc_convert_Y42B_AYUV (FRAME_GET_LINE (dest, 0),
convert_Y444_I420 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_memcpy_2d (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y444_Y42B (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_memcpy_2d (FRAME_GET_Y_LINE (dest, 0),
FRAME_GET_Y_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y444_YUY2 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_Y444_YUY2 (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y444_UYVY (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_Y444_UYVY (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_Y444_AYUV (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_Y444_AYUV (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_Y_LINE (src, 0),
convert_AYUV_ARGB (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_AYUV_ARGB (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
convert_AYUV_BGRA (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_AYUV_BGRA (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
convert_AYUV_ABGR (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_AYUV_ABGR (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
convert_AYUV_RGBA (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
video_orc_convert_AYUV_RGBA (FRAME_GET_LINE (dest, 0),
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
GstVideoFrame * dest)
{
int i;
- gint width = convert->width;
- gint height = convert->height;
+ gint width = convert->in_width;
+ gint height = convert->in_height;
for (i = 0; i < height; i++) {
video_orc_convert_I420_BGRA (FRAME_GET_LINE (dest, i),
gboolean interlaced;
gint width, height;
- in_format = GST_VIDEO_INFO_FORMAT (&convert->in_info);
- out_format = GST_VIDEO_INFO_FORMAT (&convert->out_info);
-
width = GST_VIDEO_INFO_WIDTH (&convert->in_info);
height = GST_VIDEO_INFO_HEIGHT (&convert->in_info);
+ if (width != convert->out_width || height != convert->out_height)
+ return FALSE;
+
+ in_format = GST_VIDEO_INFO_FORMAT (&convert->in_info);
+ out_format = GST_VIDEO_INFO_FORMAT (&convert->out_info);
+
in_matrix = convert->in_info.colorimetry.matrix;
out_matrix = convert->out_info.colorimetry.matrix;