void
gst_decklink_sink_finalize (GObject * object)
{
  GstDecklinkSink *decklinksink;

  decklinksink = GST_DECKLINK_SINK (object);

  g_cond_clear (&decklinksink->cond);
  g_mutex_clear (&decklinksink->mutex);
  g_cond_clear (&decklinksink->audio_cond);
  g_mutex_clear (&decklinksink->audio_mutex);

  delete decklinksink->callback;

#ifdef _MSC_VER
  /* signal the COM thread that it should uninitialize COM */
  if (decklinksink->comInitialized) {
    g_mutex_lock (&decklinksink->com_deinit_lock);
    g_cond_signal (&decklinksink->com_uninitialize);
    g_cond_wait (&decklinksink->com_uninitialized,
        &decklinksink->com_deinit_lock);
    g_mutex_unlock (&decklinksink->com_deinit_lock);
  }

  g_mutex_clear (&decklinksink->com_init_lock);
  g_mutex_clear (&decklinksink->com_deinit_lock);
  g_cond_clear (&decklinksink->com_initialized);
  g_cond_clear (&decklinksink->com_uninitialize);
  g_cond_clear (&decklinksink->com_uninitialized);
#endif /* _MSC_VER */

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* Base encoder cleanup (internal) */
void
gst_vaapi_encoder_finalize (GstVaapiEncoder * encoder)
{
  GstVaapiEncoderClass *const klass = GST_VAAPI_ENCODER_GET_CLASS (encoder);

  klass->finalize (encoder);

  gst_vaapi_object_replace (&encoder->context, NULL);
  gst_vaapi_display_replace (&encoder->display, NULL);
  encoder->va_display = NULL;

  if (encoder->properties) {
    g_ptr_array_unref (encoder->properties);
    encoder->properties = NULL;
  }

  gst_vaapi_video_pool_replace (&encoder->codedbuf_pool, NULL);
  if (encoder->codedbuf_queue) {
    g_async_queue_unref (encoder->codedbuf_queue);
    encoder->codedbuf_queue = NULL;
  }
  g_cond_clear (&encoder->surface_free);
  g_cond_clear (&encoder->codedbuf_free);
  g_mutex_clear (&encoder->mutex);
}
static void
gst_gl_window_finalize (GObject * object)
{
  GstGLWindow *window = GST_GL_WINDOW (object);
  GstGLWindowPrivate *priv = window->priv;

  GST_INFO ("quit navigation loop");
  if (window->priv->navigation_loop) {
    g_main_loop_quit (window->priv->navigation_loop);
    /* wait until navigation thread finished */
    g_thread_join (window->priv->navigation_thread);
    window->priv->navigation_thread = NULL;
  }

  if (priv->loop)
    g_main_loop_unref (priv->loop);

  if (priv->main_context)
    g_main_context_unref (priv->main_context);

  g_weak_ref_clear (&window->context_ref);

  g_mutex_clear (&window->lock);
  g_mutex_clear (&window->priv->nav_lock);
  g_cond_clear (&window->priv->nav_create_cond);
  g_mutex_clear (&window->priv->sync_message_lock);
  g_cond_clear (&window->priv->sync_message_cond);
  gst_object_unref (window->display);

  G_OBJECT_CLASS (gst_gl_window_parent_class)->finalize (object);
}
void
gst_decklink_src_finalize (GObject * object)
{
  GstDecklinkSrc *decklinksrc;

  g_return_if_fail (GST_IS_DECKLINK_SRC (object));
  decklinksrc = GST_DECKLINK_SRC (object);

  /* clean up object here */

  g_cond_clear (&decklinksrc->cond);
  g_mutex_clear (&decklinksrc->mutex);
  gst_task_set_lock (decklinksrc->task, NULL);
  g_object_unref (decklinksrc->task);

#ifdef _MSC_VER
  /* signal the COM thread that it should uninitialize COM */
  if (decklinksrc->comInitialized) {
    g_mutex_lock (&decklinksrc->com_deinit_lock);
    g_cond_signal (&decklinksrc->com_uninitialize);
    g_cond_wait (&decklinksrc->com_uninitialized, &decklinksrc->com_deinit_lock);
    g_mutex_unlock (&decklinksrc->com_deinit_lock);
  }

  g_mutex_clear (&decklinksrc->com_init_lock);
  g_mutex_clear (&decklinksrc->com_deinit_lock);
  g_cond_clear (&decklinksrc->com_initialized);
  g_cond_clear (&decklinksrc->com_uninitialize);
  g_cond_clear (&decklinksrc->com_uninitialized);
#endif /* _MSC_VER */

  g_rec_mutex_clear (&decklinksrc->task_mutex);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Exemple #5
0
static void mpegts_demuxer_finalize(GObject *object)
{
    MpegTSDemuxer *demuxer = MPEGTS_DEMUXER(object);

    g_mutex_clear(&demuxer->lock);
    g_cond_clear(&demuxer->add_cond);
    g_cond_clear(&demuxer->del_cond);
    g_object_unref(demuxer->sink_adapter);

    G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_test_clock_finalize (GObject * object)
{
  GstTestClock *test_clock = GST_TEST_CLOCK (object);
  GstTestClockPrivate *priv = GST_TEST_CLOCK_GET_PRIVATE (test_clock);

  g_cond_clear (&priv->entry_added_cond);
  g_cond_clear (&priv->entry_processed_cond);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Exemple #7
0
static void
gst_shmdata_src_finalize (GObject * object)
{
  GstShmdataSrc *self = GST_SHMDATA_SRC (object);
  g_mutex_clear (&self->on_data_mutex);
  g_cond_clear (&self->on_data_cond);
  g_mutex_clear (&self->data_rendered_mutex);
  g_cond_clear (&self->data_rendered_cond);
  if (NULL != self->caps)
    gst_caps_unref (self->caps);
  G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_gl_context_finalize (GObject * object)
{
  GstGLContext *context = GST_GL_CONTEXT (object);

  if (context->window) {
    gst_gl_window_set_resize_callback (context->window, NULL, NULL, NULL);
    gst_gl_window_set_draw_callback (context->window, NULL, NULL, NULL);

    if (context->priv->alive) {
      g_mutex_lock (&context->priv->render_lock);
      GST_INFO_OBJECT (context, "send quit gl window loop");
      gst_gl_window_quit (context->window);
      while (context->priv->alive) {
        g_cond_wait (&context->priv->destroy_cond, &context->priv->render_lock);
      }
      g_mutex_unlock (&context->priv->render_lock);
    }

    gst_gl_window_set_close_callback (context->window, NULL, NULL, NULL);

    if (context->priv->gl_thread) {
      gpointer ret = g_thread_join (context->priv->gl_thread);
      GST_INFO_OBJECT (context, "gl thread joined");
      if (ret != NULL)
        GST_ERROR_OBJECT (context, "gl thread returned a non-null pointer");
      context->priv->gl_thread = NULL;
    }

    gst_object_unref (context->window);
  }

  gst_object_unref (context->display);

  if (context->gl_vtable) {
    g_slice_free (GstGLFuncs, context->gl_vtable);
    context->gl_vtable = NULL;
  }

  g_mutex_clear (&context->priv->render_lock);

  g_cond_clear (&context->priv->destroy_cond);
  g_cond_clear (&context->priv->create_cond);

  g_free (context->priv->gl_exts);
  g_weak_ref_clear (&context->priv->other_context_ref);

  GST_DEBUG_OBJECT (context, "End of finalize");
  G_OBJECT_CLASS (gst_gl_context_parent_class)->finalize (object);
}
Exemple #9
0
static void
signal_data_cleanup (SignalData * data)
{
  GST_DEBUG ("free %p", data);
  g_mutex_clear (&data->lock);
  g_cond_clear (&data->cond);
}
Exemple #10
0
static void find_context_destroy( find_context_t* fc ) {
    g_mutex_clear( &fc->find_lock );
    g_cond_clear( &fc->find_cond );

    free( fc->text );
    free( fc );
}
Exemple #11
0
static void _vala_clear_GCond (GCond * mutex) {
	GCond zero_mutex = { 0 };
	if (memcmp (mutex, &zero_mutex, sizeof (GCond))) {
		g_cond_clear (mutex);
		memset (mutex, 0, sizeof (GCond));
	}
}
void
eas_gdbus_client_destroy (struct eas_gdbus_client *client)
{
	if (client->connection) {
		g_object_unref (client->connection);
		client->connection = NULL;
	}

	if (client->progress_lock) {
#if GLIB_CHECK_VERSION (2,31,0)
		g_mutex_clear (client->progress_lock);
#else
		g_mutex_free (client->progress_lock);
#endif
		client->progress_lock = NULL;
	}

	if (client->progress_cond) {
#if GLIB_CHECK_VERSION (2,31,0)
		g_cond_clear (client->progress_cond);
#else
		g_cond_free (client->progress_cond);
#endif
		client->progress_cond = NULL;
	}

	g_free (client->account_uid);
	client->account_uid = NULL;

	if (client->progress_fns_table) {
		g_hash_table_remove_all (client->progress_fns_table);
		g_hash_table_unref (client->progress_fns_table);
		client->progress_fns_table = NULL;
	}
}
Exemple #13
0
static void
xmms_output_destroy (xmms_object_t *object)
{
	xmms_output_t *output = (xmms_output_t *)object;

	XMMS_DBG ("Deactivating output object.");

	output->monitor_volume_running = FALSE;
	if (output->monitor_volume_thread) {
		g_thread_join (output->monitor_volume_thread);
		output->monitor_volume_thread = NULL;
	}

	xmms_output_filler_state (output, FILLER_QUIT);
	g_thread_join (output->filler_thread);

	if (output->plugin) {
		xmms_output_plugin_method_destroy (output->plugin, output);
		xmms_object_unref (output->plugin);
	}
	xmms_output_format_list_clear (output);

	xmms_object_unref (output->playlist);
	xmms_object_unref (output->medialib);

	g_mutex_clear (&output->status_mutex);
	g_mutex_clear (&output->playtime_mutex);
	g_mutex_clear (&output->filler_mutex);
	g_cond_clear (&output->filler_state_cond);
	xmms_ringbuf_destroy (output->filler_buffer);

	xmms_playback_unregister_ipc_commands ();
}
void
gst_gl_window_default_send_message (GstGLWindow * window,
    GstGLWindowCB callback, gpointer data)
{
  GstGLSyncMessage message;

  message.callback = callback;
  message.data = data;
  message.fired = FALSE;
  g_mutex_init (&message.lock);
  g_cond_init (&message.cond);

  gst_gl_window_send_message_async (window, (GstGLWindowCB) _run_message_sync,
      &message, NULL);

  g_mutex_lock (&message.lock);

  /* block until opengl calls have been executed in the gl thread */
  while (!message.fired)
    g_cond_wait (&message.cond, &message.lock);
  g_mutex_unlock (&message.lock);

  g_mutex_clear (&message.lock);
  g_cond_clear (&message.cond);
}
static void moose_job_manager_finalize(GObject *gobject) {
    MooseJobManager *self = MOOSE_JOB_MANAGER(gobject);
    MooseJobManagerPrivate *priv = self->priv;

    /* Send a terminating job to the Queue and wait for it finish */
    g_async_queue_push(priv->job_queue, (gpointer)&priv->terminator);
    g_thread_join(priv->execute_thread);

    /* Free ressources */
    g_async_queue_unref(priv->job_queue);

    g_cond_clear(&priv->finish_cond);
    g_mutex_clear(&priv->finish_mutex);
    g_mutex_clear(&priv->current_job_mutex);
    g_mutex_clear(&priv->hash_table_mutex);
    g_mutex_clear(&priv->job_id_counter_mutex);

    if(priv->current_job != NULL) {
        moose_job_free(priv->current_job);
    }

    g_hash_table_destroy(priv->results);

    /* Always chain up to the parent class; as with dispose(), finalize()
     * is guaranteed to exist on the parent's class virtual function table
     */
    G_OBJECT_CLASS(g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)))->finalize(gobject);
}
static void
gst_dtls_enc_finalize (GObject * object)
{
  GstDtlsEnc *self = GST_DTLS_ENC (object);

  if (self->encoder_key) {
    gst_buffer_unref (self->encoder_key);
    self->encoder_key = NULL;
  }

  if (self->connection_id) {
    g_free (self->connection_id);
    self->connection_id = NULL;
  }

  g_mutex_lock (&self->queue_lock);
  g_queue_foreach (&self->queue, (GFunc) gst_buffer_unref, NULL);
  g_queue_clear (&self->queue);
  g_mutex_unlock (&self->queue_lock);

  g_mutex_clear (&self->queue_lock);
  g_cond_clear (&self->queue_cond_add);

  GST_LOG_OBJECT (self, "finalized");

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_curl_base_sink_finalize (GObject * gobject)
{
  GstCurlBaseSink *this = GST_CURL_BASE_SINK (gobject);

  GST_DEBUG ("finalizing curlsink");
  if (this->transfer_thread != NULL) {
    g_thread_join (this->transfer_thread);
  }

  gst_curl_base_sink_transfer_cleanup (this);
  g_cond_clear (&this->transfer_cond->cond);
  g_free (this->transfer_cond);
  g_free (this->transfer_buf);

  g_free (this->url);
  g_free (this->user);
  g_free (this->passwd);
  g_free (this->file_name);
  if (this->fdset != NULL) {
    gst_poll_free (this->fdset);
    this->fdset = NULL;
  }
  G_OBJECT_CLASS (parent_class)->finalize (gobject);
}
OMX_ERRORTYPE
gst_omx_buf_tab_free (GstOmxBufTab * buftab)
{
  OMX_ERRORTYPE error;

  g_return_val_if_fail (buftab, OMX_ErrorBadParameter);

  error = OMX_ErrorNone;

  error = gst_omx_buf_tab_wait_free (buftab);
  if (OMX_ErrorNone != error)
    goto nowait;

  g_mutex_lock (&buftab->tabmutex);

  g_list_free_full (buftab->table, (GDestroyNotify) g_free);
  buftab->table = NULL;

  g_mutex_unlock (&buftab->tabmutex);

  g_mutex_clear (&buftab->tabmutex);
  g_cond_clear (&buftab->tabcond);
  g_free (buftab);

  return error;

nowait:
  return error;
}
Exemple #19
0
/* Do not call from the global main loop thread. */
gboolean
g_vfs_dns_sd_resolver_resolve_sync (GVfsDnsSdResolver  *resolver,
                                    GCancellable       *cancellable,
                                    GError            **error)
{
    ResolveDataSync *data;
    gboolean ret;

    g_return_val_if_fail (G_VFS_IS_DNS_SD_RESOLVER (resolver), FALSE);

    data = g_new0 (ResolveDataSync, 1);
    g_cond_init (&data->cond);
    g_mutex_init (&data->mutex);

    g_mutex_lock (&data->mutex);
    g_vfs_dns_sd_resolver_resolve (resolver,
                                   cancellable,
                                   (GAsyncReadyCallback) resolve_sync_cb,
                                   data);

    while (!data->done)
        g_cond_wait (&data->cond, &data->mutex);
    g_mutex_unlock (&data->mutex);

    ret = data->ret;
    if (data->error != NULL)
        g_propagate_error (error, data->error);

    g_mutex_clear (&data->mutex);
    g_cond_clear (&data->cond);
    g_free (data);

    return ret;
}
Exemple #20
0
static void
tracker_controller_finalize (GObject *object)
{
	TrackerControllerPrivate *priv;
	TrackerController *controller;

	controller = TRACKER_CONTROLLER (object);
	priv = controller->priv;

	if (priv->shutdown_source) {
		g_source_destroy (priv->shutdown_source);
		priv->shutdown_source = NULL;
	}

	tracker_controller_dbus_stop (controller);

	g_object_unref (priv->storage);
	g_hash_table_unref (priv->modules);

	g_main_loop_unref (priv->main_loop);
	g_main_context_unref (priv->context);

	g_cond_clear (&priv->initialization_cond);
	g_mutex_clear (&priv->initialization_mutex);
	g_mutex_clear (&priv->mutex);

	G_OBJECT_CLASS (tracker_controller_parent_class)->finalize (object);
}
Exemple #21
0
static void webkitVideoSinkDispose(GObject* object)
{
    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
    WebKitVideoSinkPrivate* priv = sink->priv;

    if (priv->dataCondition) {
#if GLIB_CHECK_VERSION(2, 31, 0)
        g_cond_clear(priv->dataCondition);
        delete priv->dataCondition;
#else
        g_cond_free(priv->dataCondition);
#endif
        priv->dataCondition = 0;
    }

    if (priv->bufferMutex) {
#if GLIB_CHECK_VERSION(2, 31, 0)
        g_mutex_clear(priv->bufferMutex);
        delete priv->bufferMutex;
#else
        g_mutex_free(priv->bufferMutex);
#endif
        priv->bufferMutex = 0;
    }

    G_OBJECT_CLASS(parent_class)->dispose(object);
}
Exemple #22
0
static void
mainloop_proxy_free (MainLoopProxy *proxy)
{
  g_mutex_clear (&proxy->ack_lock);
  g_cond_clear (&proxy->ack_condition);
  g_free (proxy);
}
static void
free_session (GstRDTManagerSession * session)
{
  g_object_unref (session->jbuf);
  g_cond_clear (&session->jbuf_cond);
  g_mutex_clear (&session->jbuf_lock);
  g_free (session);
}
static void
gst_ks_video_src_stop_worker (GstKsVideoSrc * self)
{
    GstKsVideoSrcPrivate *priv = GST_KS_VIDEO_SRC_GET_PRIVATE (self);

    KS_WORKER_LOCK (priv);
    priv->worker_state = KS_WORKER_STATE_STOPPING;
    KS_WORKER_NOTIFY (priv);
    KS_WORKER_UNLOCK (priv);

    g_thread_join (priv->worker_thread);
    priv->worker_thread = NULL;

    g_cond_clear (&priv->worker_result_cond);
    g_cond_clear (&priv->worker_notify_cond);
    g_mutex_clear (&priv->worker_lock);
}
Exemple #25
0
void
gst_buffer_queue_free (GstBufferQueue * queue)
{
  gst_buffer_queue_flush (queue);
  g_cond_clear (&queue->cond);
  g_mutex_clear (&queue->lock);
  g_free (queue);
}
Exemple #26
0
void rm_buffer_pool_destroy(RmBufferPool *pool) {

    g_slist_free_full(pool->stack, (GDestroyNotify)rm_buffer_free);

    g_mutex_clear(&pool->lock);
    g_cond_clear(&pool->change);
    g_slice_free(RmBufferPool, pool);
}
OffscreenNativeWindow::~OffscreenNativeWindow()
{
	// XXX cleanup all used buffers
	g_cond_clear(&m_nextBufferCondition);
	g_mutex_clear(&m_bufferMutex);

	if (m_surfaceClient) delete m_surfaceClient; m_surfaceClient = NULL;
}
static void
write_data_unref (WriteData *write_data)
{
  if (g_atomic_int_dec_and_test (&write_data->ref_count)) {
    g_cond_clear (&write_data->cond);
    g_mutex_clear (&write_data->mutex);
    g_slice_free (WriteData, write_data);
  }
}
Exemple #29
0
static void
gst_gl_mixer_finalize (GObject * object)
{
  GstGLMixerPrivate *priv = GST_GL_MIXER (object)->priv;

  g_mutex_clear (&priv->gl_resource_lock);
  g_cond_clear (&priv->gl_resource_cond);
  G_OBJECT_CLASS (parent_class)->finalize (object);
}
/**
 * e_cancellable_mutex_clear:
 * @mutex: an #ECancellableMutex instance
 *
 * Frees memory allocated by e_cancellable_mutex_init().
 *
 * Since: 3.8
 **/
void
e_cancellable_mutex_clear (ECancellableMutex *mutex)
{
	g_return_if_fail (mutex != NULL);

	g_mutex_clear (&mutex->mutex);
	g_mutex_clear (&mutex->base.cond_mutex);
	g_cond_clear (&mutex->base.cond);
}