2005-11-20 19:11:09 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
|
|
|
|
*
|
|
|
|
* gstsegment.h: Header for GstSegment subsystem
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_SEGMENT_H__
|
|
|
|
#define __GST_SEGMENT_H__
|
|
|
|
|
|
|
|
#include <gst/gstevent.h>
|
|
|
|
#include <gst/gstformat.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2005-11-21 19:00:28 +00:00
|
|
|
#define GST_TYPE_SEGMENT (gst_segment_get_type())
|
|
|
|
|
2005-11-20 19:11:09 +00:00
|
|
|
typedef struct _GstSegment GstSegment;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstSegment:
|
|
|
|
* @rate: the rate of the segment
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
* @abs_rate: absolute value of @rate
|
2005-11-20 19:11:09 +00:00
|
|
|
* @format: the format of the segment values
|
|
|
|
* @flags: flags for this segment
|
|
|
|
* @start: the start of the segment
|
|
|
|
* @stop: the stop of the segment
|
|
|
|
* @time: the stream time of the segment
|
|
|
|
* @accum: accumulated segment
|
|
|
|
* @last_stop: last known stop time
|
|
|
|
* @duration: total duration of segment
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
* @applied_rate: the already applied rate to the segment
|
2005-11-20 19:11:09 +00:00
|
|
|
*
|
|
|
|
* A helper structure that holds the configured region of
|
|
|
|
* interest in a media file.
|
|
|
|
*/
|
|
|
|
struct _GstSegment {
|
|
|
|
/*< public >*/
|
|
|
|
gdouble rate;
|
|
|
|
gdouble abs_rate;
|
|
|
|
GstFormat format;
|
|
|
|
GstSeekFlags flags;
|
|
|
|
gint64 start;
|
|
|
|
gint64 stop;
|
|
|
|
gint64 time;
|
|
|
|
gint64 accum;
|
|
|
|
|
|
|
|
gint64 last_stop;
|
|
|
|
gint64 duration;
|
|
|
|
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
/* API added 0.10.6 */
|
|
|
|
gdouble applied_rate;
|
|
|
|
|
2005-11-20 19:11:09 +00:00
|
|
|
/*< private >*/
|
2006-06-06 13:11:03 +00:00
|
|
|
/*gpointer _gst_reserved[GST_PADDING-2];*/
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
guint8 _gst_reserved[(sizeof (gpointer) * GST_PADDING) - sizeof (gdouble)];
|
2005-11-20 19:11:09 +00:00
|
|
|
};
|
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
GType gst_segment_get_type (void);
|
gst/gstsegment.*: Make binding friendly.
Original commit message from CVS:
* gst/gstsegment.c: (gst_segment_copy), (gst_segment_get_type),
(gst_segment_new), (gst_segment_free), (gst_segment_init),
(gst_segment_set_duration), (gst_segment_set_last_stop),
(gst_segment_set_seek), (gst_segment_set_newsegment),
(gst_segment_to_stream_time), (gst_segment_to_running_time),
(gst_segment_clip):
* gst/gstsegment.h:
Make binding friendly.
2005-11-21 18:53:06 +00:00
|
|
|
|
2011-11-26 18:57:44 +00:00
|
|
|
GstSegment * gst_segment_new (void) G_GNUC_MALLOC;
|
|
|
|
GstSegment * gst_segment_copy (GstSegment *segment) G_GNUC_MALLOC;
|
2006-07-20 10:50:20 +00:00
|
|
|
void gst_segment_free (GstSegment *segment);
|
gst/gstsegment.*: Make binding friendly.
Original commit message from CVS:
* gst/gstsegment.c: (gst_segment_copy), (gst_segment_get_type),
(gst_segment_new), (gst_segment_free), (gst_segment_init),
(gst_segment_set_duration), (gst_segment_set_last_stop),
(gst_segment_set_seek), (gst_segment_set_newsegment),
(gst_segment_to_stream_time), (gst_segment_to_running_time),
(gst_segment_clip):
* gst/gstsegment.h:
Make binding friendly.
2005-11-21 18:53:06 +00:00
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
void gst_segment_init (GstSegment *segment, GstFormat format);
|
2005-11-20 19:11:09 +00:00
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
void gst_segment_set_duration (GstSegment *segment, GstFormat format, gint64 duration);
|
|
|
|
void gst_segment_set_last_stop (GstSegment *segment, GstFormat format, gint64 position);
|
2005-11-20 19:11:09 +00:00
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
void gst_segment_set_seek (GstSegment *segment, gdouble rate,
|
|
|
|
GstFormat format, GstSeekFlags flags,
|
2006-10-09 16:33:29 +00:00
|
|
|
GstSeekType start_type, gint64 start,
|
2006-07-20 10:50:20 +00:00
|
|
|
GstSeekType stop_type, gint64 stop,
|
|
|
|
gboolean *update);
|
2005-11-20 19:11:09 +00:00
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
void gst_segment_set_newsegment (GstSegment *segment, gboolean update, gdouble rate,
|
|
|
|
GstFormat format, gint64 start, gint64 stop, gint64 time);
|
|
|
|
void gst_segment_set_newsegment_full (GstSegment *segment, gboolean update, gdouble rate,
|
|
|
|
gdouble applied_rate, GstFormat format, gint64 start,
|
|
|
|
gint64 stop, gint64 time);
|
2005-11-20 19:11:09 +00:00
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
gint64 gst_segment_to_stream_time (GstSegment *segment, GstFormat format, gint64 position);
|
|
|
|
gint64 gst_segment_to_running_time (GstSegment *segment, GstFormat format, gint64 position);
|
2009-06-03 17:06:30 +00:00
|
|
|
gint64 gst_segment_to_position (GstSegment *segment, GstFormat format, gint64 running_time);
|
2005-11-20 19:11:09 +00:00
|
|
|
|
2006-07-20 10:50:20 +00:00
|
|
|
gboolean gst_segment_clip (GstSegment *segment, GstFormat format, gint64 start,
|
|
|
|
gint64 stop, gint64 *clip_start, gint64 *clip_stop);
|
2005-11-20 19:11:09 +00:00
|
|
|
|
2009-06-04 10:48:51 +00:00
|
|
|
gboolean gst_segment_set_running_time (GstSegment *segment, GstFormat format, gint64 running_time);
|
|
|
|
|
|
|
|
|
2005-11-20 19:11:09 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_SEGMENT_H__ */
|