diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-12-19 10:22:18 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-12-19 10:22:18 +0100 |
commit | 654e0683f6a986215479c3dfcc24381022f503a8 (patch) | |
tree | 635727ea34f30b5e5dfd72f48357c6c51df8ca0b /libs | |
parent | 33ee1e5933d2a2bb0a5a0e8bd12ad2a1b9cc27a5 (diff) |
Imported Upstream version 1.0.4upstream/1.0.4
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstadapter.c | 11 | ||||
-rw-r--r-- | libs/gst/base/gstbaseparse.c | 51 | ||||
-rw-r--r-- | libs/gst/base/gstbasesink.c | 2 | ||||
-rw-r--r-- | libs/gst/base/gstbasesrc.c | 8 |
4 files changed, 40 insertions, 32 deletions
diff --git a/libs/gst/base/gstadapter.c b/libs/gst/base/gstadapter.c index 899cb98..90d5263 100644 --- a/libs/gst/base/gstadapter.c +++ b/libs/gst/base/gstadapter.c @@ -45,18 +45,19 @@ * in 512-byte chunks could be implemented like this: * |[ * static GstFlowReturn - * sink_pad_chain (GstPad *pad, GstBuffer *buffer) + * sink_pad_chain (GstPad *pad, GstObject *parent, GstBuffer *buffer) * { * MyElement *this; * GstAdapter *adapter; * GstFlowReturn ret = GST_FLOW_OK; * - * // will give the element an extra ref; remember to drop it - * this = MY_ELEMENT (gst_pad_get_parent (pad)); + * this = MY_ELEMENT (parent); + * * adapter = this->adapter; * * // put buffer into adapter * gst_adapter_push (adapter, buffer); + * * // while we can read out 512 bytes, process them * while (gst_adapter_available (adapter) >= 512 && ret == GST_FLOW_OK) { * const guint8 *data = gst_adapter_map (adapter, 512); @@ -65,8 +66,6 @@ * gst_adapter_unmap (adapter); * gst_adapter_flush (adapter, 512); * } - * - * gst_object_unref (this); * return ret; * } * ]| @@ -421,7 +420,7 @@ gst_adapter_try_to_merge_up (GstAdapter * adapter, gsize size) * of its chain function, the buffer will have an invalid data pointer after * your element flushes the bytes. In that case you should use * gst_adapter_take(), which returns a freshly-allocated buffer that you can set - * as #GstBuffer malloc_data or the potentially more performant + * as #GstBuffer memory or the potentially more performant * gst_adapter_take_buffer(). * * Returns #NULL if @size bytes are not available. diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index c21266d..4879e61 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -35,7 +35,7 @@ * <listitem><para>handles state changes</para></listitem> * <listitem><para>can operate in pull mode or push mode</para></listitem> * <listitem><para>handles seeking in both modes</para></listitem> - * <listitem><para>handles events (NEWSEGMENT/EOS/FLUSH)</para></listitem> + * <listitem><para>handles events (SEGMENT/EOS/FLUSH)</para></listitem> * <listitem><para> * handles queries (POSITION/DURATION/SEEKING/FORMAT/CONVERT) * </para></listitem> @@ -1808,9 +1808,10 @@ gst_base_parse_handle_buffer (GstBaseParse * parse, GstBuffer * buffer, g_return_val_if_fail (skip != NULL || flushed != NULL, GST_FLOW_ERROR); GST_LOG_OBJECT (parse, - "handling buffer of size %" G_GSIZE_FORMAT " with ts %" GST_TIME_FORMAT - ", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buffer), - GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)), + "handling buffer of size %" G_GSIZE_FORMAT " with dts %" GST_TIME_FORMAT + ", pts %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT, + gst_buffer_get_size (buffer), GST_TIME_ARGS (GST_BUFFER_DTS (buffer)), + GST_TIME_ARGS (GST_BUFFER_PTS (buffer)), GST_TIME_ARGS (GST_BUFFER_DURATION (buffer))); /* track what is being flushed during this single round of frame processing */ @@ -1908,8 +1909,9 @@ gst_base_parse_handle_and_push_frame (GstBaseParse * parse, parse->priv->first_frame_offset = offset; parse->priv->first_frame_pts = GST_BUFFER_PTS (buffer); parse->priv->first_frame_dts = GST_BUFFER_DTS (buffer); - GST_DEBUG_OBJECT (parse, "subclass provided ts %" GST_TIME_FORMAT - " for first frame at offset %" G_GINT64_FORMAT, + GST_DEBUG_OBJECT (parse, "subclass provided dts %" GST_TIME_FORMAT + ", pts %" GST_TIME_FORMAT " for first frame at offset %" + G_GINT64_FORMAT, GST_TIME_ARGS (parse->priv->first_frame_dts), GST_TIME_ARGS (parse->priv->first_frame_pts), parse->priv->first_frame_offset); if (!GST_CLOCK_TIME_IS_VALID (parse->priv->duration)) { @@ -1997,9 +1999,11 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) buffer = frame->buffer; GST_LOG_OBJECT (parse, - "processing buffer of size %" G_GSIZE_FORMAT " with ts %" GST_TIME_FORMAT - ", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buffer), - GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)), + "processing buffer of size %" G_GSIZE_FORMAT " with dts %" GST_TIME_FORMAT + ", pts %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT, + gst_buffer_get_size (buffer), + GST_TIME_ARGS (GST_BUFFER_DTS (buffer)), + GST_TIME_ARGS (GST_BUFFER_PTS (buffer)), GST_TIME_ARGS (GST_BUFFER_DURATION (buffer))); /* update stats */ @@ -2017,8 +2021,8 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) (parse->priv->framecount % parse->priv->update_interval) == 0) gst_base_parse_update_duration (parse); - if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer)) - last_start = last_stop = GST_BUFFER_TIMESTAMP (buffer); + if (GST_BUFFER_PTS_IS_VALID (buffer)) + last_start = last_stop = GST_BUFFER_PTS (buffer); if (last_start != GST_CLOCK_TIME_NONE && GST_BUFFER_DURATION_IS_VALID (buffer)) last_stop = last_start + GST_BUFFER_DURATION (buffer); @@ -2032,7 +2036,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) gst_base_parse_check_media (parse); } - /* Push pending events, including NEWSEGMENT events */ + /* Push pending events, including SEGMENT events */ if (G_UNLIKELY (parse->priv->pending_events)) { GList *r = g_list_reverse (parse->priv->pending_events); GList *l; @@ -2066,7 +2070,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) GST_DEBUG_OBJECT (parse, "Gap of %" G_GINT64_FORMAT " ns detected in stream " "(%" GST_TIME_FORMAT " -> %" GST_TIME_FORMAT "). " - "Sending updated NEWSEGMENT events", diff, + "Sending updated SEGMENT events", diff, GST_TIME_ARGS (parse->segment.position), GST_TIME_ARGS (last_start)); @@ -2322,10 +2326,11 @@ gst_base_parse_send_buffers (GstBaseParse * parse) /* send buffers */ while (send) { buf = GST_BUFFER_CAST (send->data); - GST_LOG_OBJECT (parse, "pushing buffer %p, timestamp %" - GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT + GST_LOG_OBJECT (parse, "pushing buffer %p, dts %" + GST_TIME_FORMAT ", pts %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT ", offset %" G_GINT64_FORMAT, buf, - GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), + GST_TIME_ARGS (GST_BUFFER_DTS (buf)), + GST_TIME_ARGS (GST_BUFFER_PTS (buf)), GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf)); /* iterate output queue an push downstream */ @@ -2604,8 +2609,12 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) if (G_LIKELY (buffer)) { GST_LOG_OBJECT (parse, - "buffer size: %" G_GSIZE_FORMAT ", offset = %" G_GINT64_FORMAT, - gst_buffer_get_size (buffer), GST_BUFFER_OFFSET (buffer)); + "buffer size: %" G_GSIZE_FORMAT ", offset = %" G_GINT64_FORMAT + ", dts %" GST_TIME_FORMAT ", pts %" GST_TIME_FORMAT, + gst_buffer_get_size (buffer), GST_BUFFER_OFFSET (buffer), + GST_TIME_ARGS (GST_BUFFER_DTS (buffer)), + GST_TIME_ARGS (GST_BUFFER_PTS (buffer))); + if (G_UNLIKELY (parse->priv->passthrough)) { GstBaseParseFrame frame; @@ -3030,7 +3039,7 @@ pause: push_eos = TRUE; } if (push_eos) { - /* Push pending events, including NEWSEGMENT events */ + /* Push pending events, including SEGMENT events */ if (G_UNLIKELY (parse->priv->pending_events)) { GList *r = g_list_reverse (parse->priv->pending_events); GList *l; @@ -3999,10 +4008,10 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) GST_DEBUG_OBJECT (parse, "Created newseg format %d, " "start = %" GST_TIME_FORMAT ", stop = %" GST_TIME_FORMAT - ", pos = %" GST_TIME_FORMAT, format, + ", time = %" GST_TIME_FORMAT, format, GST_TIME_ARGS (parse->segment.start), GST_TIME_ARGS (parse->segment.stop), - GST_TIME_ARGS (parse->segment.start)); + GST_TIME_ARGS (parse->segment.time)); /* one last chance in pull mode to stay accurate; * maybe scan and subclass can find where to go */ diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 54245af..1ac4e8a 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -84,7 +84,7 @@ * element receives EOS in PAUSED, preroll completes, the event is queued and an * EOS message is posted when going to PLAYING. * - * #GstBaseSink will internally use the #GST_EVENT_NEWSEGMENT events to schedule + * #GstBaseSink will internally use the #GST_EVENT_SEGMENT events to schedule * synchronisation and clipping of buffers. Buffers that fall completely outside * of the current segment are dropped. Buffers that fall partially in the * segment are rendered (and prerolled). Subclasses should do any subbuffer diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index f8f3302..4151e40 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -35,7 +35,7 @@ * * The source can be configured to operate in any #GstFormat with the * gst_base_src_set_format() method. The currently set format determines - * the format of the internal #GstSegment and any #GST_EVENT_NEWSEGMENT + * the format of the internal #GstSegment and any #GST_EVENT_SEGMENT * events. The default format for #GstBaseSrc is #GST_FORMAT_BYTES. * * #GstBaseSrc always supports push mode scheduling. If the following @@ -577,7 +577,7 @@ gst_base_src_is_live (GstBaseSrc * src) * @format: the format to use * * Sets the default format of the source. This will be the format used - * for sending NEW_SEGMENT events and for performing seeks. + * for sending SEGMENT events and for performing seeks. * * If a format of GST_FORMAT_BYTES is set, the element will be able to * operate in pull mode if the #GstBaseSrcClass.is_seekable() returns TRUE. @@ -3265,7 +3265,7 @@ seek_failed: { GST_PAD_STREAM_UNLOCK (basesrc->srcpad); GST_ERROR_OBJECT (basesrc, "Failed to perform initial seek"); - gst_base_src_set_flushing (basesrc, TRUE, FALSE, NULL); + gst_base_src_stop (basesrc); if (event) gst_event_unref (event); ret = GST_FLOW_ERROR; @@ -3274,7 +3274,7 @@ seek_failed: no_get_range: { GST_PAD_STREAM_UNLOCK (basesrc->srcpad); - gst_base_src_set_flushing (basesrc, TRUE, FALSE, NULL); + gst_base_src_stop (basesrc); GST_ERROR_OBJECT (basesrc, "Cannot operate in pull mode, stopping"); ret = GST_FLOW_ERROR; goto error; |