GList *invisible;
} GstVP8EncCoderHook;
+static void
+_gst_mini_object_unref0 (GstMiniObject * obj)
+{
+ if (obj)
+ gst_mini_object_unref (obj);
+}
+
+static void
+gst_vp8_enc_coder_hook_free (GstVP8EncCoderHook * hook)
+{
+ if (hook->image)
+ g_slice_free (vpx_image_t, hook->image);
+
+ g_list_foreach (hook->invisible, (GFunc) _gst_mini_object_unref0, NULL);
+ g_list_free (hook->invisible);
+ g_slice_free (GstVP8EncCoderHook, hook);
+}
+
#define DEFAULT_BITRATE 0
#define DEFAULT_MODE VPX_VBR
#define DEFAULT_MIN_QUANTIZER 0
hook = g_slice_new0 (GstVP8EncCoderHook);
hook->image = image;
frame->coder_hook = hook;
+ frame->coder_hook_destroy_notify =
+ (GDestroyNotify) gst_vp8_enc_coder_hook_free;
if (frame->force_keyframe) {
flags |= VPX_EFLAG_FORCE_KF;
return granulepos;
}
-static void
-_gst_mini_object_unref0 (GstMiniObject * obj)
-{
- if (obj)
- gst_mini_object_unref (obj);
-}
-
static GstFlowReturn
gst_vp8_enc_shape_output (GstBaseVideoEncoder * base_video_encoder,
GstVideoFrame * frame)
}
done:
- if (hook) {
- g_list_foreach (hook->invisible, (GFunc) _gst_mini_object_unref0, NULL);
- g_list_free (hook->invisible);
- g_slice_free (GstVP8EncCoderHook, hook);
- frame->coder_hook = NULL;
- }
-
return ret;
}