A new segment event. More...
Public Member Functions | |
EventNewSegment (GstEvent* event) | |
void | parse (bool& update, double& rate, Format& format, gint64&start, gint64& stop, gint64& position) const |
Get the update flag, rate, format, start, stop and position in the newsegment event. | |
void | parse (bool& update, double& rate, Format& format, gint64&start, gint64& stop, gint64& position, double& applied_rate) const |
Get the update, rate, format, start, stop, position and applied_rate in the newsegment event. | |
gint64 | parse () const |
Get the position in the newsegment event. | |
bool | parse_update () const |
Get the update in the newsegment event. | |
double | parse_rate () const |
Get the rate in the newsegment event. | |
Format | parse_format () const |
Get the format in the newsegment event. | |
gint64 | parse_start () const |
Get the start in the newsegment event. | |
gint64 | parse_stop () const |
Get the stop in the newsegment event. | |
double | parse_applied_rate () const |
Get the applied_rate in the newsegment event. | |
Static Public Member Functions | |
static Glib::RefPtr< Gst::Event > | create (bool update, double rate, Format format, gint64 strat, gint64 stop, gint64 position, double applied_rate=1.0) |
Allocate a new newsegment event with the given format/values tripplets. |
A new segment event.
See create() for more details.
Gst::EventNewSegment::EventNewSegment | ( | GstEvent * | event ) | [explicit] |
static Glib::RefPtr<Gst::Event> Gst::EventNewSegment::create | ( | bool | update, |
double | rate, | ||
Format | format, | ||
gint64 | strat, | ||
gint64 | stop, | ||
gint64 | position, | ||
double | applied_rate = 1.0 |
||
) | [static] |
Allocate a new newsegment event with the given format/values tripplets.
The newsegment event marks the range of buffers to be processed. All data not within the segment range is not to be processed. This can be used intelligently by plugins to apply more efficient methods of skipping unneeded data.
The position value of the segment is used in conjunction with the start value to convert the buffer timestamps into the stream time. This is usually done in sinks to report the current stream_time. position represents the stream_time of a buffer carrying a timestamp of start. position cannot be -1.
start cannot be -1, stop can be -1. If there is a valid stop given, it must be greater or equal the start, including when the indicated playback rate is < 0.
The applied_rate value provides information about any rate adjustment that has already been made to the timestamps and content on the buffers of the stream. (rate * applied_rate) should always equal the rate that has been requested for playback. For example, if an element has an input segment with intended playback rate of 2.0 and applied_rate of 1.0, it can adjust incoming timestamps and buffer content by half and output a newsegment event with rate of 1.0 and applied_rate of 2.0
After a newsegment event, the buffer stream time is calculated with:
position + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
update | Is this segment an update to a previous one. |
rate | A new rate for playback. |
format | The format of the segment values. |
start | The start value of the segment. |
stop | The stop value of the segment. |
position | Stream position. |
applied_rate | The rate factor which has already been applied. |
Since 0.10.6
void Gst::EventNewSegment::parse | ( | bool & | update, |
double & | rate, | ||
Format& | format, | ||
gint64 & | start, | ||
gint64 & | stop, | ||
gint64 & | position | ||
) | const |
Get the update flag, rate, format, start, stop and position in the newsegment event.
update | A reference to store the update flag of the segment. |
rate | A reference to store the rate of the segment. |
format | A reference to store the format of the newsegment values. |
start | A reference to store the start value in. |
stop | A reference to store the stop value in. |
position | A reference to store the stream time in. |
gint64 Gst::EventNewSegment::parse | ( | ) | const |
Get the position in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.
void Gst::EventNewSegment::parse | ( | bool & | update, |
double & | rate, | ||
Format& | format, | ||
gint64 & | start, | ||
gint64 & | stop, | ||
gint64 & | position, | ||
double & | applied_rate | ||
) | const |
Get the update, rate, format, start, stop, position and applied_rate in the newsegment event.
See create() for a full description of the newsegment event.
update | A reference to store the update flag of the segment. |
rate | A reference to store the rate of the segment. |
format | A reference to store the format of the newsegment values. |
start | A reference to store the start value in. |
stop | A reference to store the stop value in. |
position | A reference to store the stream time in. |
applied_rate | A reference to store the applied_rate of the segment. |
Since 0.10.6.
double Gst::EventNewSegment::parse_applied_rate | ( | ) | const |
Get the applied_rate in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.
Format Gst::EventNewSegment::parse_format | ( | ) | const |
Get the format in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.
double Gst::EventNewSegment::parse_rate | ( | ) | const |
Get the rate in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.
gint64 Gst::EventNewSegment::parse_start | ( | ) | const |
Get the start in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.
gint64 Gst::EventNewSegment::parse_stop | ( | ) | const |
Get the stop in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.
bool Gst::EventNewSegment::parse_update | ( | ) | const |
Get the update in the newsegment event.
See create() for a full description of the newsegment event.
Since 0.10.6.