gstrtsprange

## gstrtsprange gstrtsprange — dealing with time ranges |

## Synopsis

    #include <gst/rtsp/gstrtsrange.h>

    enum                GstRTSPRangeUnit;
                        GstRTSPTimeRange;
                        GstRTSPTime;
    enum                GstRTSPTimeType;
    GstRTSPResult       gst_rtsp_range_parse                (const gchar *rangestr,
                                                             GstRTSPTimeRange **range);
    gchar *             gst_rtsp_range_to_string            (const GstRTSPTimeRange *range);
    void                gst_rtsp_range_free                 (GstRTSPTimeRange *range);

## Description

Provides helper functions to deal with time ranges.

Last reviewed on 2007-07-25 (0.10.14)

## Details

### enum GstRTSPRangeUnit

    typedef enum
    {
      GST_RTSP_RANGE_SMPTE,
      GST_RTSP_RANGE_SMPTE_30_DROP,
      GST_RTSP_RANGE_SMPTE_25,
      GST_RTSP_RANGE_NPT,
      GST_RTSP_RANGE_CLOCK
    } GstRTSPRangeUnit;

Different possible time range units.

`GST_RTSP_RANGE_SMPTE` | SMPTE timecode
`GST_RTSP_RANGE_SMPTE_30_DROP` | 29.97 frames per second
`GST_RTSP_RANGE_SMPTE_25` | 25 frames per second
`GST_RTSP_RANGE_NPT` | Normal play time
`GST_RTSP_RANGE_CLOCK` | Absolute time expressed as ISO 8601 timestamps

### GstRTSPTimeRange

    typedef struct {
      GstRTSPRangeUnit unit;

      GstRTSPTime min;
      GstRTSPTime max;
    } GstRTSPTimeRange;

A time range.

GstRTSPRangeUnit `unit`; | the time units used
GstRTSPTime `min`; | the minimum interval
GstRTSPTime `max`; | the maximum interval

### GstRTSPTime

    typedef struct {
      GstRTSPTimeType type;
      gdouble         seconds;
    } GstRTSPTime;

A time indication.

GstRTSPTimeType `type`; | the time of the time
gdouble `seconds`; | seconds when `type` is GST_RTSP_TIME_SECONDS

### enum GstRTSPTimeType

    typedef enum {
      GST_RTSP_TIME_SECONDS,
      GST_RTSP_TIME_NOW,
      GST_RTSP_TIME_END
    } GstRTSPTimeType;

Possible time types.

`GST_RTSP_TIME_SECONDS` | seconds
`GST_RTSP_TIME_NOW` | now
`GST_RTSP_TIME_END` | end

### gst_rtsp_range_parse ()

    GstRTSPResult       gst_rtsp_range_parse                (const gchar *rangestr,
                                                             GstRTSPTimeRange **range);

Parse `rangestr` to a GstRTSPTimeRange.

`rangestr` : | a range string to parse
`range` : | location to hold the GstRTSPTimeRange result
Returns : | GST_RTSP_OK on success.

### gst_rtsp_range_to_string ()

    gchar *             gst_rtsp_range_to_string            (const GstRTSPTimeRange *range);

Convert `range` into a string representation.

`range` : | a GstRTSPTimeRange
Returns : | The string representation of `range`. `g_free()` after usage.

Since 0.10.23

### gst_rtsp_range_free ()

    void                gst_rtsp_range_free                 (GstRTSPTimeRange *range);

Free the memory alocated by `range`.

`range` : | a GstRTSPTimeRange