mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
libs: cleanups for 0.11
Remove deprecated stuff, fix padding, rearrange methods.
This commit is contained in:
parent
5dd9ab1cab
commit
1218511185
8 changed files with 107 additions and 158 deletions
|
@ -52,6 +52,7 @@ struct _GstAdapter {
|
|||
|
||||
/*< private >*/
|
||||
GSList * buflist;
|
||||
GSList * buflist_end;
|
||||
guint size;
|
||||
guint skip;
|
||||
|
||||
|
@ -60,14 +61,9 @@ struct _GstAdapter {
|
|||
guint assembled_size;
|
||||
guint assembled_len;
|
||||
|
||||
/* ABI added */
|
||||
/* Remember where the end of our buffer list is to
|
||||
* speed up the push */
|
||||
GSList *buflist_end;
|
||||
|
||||
GstAdapterPrivate *priv;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING - 2];
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstAdapterClass {
|
||||
|
|
|
@ -696,14 +696,14 @@ gst_base_sink_init (GstBaseSink * basesink, gpointer g_class)
|
|||
|
||||
basesink->pad_mode = GST_ACTIVATE_NONE;
|
||||
basesink->preroll_queue = g_queue_new ();
|
||||
basesink->abidata.ABI.clip_segment = gst_segment_new ();
|
||||
basesink->clip_segment = gst_segment_new ();
|
||||
priv->have_latency = FALSE;
|
||||
|
||||
basesink->can_activate_push = DEFAULT_CAN_ACTIVATE_PUSH;
|
||||
basesink->can_activate_pull = DEFAULT_CAN_ACTIVATE_PULL;
|
||||
|
||||
basesink->sync = DEFAULT_SYNC;
|
||||
basesink->abidata.ABI.max_lateness = DEFAULT_MAX_LATENESS;
|
||||
basesink->max_lateness = DEFAULT_MAX_LATENESS;
|
||||
g_atomic_int_set (&priv->qos_enabled, DEFAULT_QOS);
|
||||
priv->async_enabled = DEFAULT_ASYNC;
|
||||
priv->ts_offset = DEFAULT_TS_OFFSET;
|
||||
|
@ -724,7 +724,7 @@ gst_base_sink_finalize (GObject * object)
|
|||
basesink = GST_BASE_SINK (object);
|
||||
|
||||
g_queue_free (basesink->preroll_queue);
|
||||
gst_segment_free (basesink->abidata.ABI.clip_segment);
|
||||
gst_segment_free (basesink->clip_segment);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ gst_base_sink_set_max_lateness (GstBaseSink * sink, gint64 max_lateness)
|
|||
g_return_if_fail (GST_IS_BASE_SINK (sink));
|
||||
|
||||
GST_OBJECT_LOCK (sink);
|
||||
sink->abidata.ABI.max_lateness = max_lateness;
|
||||
sink->max_lateness = max_lateness;
|
||||
GST_OBJECT_UNLOCK (sink);
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ gst_base_sink_get_max_lateness (GstBaseSink * sink)
|
|||
g_return_val_if_fail (GST_IS_BASE_SINK (sink), -1);
|
||||
|
||||
GST_OBJECT_LOCK (sink);
|
||||
res = sink->abidata.ABI.max_lateness;
|
||||
res = sink->max_lateness;
|
||||
GST_OBJECT_UNLOCK (sink);
|
||||
|
||||
return res;
|
||||
|
@ -1564,7 +1564,6 @@ gst_base_sink_commit_state (GstBaseSink * basesink)
|
|||
case GST_STATE_PLAYING:
|
||||
{
|
||||
GstBaseSinkClass *bclass;
|
||||
GstStateChangeReturn ret;
|
||||
|
||||
bclass = GST_BASE_SINK_GET_CLASS (basesink);
|
||||
|
||||
|
@ -1578,14 +1577,6 @@ gst_base_sink_commit_state (GstBaseSink * basesink)
|
|||
if (current == GST_STATE_READY) {
|
||||
post_paused = TRUE;
|
||||
}
|
||||
|
||||
/* make sure we notify the subclass of async playing */
|
||||
if (bclass->async_play) {
|
||||
GST_WARNING_OBJECT (basesink, "deprecated async_play");
|
||||
ret = bclass->async_play (basesink);
|
||||
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||
goto async_failed;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_STATE_PAUSED:
|
||||
|
@ -1670,13 +1661,6 @@ stopping:
|
|||
GST_OBJECT_UNLOCK (basesink);
|
||||
return FALSE;
|
||||
}
|
||||
async_failed:
|
||||
{
|
||||
GST_DEBUG_OBJECT (basesink, "async commit failed");
|
||||
GST_STATE_RETURN (basesink) = GST_STATE_CHANGE_FAILURE;
|
||||
GST_OBJECT_UNLOCK (basesink);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1803,7 +1787,7 @@ stop_stepping (GstBaseSink * sink, GstSegment * segment,
|
|||
segment->start = current->start_start;
|
||||
|
||||
/* the clip segment is used for position report in paused... */
|
||||
memcpy (sink->abidata.ABI.clip_segment, segment, sizeof (GstSegment));
|
||||
memcpy (sink->clip_segment, segment, sizeof (GstSegment));
|
||||
|
||||
/* post the step done when we know the stepped duration in TIME */
|
||||
message =
|
||||
|
@ -2824,7 +2808,7 @@ gst_base_sink_is_too_late (GstBaseSink * basesink, GstMiniObject * obj,
|
|||
if (G_LIKELY (status != GST_CLOCK_EARLY))
|
||||
goto in_time;
|
||||
|
||||
max_lateness = basesink->abidata.ABI.max_lateness;
|
||||
max_lateness = basesink->max_lateness;
|
||||
|
||||
/* check if frame dropping is enabled */
|
||||
if (max_lateness == -1)
|
||||
|
@ -3401,7 +3385,7 @@ gst_base_sink_flush_stop (GstBaseSink * basesink, GstPad * pad)
|
|||
/* we need new segment info after the flush. */
|
||||
basesink->have_newsegment = FALSE;
|
||||
gst_segment_init (&basesink->segment, GST_FORMAT_UNDEFINED);
|
||||
gst_segment_init (basesink->abidata.ABI.clip_segment, GST_FORMAT_UNDEFINED);
|
||||
gst_segment_init (basesink->clip_segment, GST_FORMAT_UNDEFINED);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (basesink);
|
||||
}
|
||||
|
@ -3471,7 +3455,7 @@ gst_base_sink_event (GstPad * pad, GstEvent * event)
|
|||
* we need to configure the current clipping segment and insert the event
|
||||
* in the queue to serialize it with the buffers for rendering. */
|
||||
gst_base_sink_configure_segment (basesink, pad, event,
|
||||
basesink->abidata.ABI.clip_segment);
|
||||
basesink->clip_segment);
|
||||
|
||||
ret =
|
||||
gst_base_sink_queue_object_unlocked (basesink, pad,
|
||||
|
@ -3608,7 +3592,7 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
|
|||
}
|
||||
|
||||
/* for code clarity */
|
||||
clip_segment = basesink->abidata.ABI.clip_segment;
|
||||
clip_segment = basesink->clip_segment;
|
||||
|
||||
if (G_UNLIKELY (!basesink->have_newsegment)) {
|
||||
gboolean sync;
|
||||
|
@ -3933,7 +3917,7 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
|
|||
GST_DEBUG_OBJECT (sink, "stop flushing upstream");
|
||||
gst_pad_push_event (pad, gst_event_new_flush_stop ());
|
||||
gst_base_sink_flush_stop (sink, pad);
|
||||
} else if (res && sink->abidata.ABI.running) {
|
||||
} else if (res && sink->running) {
|
||||
/* we are running the current segment and doing a non-flushing seek,
|
||||
* close the segment first based on the last_stop. */
|
||||
GST_DEBUG_OBJECT (sink, "closing running segment %" G_GINT64_FORMAT
|
||||
|
@ -3961,7 +3945,7 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
sink->priv->discont = TRUE;
|
||||
sink->abidata.ABI.running = TRUE;
|
||||
sink->running = TRUE;
|
||||
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
|
||||
|
@ -4393,7 +4377,7 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
format = GST_FORMAT_BYTES;
|
||||
|
||||
gst_segment_init (&basesink->segment, format);
|
||||
gst_segment_init (basesink->abidata.ABI.clip_segment, format);
|
||||
gst_segment_init (basesink->clip_segment, format);
|
||||
GST_OBJECT_LOCK (basesink);
|
||||
basesink->have_newsegment = TRUE;
|
||||
GST_OBJECT_UNLOCK (basesink);
|
||||
|
@ -4403,8 +4387,7 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
if (result) {
|
||||
GST_DEBUG_OBJECT (basesink,
|
||||
"setting duration in bytes to %" G_GINT64_FORMAT, duration);
|
||||
gst_segment_set_duration (basesink->abidata.ABI.clip_segment, format,
|
||||
duration);
|
||||
gst_segment_set_duration (basesink->clip_segment, format, duration);
|
||||
gst_segment_set_duration (&basesink->segment, format, duration);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (basesink, "unknown duration");
|
||||
|
@ -4548,7 +4531,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
|||
* main segment directly with the new segment values without it having to be
|
||||
* activated by the rendering after preroll */
|
||||
if (basesink->pad_mode == GST_ACTIVATE_PUSH)
|
||||
segment = basesink->abidata.ABI.clip_segment;
|
||||
segment = basesink->clip_segment;
|
||||
else
|
||||
segment = &basesink->segment;
|
||||
|
||||
|
@ -4943,8 +4926,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
GST_DEBUG_OBJECT (basesink, "READY to PAUSED");
|
||||
basesink->have_newsegment = FALSE;
|
||||
gst_segment_init (&basesink->segment, GST_FORMAT_UNDEFINED);
|
||||
gst_segment_init (basesink->abidata.ABI.clip_segment,
|
||||
GST_FORMAT_UNDEFINED);
|
||||
gst_segment_init (basesink->clip_segment, GST_FORMAT_UNDEFINED);
|
||||
basesink->offset = 0;
|
||||
basesink->have_preroll = FALSE;
|
||||
priv->step_unlock = FALSE;
|
||||
|
|
|
@ -80,26 +80,21 @@ struct _GstBaseSink {
|
|||
/*< protected >*/ /* with STREAM_LOCK */
|
||||
gboolean have_newsegment;
|
||||
GstSegment segment;
|
||||
GstSegment *clip_segment;
|
||||
|
||||
/*< private >*/ /* with LOCK */
|
||||
GstClockID clock_id;
|
||||
GstClockTime end_time;
|
||||
gboolean sync;
|
||||
gboolean flushing;
|
||||
gboolean running;
|
||||
|
||||
gint64 max_lateness;
|
||||
|
||||
/*< private >*/
|
||||
union {
|
||||
struct {
|
||||
/* segment used for clipping incoming buffers */
|
||||
GstSegment *clip_segment;
|
||||
/* max amount of time a buffer can be late, -1 no limit. */
|
||||
gint64 max_lateness;
|
||||
gboolean running;
|
||||
} ABI;
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE - 1];
|
||||
} abidata;
|
||||
|
||||
GstBaseSinkPrivate *priv;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -146,6 +141,11 @@ struct _GstBaseSinkClass {
|
|||
/* notify subclass of new caps */
|
||||
gboolean (*set_caps) (GstBaseSink *sink, GstCaps *caps);
|
||||
|
||||
/* fixate sink caps during pull-mode negotiation */
|
||||
void (*fixate) (GstBaseSink *sink, GstCaps *caps);
|
||||
/* start or stop a pulling thread */
|
||||
gboolean (*activate_pull)(GstBaseSink *sink, gboolean active);
|
||||
|
||||
/* allocate a new buffer with given caps */
|
||||
GstFlowReturn (*buffer_alloc) (GstBaseSink *sink, guint64 offset, guint size,
|
||||
GstCaps *caps, GstBuffer **buf);
|
||||
|
@ -161,33 +161,21 @@ struct _GstBaseSinkClass {
|
|||
/* unlock any pending access to the resource. subclasses should unlock
|
||||
* any function ASAP. */
|
||||
gboolean (*unlock) (GstBaseSink *sink);
|
||||
|
||||
/* notify subclass of event, preroll buffer or real buffer */
|
||||
gboolean (*event) (GstBaseSink *sink, GstEvent *event);
|
||||
GstFlowReturn (*preroll) (GstBaseSink *sink, GstBuffer *buffer);
|
||||
GstFlowReturn (*render) (GstBaseSink *sink, GstBuffer *buffer);
|
||||
|
||||
/* ABI additions */
|
||||
|
||||
/* when an ASYNC state change to PLAYING happens */ /* with LOCK */
|
||||
GstStateChangeReturn (*async_play) (GstBaseSink *sink);
|
||||
|
||||
/* start or stop a pulling thread */
|
||||
gboolean (*activate_pull)(GstBaseSink *sink, gboolean active);
|
||||
|
||||
/* fixate sink caps during pull-mode negotiation */
|
||||
void (*fixate) (GstBaseSink *sink, GstCaps *caps);
|
||||
|
||||
/* Clear a previously indicated unlock request not that unlocking is
|
||||
* complete. Sub-classes should clear any command queue or indicator they
|
||||
* set during unlock */
|
||||
gboolean (*unlock_stop) (GstBaseSink *sink);
|
||||
|
||||
/* notify subclass of event, preroll buffer or real buffer */
|
||||
gboolean (*event) (GstBaseSink *sink, GstEvent *event);
|
||||
|
||||
GstFlowReturn (*preroll) (GstBaseSink *sink, GstBuffer *buffer);
|
||||
GstFlowReturn (*render) (GstBaseSink *sink, GstBuffer *buffer);
|
||||
/* Render a BufferList */
|
||||
GstFlowReturn (*render_list) (GstBaseSink *sink, GstBufferList *buffer_list);
|
||||
|
||||
/*< private >*/
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE-5];
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE];
|
||||
};
|
||||
|
||||
GType gst_base_sink_get_type(void);
|
||||
|
|
|
@ -436,7 +436,7 @@ gst_base_src_init (GstBaseSrc * basesrc, gpointer g_class)
|
|||
basesrc->clock_id = NULL;
|
||||
/* we operate in BYTES by default */
|
||||
gst_base_src_set_format (basesrc, GST_FORMAT_BYTES);
|
||||
basesrc->data.ABI.typefind = DEFAULT_TYPEFIND;
|
||||
basesrc->typefind = DEFAULT_TYPEFIND;
|
||||
basesrc->priv->do_timestamp = DEFAULT_DO_TIMESTAMP;
|
||||
g_atomic_int_set (&basesrc->priv->have_tags, FALSE);
|
||||
|
||||
|
@ -457,7 +457,7 @@ gst_base_src_finalize (GObject * object)
|
|||
g_mutex_free (basesrc->live_lock);
|
||||
g_cond_free (basesrc->live_cond);
|
||||
|
||||
event_p = &basesrc->data.ABI.pending_seek;
|
||||
event_p = &basesrc->pending_seek;
|
||||
gst_event_replace (event_p, NULL);
|
||||
|
||||
if (basesrc->priv->pending_tags) {
|
||||
|
@ -755,7 +755,7 @@ gst_base_src_new_seamless_segment (GstBaseSrc * src, gint64 start, gint64 stop,
|
|||
GST_TIME_ARGS (stop), GST_TIME_ARGS (position));
|
||||
|
||||
GST_OBJECT_LOCK (src);
|
||||
if (src->data.ABI.running && !src->priv->newsegment_pending) {
|
||||
if (src->running && !src->priv->newsegment_pending) {
|
||||
if (src->priv->close_segment)
|
||||
gst_event_unref (src->priv->close_segment);
|
||||
src->priv->close_segment =
|
||||
|
@ -785,7 +785,7 @@ gst_base_src_new_seamless_segment (GstBaseSrc * src, gint64 start, gint64 stop,
|
|||
GST_OBJECT_UNLOCK (src);
|
||||
|
||||
src->priv->discont = TRUE;
|
||||
src->data.ABI.running = TRUE;
|
||||
src->running = TRUE;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -1409,7 +1409,7 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
|
|||
/* send flush stop, peer will accept data and events again. We
|
||||
* are not yet providing data as we still have the STREAM_LOCK. */
|
||||
gst_pad_push_event (src->srcpad, tevent);
|
||||
} else if (res && src->data.ABI.running) {
|
||||
} else if (res && src->running) {
|
||||
/* we are running the current segment and doing a non-flushing seek,
|
||||
* close the segment first based on the last_stop. */
|
||||
GST_DEBUG_OBJECT (src, "closing running segment %" G_GINT64_FORMAT
|
||||
|
@ -1480,7 +1480,7 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
|
|||
}
|
||||
|
||||
src->priv->discont = TRUE;
|
||||
src->data.ABI.running = TRUE;
|
||||
src->running = TRUE;
|
||||
/* and restart the task in case it got paused explicitly or by
|
||||
* the FLUSH_START event we pushed out. */
|
||||
tres = gst_pad_start_task (src->srcpad, (GstTaskFunction) gst_base_src_loop,
|
||||
|
@ -1624,7 +1624,7 @@ gst_base_src_send_event (GstElement * element, GstEvent * event)
|
|||
* get activated */
|
||||
GST_OBJECT_LOCK (src);
|
||||
GST_DEBUG_OBJECT (src, "queueing seek");
|
||||
event_p = &src->data.ABI.pending_seek;
|
||||
event_p = &src->pending_seek;
|
||||
gst_event_replace ((GstEvent **) event_p, event);
|
||||
GST_OBJECT_UNLOCK (src);
|
||||
/* assume the seek will work */
|
||||
|
@ -1795,7 +1795,7 @@ gst_base_src_set_property (GObject * object, guint prop_id,
|
|||
src->num_buffers = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_TYPEFIND:
|
||||
src->data.ABI.typefind = g_value_get_boolean (value);
|
||||
src->typefind = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_DO_TIMESTAMP:
|
||||
gst_base_src_set_do_timestamp (src, g_value_get_boolean (value));
|
||||
|
@ -1822,7 +1822,7 @@ gst_base_src_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
g_value_set_int (value, src->num_buffers);
|
||||
break;
|
||||
case PROP_TYPEFIND:
|
||||
g_value_set_boolean (value, src->data.ABI.typefind);
|
||||
g_value_set_boolean (value, src->typefind);
|
||||
break;
|
||||
case PROP_DO_TIMESTAMP:
|
||||
g_value_set_boolean (value, gst_base_src_get_do_timestamp (src));
|
||||
|
@ -2535,7 +2535,7 @@ pause:
|
|||
GstEvent *event;
|
||||
|
||||
GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
|
||||
src->data.ABI.running = FALSE;
|
||||
src->running = FALSE;
|
||||
gst_pad_pause_task (pad);
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
gboolean flag_segment;
|
||||
|
@ -2699,7 +2699,7 @@ gst_base_src_start (GstBaseSrc * basesrc)
|
|||
gst_segment_init (&basesrc->segment, basesrc->segment.format);
|
||||
GST_OBJECT_UNLOCK (basesrc);
|
||||
|
||||
basesrc->data.ABI.running = FALSE;
|
||||
basesrc->running = FALSE;
|
||||
basesrc->priv->newsegment_pending = FALSE;
|
||||
|
||||
bclass = GST_BASE_SRC_GET_CLASS (basesrc);
|
||||
|
@ -2748,7 +2748,7 @@ gst_base_src_start (GstBaseSrc * basesrc)
|
|||
GST_DEBUG_OBJECT (basesrc, "is random_access: %d", basesrc->random_access);
|
||||
|
||||
/* run typefind if we are random_access and the typefinding is enabled. */
|
||||
if (basesrc->random_access && basesrc->data.ABI.typefind && size != -1) {
|
||||
if (basesrc->random_access && basesrc->typefind && size != -1) {
|
||||
GstCaps *caps;
|
||||
|
||||
if (!(caps = gst_type_find_helper (basesrc->srcpad, size)))
|
||||
|
@ -2939,8 +2939,8 @@ gst_base_src_activate_push (GstPad * pad, gboolean active)
|
|||
|
||||
/* do initial seek, which will start the task */
|
||||
GST_OBJECT_LOCK (basesrc);
|
||||
event = basesrc->data.ABI.pending_seek;
|
||||
basesrc->data.ABI.pending_seek = NULL;
|
||||
event = basesrc->pending_seek;
|
||||
basesrc->pending_seek = NULL;
|
||||
GST_OBJECT_UNLOCK (basesrc);
|
||||
|
||||
/* no need to unlock anything, the task is certainly
|
||||
|
@ -3104,7 +3104,7 @@ gst_base_src_change_state (GstElement * element, GstStateChange transition)
|
|||
basesrc->priv->last_sent_eos = TRUE;
|
||||
}
|
||||
g_atomic_int_set (&basesrc->priv->pending_eos, FALSE);
|
||||
event_p = &basesrc->data.ABI.pending_seek;
|
||||
event_p = &basesrc->pending_seek;
|
||||
gst_event_replace (event_p, NULL);
|
||||
event_p = &basesrc->priv->close_segment;
|
||||
gst_event_replace (event_p, NULL);
|
||||
|
|
|
@ -101,18 +101,14 @@ struct _GstBaseSrc {
|
|||
gint num_buffers;
|
||||
gint num_buffers_left;
|
||||
|
||||
/*< private >*/
|
||||
union {
|
||||
struct {
|
||||
/* FIXME: those fields should be moved into the private struct */
|
||||
gboolean typefind;
|
||||
gboolean running;
|
||||
GstEvent *pending_seek;
|
||||
} ABI;
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE-1];
|
||||
} data;
|
||||
gboolean typefind;
|
||||
gboolean running;
|
||||
GstEvent *pending_seek;
|
||||
|
||||
GstBaseSrcPrivate *priv;
|
||||
|
||||
/*< private >*/
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -178,9 +174,8 @@ struct _GstBaseSrcClass {
|
|||
|
||||
/* decide on caps */
|
||||
gboolean (*negotiate) (GstBaseSrc *src);
|
||||
|
||||
/* generate and send a newsegment (UNUSED) */
|
||||
gboolean (*newsegment) (GstBaseSrc *src);
|
||||
/* called if, in negotiation, caps need fixating */
|
||||
void (*fixate) (GstBaseSrc *src, GstCaps *caps);
|
||||
|
||||
/* start and stop processing, ideal for opening/closing the resource */
|
||||
gboolean (*start) (GstBaseSrc *src);
|
||||
|
@ -196,23 +191,6 @@ struct _GstBaseSrcClass {
|
|||
|
||||
/* check if the resource is seekable */
|
||||
gboolean (*is_seekable) (GstBaseSrc *src);
|
||||
/* unlock any pending access to the resource. subclasses should unlock
|
||||
* any function ASAP. */
|
||||
gboolean (*unlock) (GstBaseSrc *src);
|
||||
|
||||
/* notify subclasses of an event */
|
||||
gboolean (*event) (GstBaseSrc *src, GstEvent *event);
|
||||
|
||||
/* ask the subclass to create a buffer with offset and size */
|
||||
GstFlowReturn (*create) (GstBaseSrc *src, guint64 offset, guint size,
|
||||
GstBuffer **buf);
|
||||
|
||||
/* additions that change padding... */
|
||||
/* notify subclasses of a seek */
|
||||
gboolean (*do_seek) (GstBaseSrc *src, GstSegment *segment);
|
||||
/* notify subclasses of a query */
|
||||
gboolean (*query) (GstBaseSrc *src, GstQuery *query);
|
||||
|
||||
/* check whether the source would support pull-based operation if
|
||||
* it were to be opened now. This vfunc is optional, but should be
|
||||
* implemented if possible to avoid unnecessary start/stop cycles.
|
||||
|
@ -221,19 +199,31 @@ struct _GstBaseSrcClass {
|
|||
* undesirable. */
|
||||
gboolean (*check_get_range) (GstBaseSrc *src);
|
||||
|
||||
/* called if, in negotiation, caps need fixating */
|
||||
void (*fixate) (GstBaseSrc *src, GstCaps *caps);
|
||||
|
||||
/* Clear any pending unlock request, as we succeeded in unlocking */
|
||||
gboolean (*unlock_stop) (GstBaseSrc *src);
|
||||
|
||||
/* Prepare the segment on which to perform do_seek(), converting to the
|
||||
* current basesrc format. */
|
||||
gboolean (*prepare_seek_segment) (GstBaseSrc *src, GstEvent *seek,
|
||||
GstSegment *segment);
|
||||
/* notify subclasses of a seek */
|
||||
gboolean (*do_seek) (GstBaseSrc *src, GstSegment *segment);
|
||||
|
||||
/* unlock any pending access to the resource. subclasses should unlock
|
||||
* any function ASAP. */
|
||||
gboolean (*unlock) (GstBaseSrc *src);
|
||||
/* Clear any pending unlock request, as we succeeded in unlocking */
|
||||
gboolean (*unlock_stop) (GstBaseSrc *src);
|
||||
|
||||
/* notify subclasses of a query */
|
||||
gboolean (*query) (GstBaseSrc *src, GstQuery *query);
|
||||
|
||||
/* notify subclasses of an event */
|
||||
gboolean (*event) (GstBaseSrc *src, GstEvent *event);
|
||||
|
||||
/* ask the subclass to create a buffer with offset and size */
|
||||
GstFlowReturn (*create) (GstBaseSrc *src, guint64 offset, guint size,
|
||||
GstBuffer **buf);
|
||||
|
||||
/*< private >*/
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE - 6];
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE];
|
||||
};
|
||||
|
||||
GType gst_base_src_get_type (void);
|
||||
|
|
|
@ -138,7 +138,7 @@ struct _GstBaseTransform {
|
|||
/*< private >*/
|
||||
GstBaseTransformPrivate *priv;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE - 1];
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -199,8 +199,9 @@ struct _GstBaseTransformClass {
|
|||
GstElementClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* virtual methods for subclasses */
|
||||
gboolean passthrough_on_same_caps;
|
||||
|
||||
/* virtual methods for subclasses */
|
||||
GstCaps* (*transform_caps) (GstBaseTransform *trans,
|
||||
GstPadDirection direction,
|
||||
GstCaps *caps);
|
||||
|
@ -208,6 +209,12 @@ struct _GstBaseTransformClass {
|
|||
void (*fixate_caps) (GstBaseTransform *trans,
|
||||
GstPadDirection direction, GstCaps *caps,
|
||||
GstCaps *othercaps);
|
||||
gboolean (*accept_caps) (GstBaseTransform *trans, GstPadDirection direction,
|
||||
GstCaps *caps);
|
||||
|
||||
gboolean (*set_caps) (GstBaseTransform *trans, GstCaps *incaps,
|
||||
GstCaps *outcaps);
|
||||
|
||||
|
||||
gboolean (*transform_size) (GstBaseTransform *trans,
|
||||
GstPadDirection direction,
|
||||
|
@ -217,34 +224,24 @@ struct _GstBaseTransformClass {
|
|||
gboolean (*get_unit_size) (GstBaseTransform *trans, GstCaps *caps,
|
||||
guint *size);
|
||||
|
||||
gboolean (*set_caps) (GstBaseTransform *trans, GstCaps *incaps,
|
||||
GstCaps *outcaps);
|
||||
|
||||
gboolean (*start) (GstBaseTransform *trans);
|
||||
gboolean (*stop) (GstBaseTransform *trans);
|
||||
|
||||
gboolean (*event) (GstBaseTransform *trans, GstEvent *event);
|
||||
/* src event */
|
||||
gboolean (*src_event) (GstBaseTransform *trans, GstEvent *event);
|
||||
|
||||
GstFlowReturn (*prepare_output_buffer) (GstBaseTransform * trans,
|
||||
GstBuffer *input, gint size, GstCaps *caps, GstBuffer **buf);
|
||||
|
||||
void (*before_transform) (GstBaseTransform *trans, GstBuffer *buffer);
|
||||
|
||||
GstFlowReturn (*transform) (GstBaseTransform *trans, GstBuffer *inbuf,
|
||||
GstBuffer *outbuf);
|
||||
GstFlowReturn (*transform_ip) (GstBaseTransform *trans, GstBuffer *buf);
|
||||
|
||||
/* FIXME: When adjusting the padding, move these to nicer places in the class */
|
||||
gboolean passthrough_on_same_caps;
|
||||
|
||||
GstFlowReturn (*prepare_output_buffer) (GstBaseTransform * trans,
|
||||
GstBuffer *input, gint size, GstCaps *caps, GstBuffer **buf);
|
||||
|
||||
/* src event */
|
||||
gboolean (*src_event) (GstBaseTransform *trans, GstEvent *event);
|
||||
|
||||
void (*before_transform) (GstBaseTransform *trans, GstBuffer *buffer);
|
||||
|
||||
gboolean (*accept_caps) (GstBaseTransform *trans, GstPadDirection direction,
|
||||
GstCaps *caps);
|
||||
|
||||
/*< private >*/
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE - 3];
|
||||
gpointer _gst_reserved[GST_PADDING_LARGE];
|
||||
};
|
||||
|
||||
GType gst_base_transform_get_type (void);
|
||||
|
|
|
@ -277,7 +277,7 @@ gst_data_queue_locked_flush (GstDataQueue * queue)
|
|||
gst_data_queue_cleanup (queue);
|
||||
STATUS (queue, "after flushing");
|
||||
/* we deleted something... */
|
||||
if (queue->abidata.ABI.waiting_del)
|
||||
if (queue->waiting_del)
|
||||
g_cond_signal (queue->item_del);
|
||||
}
|
||||
|
||||
|
@ -384,9 +384,9 @@ gst_data_queue_set_flushing (GstDataQueue * queue, gboolean flushing)
|
|||
queue->flushing = flushing;
|
||||
if (flushing) {
|
||||
/* release push/pop functions */
|
||||
if (queue->abidata.ABI.waiting_add)
|
||||
if (queue->waiting_add)
|
||||
g_cond_signal (queue->item_add);
|
||||
if (queue->abidata.ABI.waiting_del)
|
||||
if (queue->waiting_del)
|
||||
g_cond_signal (queue->item_del);
|
||||
}
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -432,9 +432,9 @@ gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
|
|||
|
||||
/* signal might have removed some items */
|
||||
while (gst_data_queue_locked_is_full (queue)) {
|
||||
queue->abidata.ABI.waiting_del = TRUE;
|
||||
queue->waiting_del = TRUE;
|
||||
g_cond_wait (queue->item_del, queue->qlock);
|
||||
queue->abidata.ABI.waiting_del = FALSE;
|
||||
queue->waiting_del = FALSE;
|
||||
if (queue->flushing)
|
||||
goto flushing;
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
|
|||
queue->cur_level.time += item->duration;
|
||||
|
||||
STATUS (queue, "after pushing");
|
||||
if (queue->abidata.ABI.waiting_add)
|
||||
if (queue->waiting_add)
|
||||
g_cond_signal (queue->item_add);
|
||||
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -497,9 +497,9 @@ gst_data_queue_pop (GstDataQueue * queue, GstDataQueueItem ** item)
|
|||
GST_DATA_QUEUE_MUTEX_LOCK_CHECK (queue, flushing);
|
||||
|
||||
while (gst_data_queue_locked_is_empty (queue)) {
|
||||
queue->abidata.ABI.waiting_add = TRUE;
|
||||
queue->waiting_add = TRUE;
|
||||
g_cond_wait (queue->item_add, queue->qlock);
|
||||
queue->abidata.ABI.waiting_add = FALSE;
|
||||
queue->waiting_add = FALSE;
|
||||
if (queue->flushing)
|
||||
goto flushing;
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ gst_data_queue_pop (GstDataQueue * queue, GstDataQueueItem ** item)
|
|||
queue->cur_level.time -= (*item)->duration;
|
||||
|
||||
STATUS (queue, "after popping");
|
||||
if (queue->abidata.ABI.waiting_del)
|
||||
if (queue->waiting_del)
|
||||
g_cond_signal (queue->item_del);
|
||||
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -600,7 +600,7 @@ gst_data_queue_limits_changed (GstDataQueue * queue)
|
|||
g_return_if_fail (GST_IS_DATA_QUEUE (queue));
|
||||
|
||||
GST_DATA_QUEUE_MUTEX_LOCK (queue);
|
||||
if (queue->abidata.ABI.waiting_del) {
|
||||
if (queue->waiting_del) {
|
||||
GST_DEBUG ("signal del");
|
||||
g_cond_signal (queue->item_del);
|
||||
}
|
||||
|
|
|
@ -128,20 +128,16 @@ struct _GstDataQueue
|
|||
gpointer *checkdata;
|
||||
|
||||
GMutex *qlock; /* lock for queue (vs object lock) */
|
||||
gboolean waiting_add;
|
||||
GCond *item_add; /* signals buffers now available for reading */
|
||||
gboolean waiting_del;
|
||||
GCond *item_del; /* signals space now available for writing */
|
||||
gboolean flushing; /* indicates whether conditions where signalled because
|
||||
* of external flushing */
|
||||
GstDataQueueFullCallback fullcallback;
|
||||
GstDataQueueEmptyCallback emptycallback;
|
||||
|
||||
union {
|
||||
struct {
|
||||
gboolean waiting_add;
|
||||
gboolean waiting_del;
|
||||
} ABI;
|
||||
gpointer _gst_reserved[GST_PADDING - 2];
|
||||
} abidata;
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstDataQueueClass
|
||||
|
|
Loading…
Reference in a new issue