+2005-11-21 Andy Wingo <wingo@pobox.com>
+
+ * *.h:
+ * *.c: Ran scripts/update-macros. Oh yes.
+
2005-11-21 Tim-Philipp Müller <tim at centricular dot net>
* sys/ximage/Makefile.am:
}
/* store start and stop values */
- GST_LOCK (ogg);
+ GST_OBJECT_LOCK (ogg);
ogg->segment_rate = rate;
ogg->segment_flags = flags;
ogg->segment_start = cur;
/* check if we can do the seek now */
if (running)
*running = ogg->running;
- GST_UNLOCK (ogg);
+ GST_OBJECT_UNLOCK (ogg);
return TRUE;
* forever. */
GST_STREAM_LOCK (ogg->sinkpad);
- GST_LOCK (ogg);
+ GST_OBJECT_LOCK (ogg);
/* nothing configured, play complete file */
if (ogg->segment_start == GST_CLOCK_TIME_NONE)
start = 0;
stop = ogg->total_time;
else
stop = CLAMP (ogg->segment_stop, 0, ogg->total_time);
- GST_UNLOCK (ogg);
+ GST_OBJECT_UNLOCK (ogg);
/* we need to stop flushing on the srcpad as we're going to use it
* next. We can do this as we have the STREAM lock now. */
ogg->need_chains = FALSE;
- GST_LOCK (ogg);
+ GST_OBJECT_LOCK (ogg);
ogg->running = TRUE;
- GST_UNLOCK (ogg);
+ GST_OBJECT_UNLOCK (ogg);
/* and seek to configured positions without FLUSH */
gst_ogg_demux_perform_seek (ogg);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ogg_demux_clear_chains (ogg);
- GST_LOCK (ogg);
+ GST_OBJECT_LOCK (ogg);
ogg->running = FALSE;
ogg->segment_rate = 1.0;
ogg->segment_flags = GST_SEEK_FLAG_NONE;
ogg->segment_start = GST_CLOCK_TIME_NONE;
ogg->segment_stop = GST_CLOCK_TIME_NONE;
- GST_UNLOCK (ogg);
+ GST_OBJECT_UNLOCK (ogg);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
ogg_sync_clear (&ogg->sync);
gst_buffer_ref (buf);
} else {
/* fixme -- should be caught in the previous list traversal. */
- GST_LOCK (pad);
+ GST_OBJECT_LOCK (pad);
g_critical ("No headers or buffers on pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
- GST_UNLOCK (pad);
+ GST_OBJECT_UNLOCK (pad);
continue;
}
{
GstCaps *caps;
- GST_LOCK (pad);
+ GST_OBJECT_LOCK (pad);
if (!(caps = GST_PAD_CAPS (pad)))
caps = (GstCaps *) gst_pad_get_pad_template_caps (pad);
caps = gst_caps_ref (caps);
- GST_UNLOCK (pad);
+ GST_OBJECT_UNLOCK (pad);
return caps;
}
typedef struct _GstAudioRingBufferClass GstAudioRingBufferClass;
#define GST_AUDIORING_BUFFER_GET_COND(buf) (((GstAudioRingBuffer *)buf)->cond)
-#define GST_AUDIORING_BUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORING_BUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
+#define GST_AUDIORING_BUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORING_BUFFER_GET_COND (buf), GST_OBJECT_GET_LOCK (buf)))
#define GST_AUDIORING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_AUDIORING_BUFFER_GET_COND (buf)))
#define GST_AUDIORING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_AUDIORING_BUFFER_GET_COND (buf)))
/* we wrote one segment */
gst_ring_buffer_advance (buf, 1);
} else {
- GST_LOCK (abuf);
+ GST_OBJECT_LOCK (abuf);
if (!abuf->running)
goto stop_running;
GST_DEBUG ("signal wait");
if (!abuf->running)
goto stop_running;
GST_DEBUG ("continue running");
- GST_UNLOCK (abuf);
+ GST_OBJECT_UNLOCK (abuf);
}
}
GST_DEBUG ("exit thread");
}
stop_running:
{
- GST_UNLOCK (abuf);
+ GST_OBJECT_UNLOCK (abuf);
GST_DEBUG ("stop running, exit thread");
return;
}
abuf->running = FALSE;
GST_AUDIORING_BUFFER_SIGNAL (buf);
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
/* join the thread */
g_thread_join (sink->thread);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
/* free the buffer */
gst_buffer_unref (buf->data);
typedef struct _GstAudioRingBufferClass GstAudioRingBufferClass;
#define GST_AUDIORING_BUFFER_GET_COND(buf) (((GstAudioRingBuffer *)buf)->cond)
-#define GST_AUDIORING_BUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORING_BUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
+#define GST_AUDIORING_BUFFER_WAIT(buf) (g_cond_wait (GST_AUDIORING_BUFFER_GET_COND (buf), GST_OBJECT_GET_LOCK (buf)))
#define GST_AUDIORING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_AUDIORING_BUFFER_GET_COND (buf)))
#define GST_AUDIORING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_AUDIORING_BUFFER_GET_COND (buf)))
/* we read one segment */
gst_ring_buffer_advance (buf, 1);
} else {
- GST_LOCK (abuf);
+ GST_OBJECT_LOCK (abuf);
if (!abuf->running)
goto stop_running;
GST_DEBUG ("signal wait");
if (!abuf->running)
goto stop_running;
GST_DEBUG ("continue running");
- GST_UNLOCK (abuf);
+ GST_OBJECT_UNLOCK (abuf);
}
}
GST_DEBUG ("exit thread");
}
stop_running:
{
- GST_UNLOCK (abuf);
+ GST_OBJECT_UNLOCK (abuf);
GST_DEBUG ("stop running, exit thread");
return;
}
abuf->running = FALSE;
GST_AUDIORING_BUFFER_SIGNAL (buf);
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
/* join the thread */
g_thread_join (src->thread);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
/* free the buffer */
gst_buffer_unref (buf->data);
{
g_return_if_fail (buf != NULL);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
buf->callback = cb;
buf->cb_data = user_data;
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
}
GST_DEBUG_OBJECT (buf, "opening device");
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (buf->open) {
g_warning ("Device for ring buffer %p already open, fix your code", buf);
res = TRUE;
}
done:
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
GST_DEBUG_OBJECT (buf, "closing device");
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (!buf->open) {
g_warning ("Device for ring buffer %p already closed, fix your code", buf);
res = TRUE;
}
done:
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
g_return_val_if_fail (GST_IS_RING_BUFFER (buf), FALSE);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
res = buf->open;
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
GST_DEBUG_OBJECT (buf, "acquiring device");
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (!buf->open) {
g_critical ("Device for %p not opened", buf);
res = FALSE;
}
}
done:
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
gst_ring_buffer_stop (buf);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (!buf->acquired) {
res = TRUE;
GST_DEBUG_OBJECT (buf, "device was released");
}
done:
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
g_return_val_if_fail (buf != NULL, FALSE);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
res = buf->acquired;
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
void
gst_ring_buffer_set_flushing (GstRingBuffer * buf, gboolean flushing)
{
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
buf->flushing = flushing;
gst_ring_buffer_clear_all (buf);
gst_ring_buffer_pause_unlocked (buf);
}
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
}
GST_DEBUG_OBJECT (buf, "starting ringbuffer");
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (buf->flushing)
goto flushing;
}
done:
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
flushing:
{
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return FALSE;
}
}
g_return_val_if_fail (buf != NULL, FALSE);
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (buf->flushing)
goto flushing;
res = gst_ring_buffer_pause_unlocked (buf);
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
flushing:
{
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return FALSE;
}
}
GST_DEBUG_OBJECT (buf, "stopping");
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
/* if started, set to stopped */
res = g_atomic_int_compare_and_exchange (&buf->state,
GST_DEBUG_OBJECT (buf, "stopped");
}
done:
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return res;
}
}
/* take lock first, then update our waiting flag */
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
if (buf->flushing)
goto flushing;
if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED)
goto not_started;
}
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
return TRUE;
/* ERROR */
not_started:
{
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
GST_DEBUG ("stopped processing");
return FALSE;
}
flushing:
{
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
GST_DEBUG ("flushing");
return FALSE;
}
* we grab the lock as well to make sure the waiter is actually
* waiting for the signal */
if (g_atomic_int_compare_and_exchange (&buf->waiting, 1, 0)) {
- GST_LOCK (buf);
+ GST_OBJECT_LOCK (buf);
GST_DEBUG ("signal waiter");
GST_RING_BUFFER_SIGNAL (buf);
- GST_UNLOCK (buf);
+ GST_OBJECT_UNLOCK (buf);
}
}
};
#define GST_RING_BUFFER_GET_COND(buf) (((GstRingBuffer *)buf)->cond)
-#define GST_RING_BUFFER_WAIT(buf) (g_cond_wait (GST_RING_BUFFER_GET_COND (buf), GST_GET_LOCK (buf)))
+#define GST_RING_BUFFER_WAIT(buf) (g_cond_wait (GST_RING_BUFFER_GET_COND (buf), GST_OBJECT_GET_LOCK (buf)))
#define GST_RING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_RING_BUFFER_GET_COND (buf)))
#define GST_RING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_RING_BUFFER_GET_COND (buf)))
adder = GST_ADDER (GST_PAD_PARENT (pad));
/* see if the other pads can accept the format */
- GST_LOCK (adder);
+ GST_OBJECT_LOCK (adder);
pads = GST_ELEMENT (adder)->pads;
while (pads) {
GstPad *otherpad = GST_PAD (pads->data);
}
pads = g_list_next (pads);
}
- GST_UNLOCK (adder);
+ GST_OBJECT_UNLOCK (adder);
/* parse caps now */
structure = gst_caps_get_structure (caps, 0);
GstDecodeBin *decode_bin = dynamic->decode_bin;
GstCaps *caps;
- GST_LOCK (decode_bin);
+ GST_OBJECT_LOCK (decode_bin);
if (decode_bin->shutting_down)
goto shutting_down1;
- GST_UNLOCK (decode_bin);
+ GST_OBJECT_UNLOCK (decode_bin);
GST_STATE_LOCK (decode_bin);
if (decode_bin->shutting_down)
return;
shutting_down1:
- GST_UNLOCK (decode_bin);
+ GST_OBJECT_UNLOCK (decode_bin);
return;
shutting_down2:
decode_bin->dynamics = NULL;
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- GST_LOCK (decode_bin);
+ GST_OBJECT_LOCK (decode_bin);
decode_bin->shutting_down = FALSE;
- GST_UNLOCK (decode_bin);
+ GST_OBJECT_UNLOCK (decode_bin);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- GST_LOCK (decode_bin);
+ GST_OBJECT_LOCK (decode_bin);
decode_bin->shutting_down = TRUE;
- GST_UNLOCK (decode_bin);
+ GST_OBJECT_UNLOCK (decode_bin);
break;
default:
break;