effecttv: fix initialisation

This commit is contained in:
Wim Taymans 2012-02-07 09:54:00 +01:00
parent 9196e0a3d6
commit 54252d0c49
2 changed files with 8 additions and 9 deletions

View file

@ -68,7 +68,7 @@ typedef enum _dice_dir
#define gst_dicetv_parent_class parent_class #define gst_dicetv_parent_class parent_class
G_DEFINE_TYPE (GstDiceTV, gst_dicetv, GST_TYPE_VIDEO_FILTER); G_DEFINE_TYPE (GstDiceTV, gst_dicetv, GST_TYPE_VIDEO_FILTER);
static void gst_dicetv_create_map (GstDiceTV * filter); static void gst_dicetv_create_map (GstDiceTV * filter, GstVideoInfo * info);
static GstStaticPadTemplate gst_dicetv_src_template = static GstStaticPadTemplate gst_dicetv_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
@ -100,7 +100,7 @@ gst_dicetv_set_info (GstVideoFilter * vfilter, GstCaps * incaps,
filter->dicemap = filter->dicemap =
(guint8 *) g_malloc (GST_VIDEO_INFO_WIDTH (in_info) * (guint8 *) g_malloc (GST_VIDEO_INFO_WIDTH (in_info) *
GST_VIDEO_INFO_WIDTH (in_info)); GST_VIDEO_INFO_WIDTH (in_info));
gst_dicetv_create_map (filter); gst_dicetv_create_map (filter, in_info);
return TRUE; return TRUE;
} }
@ -200,11 +200,10 @@ gst_dicetv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame,
} }
static void static void
gst_dicetv_create_map (GstDiceTV * filter) gst_dicetv_create_map (GstDiceTV * filter, GstVideoInfo * info)
{ {
gint x, y, i; gint x, y, i;
gint width, height; gint width, height;
GstVideoInfo *info = &GST_VIDEO_FILTER (filter)->in_info;
width = GST_VIDEO_INFO_WIDTH (info); width = GST_VIDEO_INFO_WIDTH (info);
height = GST_VIDEO_INFO_HEIGHT (info); height = GST_VIDEO_INFO_HEIGHT (info);
@ -237,7 +236,7 @@ gst_dicetv_set_property (GObject * object, guint prop_id, const GValue * value,
case PROP_CUBE_BITS: case PROP_CUBE_BITS:
GST_OBJECT_LOCK (filter); GST_OBJECT_LOCK (filter);
filter->g_cube_bits = g_value_get_int (value); filter->g_cube_bits = g_value_get_int (value);
gst_dicetv_create_map (filter); gst_dicetv_create_map (filter, &GST_VIDEO_FILTER (filter)->in_info);
GST_OBJECT_UNLOCK (filter); GST_OBJECT_UNLOCK (filter);
break; break;
default: default:

View file

@ -52,7 +52,8 @@
#define gst_shagadelictv_parent_class parent_class #define gst_shagadelictv_parent_class parent_class
G_DEFINE_TYPE (GstShagadelicTV, gst_shagadelictv, GST_TYPE_VIDEO_FILTER); G_DEFINE_TYPE (GstShagadelicTV, gst_shagadelictv, GST_TYPE_VIDEO_FILTER);
static void gst_shagadelic_initialize (GstShagadelicTV * filter); static void gst_shagadelic_initialize (GstShagadelicTV * filter,
GstVideoInfo * in_info);
#if G_BYTE_ORDER == G_LITTLE_ENDIAN #if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define CAPS_STR GST_VIDEO_CAPS_MAKE ("BGRx") #define CAPS_STR GST_VIDEO_CAPS_MAKE ("BGRx")
@ -91,13 +92,13 @@ gst_shagadelictv_set_info (GstVideoFilter * vfilter, GstCaps * incaps,
filter->ripple = (guint8 *) g_malloc (area * 4); filter->ripple = (guint8 *) g_malloc (area * 4);
filter->spiral = (guint8 *) g_malloc (area); filter->spiral = (guint8 *) g_malloc (area);
gst_shagadelic_initialize (filter); gst_shagadelic_initialize (filter, in_info);
return TRUE; return TRUE;
} }
static void static void
gst_shagadelic_initialize (GstShagadelicTV * filter) gst_shagadelic_initialize (GstShagadelicTV * filter, GstVideoInfo * info)
{ {
int i, x, y; int i, x, y;
#ifdef PS2 #ifdef PS2
@ -106,7 +107,6 @@ gst_shagadelic_initialize (GstShagadelicTV * filter)
double xx, yy; double xx, yy;
#endif #endif
gint width, height; gint width, height;
GstVideoInfo *info = &GST_VIDEO_FILTER (filter)->in_info;
width = GST_VIDEO_INFO_WIDTH (info); width = GST_VIDEO_INFO_WIDTH (info);
height = GST_VIDEO_INFO_HEIGHT (info); height = GST_VIDEO_INFO_HEIGHT (info);