mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
inter: don't use deprecated GLib threading API
This commit is contained in:
parent
eef2324e4d
commit
632f2ac1c6
9 changed files with 20 additions and 22 deletions
|
@ -213,9 +213,9 @@ gst_inter_audio_sink_stop (GstBaseSink * sink)
|
|||
|
||||
GST_DEBUG ("stop");
|
||||
|
||||
g_mutex_lock (interaudiosink->surface->mutex);
|
||||
g_mutex_lock (&interaudiosink->surface->mutex);
|
||||
gst_adapter_clear (interaudiosink->surface->audio_adapter);
|
||||
g_mutex_unlock (interaudiosink->surface->mutex);
|
||||
g_mutex_unlock (&interaudiosink->surface->mutex);
|
||||
|
||||
gst_inter_surface_unref (interaudiosink->surface);
|
||||
interaudiosink->surface = NULL;
|
||||
|
@ -231,7 +231,7 @@ gst_inter_audio_sink_render (GstBaseSink * sink, GstBuffer * buffer)
|
|||
|
||||
GST_DEBUG ("render %" G_GSIZE_FORMAT, gst_buffer_get_size (buffer));
|
||||
|
||||
g_mutex_lock (interaudiosink->surface->mutex);
|
||||
g_mutex_lock (&interaudiosink->surface->mutex);
|
||||
n = gst_adapter_available (interaudiosink->surface->audio_adapter) / 4;
|
||||
#define SIZE 1600
|
||||
if (n > (SIZE * 3)) {
|
||||
|
@ -241,7 +241,7 @@ gst_inter_audio_sink_render (GstBaseSink * sink, GstBuffer * buffer)
|
|||
}
|
||||
gst_adapter_push (interaudiosink->surface->audio_adapter,
|
||||
gst_buffer_ref (buffer));
|
||||
g_mutex_unlock (interaudiosink->surface->mutex);
|
||||
g_mutex_unlock (&interaudiosink->surface->mutex);
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
|||
|
||||
buffer = NULL;
|
||||
|
||||
g_mutex_lock (interaudiosrc->surface->mutex);
|
||||
g_mutex_lock (&interaudiosrc->surface->mutex);
|
||||
n = gst_adapter_available (interaudiosrc->surface->audio_adapter) / 4;
|
||||
if (n > SIZE * 3) {
|
||||
GST_WARNING ("flushing %d samples", SIZE / 2);
|
||||
|
@ -285,7 +285,7 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
|||
buffer = gst_adapter_take_buffer (interaudiosrc->surface->audio_adapter,
|
||||
n * 4);
|
||||
}
|
||||
g_mutex_unlock (interaudiosrc->surface->mutex);
|
||||
g_mutex_unlock (&interaudiosrc->surface->mutex);
|
||||
|
||||
if (n < SIZE) {
|
||||
GstBuffer *newbuf = gst_buffer_new_and_alloc ((SIZE - n) * 4);
|
||||
|
|
|
@ -194,12 +194,12 @@ gst_inter_sub_sink_stop (GstBaseSink * sink)
|
|||
{
|
||||
GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (sink);
|
||||
|
||||
g_mutex_lock (intersubsink->surface->mutex);
|
||||
g_mutex_lock (&intersubsink->surface->mutex);
|
||||
if (intersubsink->surface->sub_buffer) {
|
||||
gst_buffer_unref (intersubsink->surface->sub_buffer);
|
||||
}
|
||||
intersubsink->surface->sub_buffer = NULL;
|
||||
g_mutex_unlock (intersubsink->surface->mutex);
|
||||
g_mutex_unlock (&intersubsink->surface->mutex);
|
||||
|
||||
gst_inter_surface_unref (intersubsink->surface);
|
||||
intersubsink->surface = NULL;
|
||||
|
@ -212,13 +212,13 @@ gst_inter_sub_sink_render (GstBaseSink * sink, GstBuffer * buffer)
|
|||
{
|
||||
GstInterSubSink *intersubsink = GST_INTER_SUB_SINK (sink);
|
||||
|
||||
g_mutex_lock (intersubsink->surface->mutex);
|
||||
g_mutex_lock (&intersubsink->surface->mutex);
|
||||
if (intersubsink->surface->sub_buffer) {
|
||||
gst_buffer_unref (intersubsink->surface->sub_buffer);
|
||||
}
|
||||
intersubsink->surface->sub_buffer = gst_buffer_ref (buffer);
|
||||
//intersubsink->surface->sub_buffer_count = 0;
|
||||
g_mutex_unlock (intersubsink->surface->mutex);
|
||||
g_mutex_unlock (&intersubsink->surface->mutex);
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ gst_inter_sub_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
|||
|
||||
buffer = NULL;
|
||||
|
||||
g_mutex_lock (intersubsrc->surface->mutex);
|
||||
g_mutex_lock (&intersubsrc->surface->mutex);
|
||||
if (intersubsrc->surface->sub_buffer) {
|
||||
buffer = gst_buffer_ref (intersubsrc->surface->sub_buffer);
|
||||
//intersubsrc->surface->sub_buffer_count++;
|
||||
|
@ -236,7 +236,7 @@ gst_inter_sub_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
|||
intersubsrc->surface->sub_buffer = NULL;
|
||||
//}
|
||||
}
|
||||
g_mutex_unlock (intersubsrc->surface->mutex);
|
||||
g_mutex_unlock (&intersubsrc->surface->mutex);
|
||||
|
||||
if (buffer == NULL) {
|
||||
GstMapInfo map;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <gst/glib-compat-private.h>
|
||||
#include "gstintersurface.h"
|
||||
|
||||
static GList *list;
|
||||
|
@ -48,7 +47,7 @@ gst_inter_surface_get (const char *name)
|
|||
|
||||
surface = g_malloc0 (sizeof (GstInterSurface));
|
||||
surface->name = g_strdup (name);
|
||||
surface->mutex = g_mutex_new ();
|
||||
g_mutex_init (&surface->mutex);
|
||||
surface->audio_adapter = gst_adapter_new ();
|
||||
|
||||
list = g_list_append (list, surface);
|
||||
|
|
|
@ -29,7 +29,7 @@ typedef struct _GstInterSurface GstInterSurface;
|
|||
|
||||
struct _GstInterSurface
|
||||
{
|
||||
GMutex *mutex;
|
||||
GMutex mutex;
|
||||
char *name;
|
||||
|
||||
/* video */
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#endif
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/glib-compat-private.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
//#define GETTEXT_PACKAGE "intertest"
|
||||
|
|
|
@ -206,12 +206,12 @@ gst_inter_video_sink_stop (GstBaseSink * sink)
|
|||
{
|
||||
GstInterVideoSink *intervideosink = GST_INTER_VIDEO_SINK (sink);
|
||||
|
||||
g_mutex_lock (intervideosink->surface->mutex);
|
||||
g_mutex_lock (&intervideosink->surface->mutex);
|
||||
if (intervideosink->surface->video_buffer) {
|
||||
gst_buffer_unref (intervideosink->surface->video_buffer);
|
||||
}
|
||||
intervideosink->surface->video_buffer = NULL;
|
||||
g_mutex_unlock (intervideosink->surface->mutex);
|
||||
g_mutex_unlock (&intervideosink->surface->mutex);
|
||||
|
||||
gst_inter_surface_unref (intervideosink->surface);
|
||||
intervideosink->surface = NULL;
|
||||
|
@ -224,13 +224,13 @@ gst_inter_video_sink_render (GstBaseSink * sink, GstBuffer * buffer)
|
|||
{
|
||||
GstInterVideoSink *intervideosink = GST_INTER_VIDEO_SINK (sink);
|
||||
|
||||
g_mutex_lock (intervideosink->surface->mutex);
|
||||
g_mutex_lock (&intervideosink->surface->mutex);
|
||||
if (intervideosink->surface->video_buffer) {
|
||||
gst_buffer_unref (intervideosink->surface->video_buffer);
|
||||
}
|
||||
intervideosink->surface->video_buffer = gst_buffer_ref (buffer);
|
||||
intervideosink->surface->video_buffer_count = 0;
|
||||
g_mutex_unlock (intervideosink->surface->mutex);
|
||||
g_mutex_unlock (&intervideosink->surface->mutex);
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
|||
|
||||
buffer = NULL;
|
||||
|
||||
g_mutex_lock (intervideosrc->surface->mutex);
|
||||
g_mutex_lock (&intervideosrc->surface->mutex);
|
||||
if (intervideosrc->surface->video_buffer) {
|
||||
buffer = gst_buffer_ref (intervideosrc->surface->video_buffer);
|
||||
intervideosrc->surface->video_buffer_count++;
|
||||
|
@ -265,7 +265,7 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
|||
intervideosrc->surface->video_buffer = NULL;
|
||||
}
|
||||
}
|
||||
g_mutex_unlock (intervideosrc->surface->mutex);
|
||||
g_mutex_unlock (&intervideosrc->surface->mutex);
|
||||
|
||||
if (buffer == NULL) {
|
||||
GstMapInfo map;
|
||||
|
|
Loading…
Reference in a new issue