mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 22:46:24 +00:00
event: improve argument names of segments
This commit is contained in:
parent
5ccda2f8f4
commit
a61e0e5bde
4 changed files with 32 additions and 31 deletions
|
@ -489,7 +489,7 @@ gst_event_new_eos (void)
|
||||||
* @format: The format of the segment values
|
* @format: The format of the segment values
|
||||||
* @start: the start value of the segment
|
* @start: the start value of the segment
|
||||||
* @stop: the stop value of the segment
|
* @stop: the stop value of the segment
|
||||||
* @position: stream position
|
* @time: the time value of the segment
|
||||||
*
|
*
|
||||||
* Allocate a new newsegment event with the given format/values tripplets
|
* Allocate a new newsegment event with the given format/values tripplets
|
||||||
*
|
*
|
||||||
|
@ -500,10 +500,10 @@ gst_event_new_eos (void)
|
||||||
*/
|
*/
|
||||||
GstEvent *
|
GstEvent *
|
||||||
gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format,
|
gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format,
|
||||||
gint64 start, gint64 stop, gint64 position)
|
gint64 start, gint64 stop, gint64 time)
|
||||||
{
|
{
|
||||||
return gst_event_new_new_segment_full (update, rate, 1.0, format, start,
|
return gst_event_new_new_segment_full (update, rate, 1.0, format, start,
|
||||||
stop, position);
|
stop, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -514,9 +514,9 @@ gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format,
|
||||||
* @format: (out): A pointer to the format of the newsegment values
|
* @format: (out): A pointer to the format of the newsegment values
|
||||||
* @start: (out): A pointer to store the start value in
|
* @start: (out): A pointer to store the start value in
|
||||||
* @stop: (out): A pointer to store the stop value in
|
* @stop: (out): A pointer to store the stop value in
|
||||||
* @position: (out): A pointer to store the stream time in
|
* @time: (out): A pointer to store the time value in
|
||||||
*
|
*
|
||||||
* Get the update flag, rate, format, start, stop and position in the
|
* Get the update flag, rate, format, start, stop and time in the
|
||||||
* newsegment event. In general, gst_event_parse_new_segment_full() should
|
* newsegment event. In general, gst_event_parse_new_segment_full() should
|
||||||
* be used instead of this, to also retrieve the applied_rate value of the
|
* be used instead of this, to also retrieve the applied_rate value of the
|
||||||
* segment. See gst_event_new_new_segment_full() for a full description
|
* segment. See gst_event_new_new_segment_full() for a full description
|
||||||
|
@ -525,10 +525,10 @@ gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format,
|
||||||
void
|
void
|
||||||
gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
||||||
gdouble * rate, GstFormat * format, gint64 * start,
|
gdouble * rate, GstFormat * format, gint64 * start,
|
||||||
gint64 * stop, gint64 * position)
|
gint64 * stop, gint64 * time)
|
||||||
{
|
{
|
||||||
gst_event_parse_new_segment_full (event, update, rate, NULL, format, start,
|
gst_event_parse_new_segment_full (event, update, rate, NULL, format, start,
|
||||||
stop, position);
|
stop, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -539,7 +539,7 @@ gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
||||||
* @format: The format of the segment values
|
* @format: The format of the segment values
|
||||||
* @start: The start value of the segment
|
* @start: The start value of the segment
|
||||||
* @stop: The stop value of the segment
|
* @stop: The stop value of the segment
|
||||||
* @position: stream position
|
* @time: the time value of the segment
|
||||||
*
|
*
|
||||||
* Allocate a new newsegment event with the given format/values triplets.
|
* Allocate a new newsegment event with the given format/values triplets.
|
||||||
*
|
*
|
||||||
|
@ -549,11 +549,11 @@ gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
||||||
* unneeded data. The valid range is expressed with the @start and @stop
|
* unneeded data. The valid range is expressed with the @start and @stop
|
||||||
* values.
|
* values.
|
||||||
*
|
*
|
||||||
* The position value of the segment is used in conjunction with the start
|
* The time value of the segment is used in conjunction with the start
|
||||||
* value to convert the buffer timestamps into the stream time. This is
|
* value to convert the buffer timestamps into the stream time. This is
|
||||||
* usually done in sinks to report the current stream_time.
|
* usually done in sinks to report the current stream_time.
|
||||||
* @position represents the stream_time of a buffer carrying a timestamp of
|
* @time represents the stream_time of a buffer carrying a timestamp of
|
||||||
* @start. @position cannot be -1.
|
* @start. @time cannot be -1.
|
||||||
*
|
*
|
||||||
* @start cannot be -1, @stop can be -1. If there
|
* @start cannot be -1, @stop can be -1. If there
|
||||||
* is a valid @stop given, it must be greater or equal the @start, including
|
* is a valid @stop given, it must be greater or equal the @start, including
|
||||||
|
@ -569,7 +569,7 @@ gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
||||||
*
|
*
|
||||||
* After a newsegment event, the buffer stream time is calculated with:
|
* After a newsegment event, the buffer stream time is calculated with:
|
||||||
*
|
*
|
||||||
* position + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
|
* time + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): a new newsegment event.
|
* Returns: (transfer full): a new newsegment event.
|
||||||
*
|
*
|
||||||
|
@ -578,7 +578,7 @@ gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
||||||
GstEvent *
|
GstEvent *
|
||||||
gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
||||||
gdouble applied_rate, GstFormat format, gint64 start, gint64 stop,
|
gdouble applied_rate, GstFormat format, gint64 start, gint64 stop,
|
||||||
gint64 position)
|
gint64 time)
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
@ -590,18 +590,18 @@ gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
||||||
GST_CAT_INFO (GST_CAT_EVENT,
|
GST_CAT_INFO (GST_CAT_EVENT,
|
||||||
"creating newsegment update %d, rate %lf, format GST_FORMAT_TIME, "
|
"creating newsegment update %d, rate %lf, format GST_FORMAT_TIME, "
|
||||||
"start %" GST_TIME_FORMAT ", stop %" GST_TIME_FORMAT
|
"start %" GST_TIME_FORMAT ", stop %" GST_TIME_FORMAT
|
||||||
", position %" GST_TIME_FORMAT,
|
", time %" GST_TIME_FORMAT,
|
||||||
update, rate, GST_TIME_ARGS (start),
|
update, rate, GST_TIME_ARGS (start),
|
||||||
GST_TIME_ARGS (stop), GST_TIME_ARGS (position));
|
GST_TIME_ARGS (stop), GST_TIME_ARGS (time));
|
||||||
} else {
|
} else {
|
||||||
GST_CAT_INFO (GST_CAT_EVENT,
|
GST_CAT_INFO (GST_CAT_EVENT,
|
||||||
"creating newsegment update %d, rate %lf, format %s, "
|
"creating newsegment update %d, rate %lf, format %s, "
|
||||||
"start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT ", position %"
|
"start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT ", time %"
|
||||||
G_GINT64_FORMAT, update, rate, gst_format_get_name (format), start,
|
G_GINT64_FORMAT, update, rate, gst_format_get_name (format), start,
|
||||||
stop, position);
|
stop, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_return_val_if_fail (position != -1, NULL);
|
g_return_val_if_fail (time != -1, NULL);
|
||||||
g_return_val_if_fail (start != -1, NULL);
|
g_return_val_if_fail (start != -1, NULL);
|
||||||
if (stop != -1)
|
if (stop != -1)
|
||||||
g_return_val_if_fail (start <= stop, NULL);
|
g_return_val_if_fail (start <= stop, NULL);
|
||||||
|
@ -613,7 +613,7 @@ gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
||||||
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
|
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
|
||||||
GST_QUARK (START), G_TYPE_INT64, start,
|
GST_QUARK (START), G_TYPE_INT64, start,
|
||||||
GST_QUARK (STOP), G_TYPE_INT64, stop,
|
GST_QUARK (STOP), G_TYPE_INT64, stop,
|
||||||
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
|
GST_QUARK (TIME), G_TYPE_INT64, time, NULL);
|
||||||
event = gst_event_new_custom (GST_EVENT_NEWSEGMENT, structure);
|
event = gst_event_new_custom (GST_EVENT_NEWSEGMENT, structure);
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
|
@ -628,10 +628,10 @@ gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
||||||
* @format: (out): A pointer to the format of the newsegment values
|
* @format: (out): A pointer to the format of the newsegment values
|
||||||
* @start: (out): A pointer to store the start value in
|
* @start: (out): A pointer to store the start value in
|
||||||
* @stop: (out): A pointer to store the stop value in
|
* @stop: (out): A pointer to store the stop value in
|
||||||
* @position: (out): A pointer to store the stream time in
|
* @time: (out): A pointer to store the time value in
|
||||||
*
|
*
|
||||||
* Get the update, rate, applied_rate, format, start, stop and
|
* Get the update, rate, applied_rate, format, start, stop and
|
||||||
* position in the newsegment event. See gst_event_new_new_segment_full()
|
* time in the newsegment event. See gst_event_new_new_segment_full()
|
||||||
* for a full description of the newsegment event.
|
* for a full description of the newsegment event.
|
||||||
*
|
*
|
||||||
* Since: 0.10.6
|
* Since: 0.10.6
|
||||||
|
@ -639,7 +639,7 @@ gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
||||||
void
|
void
|
||||||
gst_event_parse_new_segment_full (GstEvent * event, gboolean * update,
|
gst_event_parse_new_segment_full (GstEvent * event, gboolean * update,
|
||||||
gdouble * rate, gdouble * applied_rate, GstFormat * format,
|
gdouble * rate, gdouble * applied_rate, GstFormat * format,
|
||||||
gint64 * start, gint64 * stop, gint64 * position)
|
gint64 * start, gint64 * stop, gint64 * time)
|
||||||
{
|
{
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
|
|
||||||
|
@ -671,10 +671,10 @@ gst_event_parse_new_segment_full (GstEvent * event, gboolean * update,
|
||||||
*stop =
|
*stop =
|
||||||
g_value_get_int64 (gst_structure_id_get_value (structure,
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
||||||
GST_QUARK (STOP)));
|
GST_QUARK (STOP)));
|
||||||
if (G_LIKELY (position))
|
if (G_LIKELY (time))
|
||||||
*position =
|
*time =
|
||||||
g_value_get_int64 (gst_structure_id_get_value (structure,
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
||||||
GST_QUARK (POSITION)));
|
GST_QUARK (TIME)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -451,25 +451,25 @@ GstEvent * gst_event_new_eos (void);
|
||||||
GstEvent* gst_event_new_new_segment (gboolean update, gdouble rate,
|
GstEvent* gst_event_new_new_segment (gboolean update, gdouble rate,
|
||||||
GstFormat format,
|
GstFormat format,
|
||||||
gint64 start, gint64 stop,
|
gint64 start, gint64 stop,
|
||||||
gint64 position);
|
gint64 time);
|
||||||
GstEvent* gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
GstEvent* gst_event_new_new_segment_full (gboolean update, gdouble rate,
|
||||||
gdouble applied_rate,
|
gdouble applied_rate,
|
||||||
GstFormat format,
|
GstFormat format,
|
||||||
gint64 start, gint64 stop,
|
gint64 start, gint64 stop,
|
||||||
gint64 position);
|
gint64 time);
|
||||||
void gst_event_parse_new_segment (GstEvent *event,
|
void gst_event_parse_new_segment (GstEvent *event,
|
||||||
gboolean *update,
|
gboolean *update,
|
||||||
gdouble *rate,
|
gdouble *rate,
|
||||||
GstFormat *format,
|
GstFormat *format,
|
||||||
gint64 *start, gint64 *stop,
|
gint64 *start, gint64 *stop,
|
||||||
gint64 *position);
|
gint64 *time);
|
||||||
void gst_event_parse_new_segment_full (GstEvent *event,
|
void gst_event_parse_new_segment_full (GstEvent *event,
|
||||||
gboolean *update,
|
gboolean *update,
|
||||||
gdouble *rate,
|
gdouble *rate,
|
||||||
gdouble *applied_rate,
|
gdouble *applied_rate,
|
||||||
GstFormat *format,
|
GstFormat *format,
|
||||||
gint64 *start, gint64 *stop,
|
gint64 *start, gint64 *stop,
|
||||||
gint64 *position);
|
gint64 *time);
|
||||||
|
|
||||||
/* tag event */
|
/* tag event */
|
||||||
GstEvent* gst_event_new_tag (GstTagList *taglist);
|
GstEvent* gst_event_new_tag (GstTagList *taglist);
|
||||||
|
|
|
@ -51,7 +51,7 @@ static const gchar *_quark_strings[] = {
|
||||||
"message", "GstMessageQOS", "running-time", "stream-time", "jitter",
|
"message", "GstMessageQOS", "running-time", "stream-time", "jitter",
|
||||||
"quality", "processed", "dropped", "buffering-ranges", "GstMessageProgress",
|
"quality", "processed", "dropped", "buffering-ranges", "GstMessageProgress",
|
||||||
"code", "text", "percent", "timeout", "GstBufferPoolConfig", "caps", "size",
|
"code", "text", "percent", "timeout", "GstBufferPoolConfig", "caps", "size",
|
||||||
"min-buffers", "max-buffers", "prefix", "postfix", "align"
|
"min-buffers", "max-buffers", "prefix", "postfix", "align", "time"
|
||||||
};
|
};
|
||||||
|
|
||||||
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||||
|
|
|
@ -140,8 +140,9 @@ typedef enum _GstQuarkId
|
||||||
GST_QUARK_PREFIX = 111,
|
GST_QUARK_PREFIX = 111,
|
||||||
GST_QUARK_POSTFIX = 112,
|
GST_QUARK_POSTFIX = 112,
|
||||||
GST_QUARK_ALIGN = 113,
|
GST_QUARK_ALIGN = 113,
|
||||||
|
GST_QUARK_TIME = 114,
|
||||||
|
|
||||||
GST_QUARK_MAX = 114
|
GST_QUARK_MAX = 115
|
||||||
} GstQuarkId;
|
} GstQuarkId;
|
||||||
|
|
||||||
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||||
|
|
Loading…
Reference in a new issue