mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
framepositionner: Initialize all fields of the meta during initialization
GstMetas are not allocated with all fields initialized to zeroes.
This commit is contained in:
parent
9add236a0e
commit
3741d5ce19
1 changed files with 22 additions and 5 deletions
|
@ -38,8 +38,10 @@ static GstFlowReturn gst_frame_positionner_transform_ip (GstBaseTransform *
|
|||
trans, GstBuffer * buf);
|
||||
|
||||
static gboolean
|
||||
gst_frame_positionner_meta_transform (GstBuffer * dest, GstMeta * meta,
|
||||
GstBuffer * buffer, GQuark type, gpointer data);
|
||||
gst_frame_positionner_meta_init (GstMeta * meta, gpointer params,
|
||||
GstBuffer * buffer);
|
||||
static gboolean gst_frame_positionner_meta_transform (GstBuffer * dest,
|
||||
GstMeta * meta, GstBuffer * buffer, GQuark type, gpointer data);
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -428,14 +430,29 @@ gst_frame_positionner_get_info (void)
|
|||
const GstMetaInfo *meta =
|
||||
gst_meta_register (gst_frame_positionner_meta_api_get_type (),
|
||||
"GstFramePositionnerMeta",
|
||||
sizeof (GstFramePositionnerMeta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) NULL,
|
||||
(GstMetaTransformFunction) gst_frame_positionner_meta_transform);
|
||||
sizeof (GstFramePositionnerMeta), gst_frame_positionner_meta_init,
|
||||
NULL,
|
||||
gst_frame_positionner_meta_transform);
|
||||
g_once_init_leave (&meta_info, meta);
|
||||
}
|
||||
return meta_info;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_frame_positionner_meta_init (GstMeta * meta, gpointer params,
|
||||
GstBuffer * buffer)
|
||||
{
|
||||
GstFramePositionnerMeta *smeta;
|
||||
|
||||
smeta = (GstFramePositionnerMeta *) meta;
|
||||
|
||||
smeta->alpha = 0.0;
|
||||
smeta->posx = smeta->posy = smeta->height = smeta->width = 0;
|
||||
smeta->zorder = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_frame_positionner_meta_transform (GstBuffer * dest, GstMeta * meta,
|
||||
GstBuffer * buffer, GQuark type, gpointer data)
|
||||
|
|
Loading…
Reference in a new issue