GMainContext *context;
GstSample *sample;
//GstBuffer *buffer;
- gulong timeout_id;
+ GSource *timeout_source;
gboolean finished;
} GstVideoConvertSampleContext;
g_mutex_lock (&ctx->mutex);
g_mutex_unlock (&ctx->mutex);
g_mutex_clear (&ctx->mutex);
- if (ctx->timeout_id)
- g_source_remove (ctx->timeout_id);
+ if (ctx->timeout_source)
+ g_source_destroy (ctx->timeout_source);
//if (ctx->buffer)
// gst_buffer_unref (ctx->buffer);
if (ctx->sample)
GSource *source;
GstVideoConvertSampleCallbackContext *ctx;
- if (context->timeout_id)
- g_source_remove (context->timeout_id);
- context->timeout_id = 0;
+ if (context->timeout_source)
+ g_source_destroy (context->timeout_source);
+ context->timeout_source = NULL;
ctx = g_slice_new (GstVideoConvertSampleCallbackContext);
ctx->callback = context->callback;
ctx->pipeline = pipeline;
if (timeout != GST_CLOCK_TIME_NONE) {
- source = g_timeout_source_new (timeout / GST_MSECOND);
- g_source_set_callback (source,
+ ctx->timeout_source = g_timeout_source_new (timeout / GST_MSECOND);
+ g_source_set_callback (ctx->timeout_source,
(GSourceFunc) convert_frame_timeout_callback, ctx, NULL);
- ctx->timeout_id = g_source_attach (source, context);
- g_source_unref (source);
+ g_source_attach (ctx->timeout_source, context);
}
g_signal_connect (src, "need-data",