gstrtspdefs

## gstrtspdefs gstrtspdefs — common RTSP defines |

## Synopsis

    #include <gst/rtsp/gstrtspdefs.h>

    #define             GST_RTSP_CHECK                      (stmt,
                                                             label)
    #define             GST_RTSP_AUTH_MAX
    enum                GstRTSPEvent;
    enum                GstRTSPResult;
    enum                GstRTSPFamily;
    enum                GstRTSPState;
    enum                GstRTSPVersion;
    enum                GstRTSPMethod;
    enum                GstRTSPAuthMethod;
    enum                GstRTSPHeaderField;
    enum                GstRTSPStatusCode;
    gchar *             gst_rtsp_strresult                  (GstRTSPResult result);
    const gchar *       gst_rtsp_method_as_text             (GstRTSPMethod method);
    const gchar *       gst_rtsp_version_as_text            (GstRTSPVersion version);
    const gchar *       gst_rtsp_header_as_text             (GstRTSPHeaderField field);
    gboolean            gst_rtsp_header_allow_multiple      (GstRTSPHeaderField field);
    const gchar *       gst_rtsp_status_as_text             (GstRTSPStatusCode code);
    gchar *             gst_rtsp_options_as_text            (GstRTSPMethod options);
    GstRTSPHeaderField  gst_rtsp_find_header_field          (const gchar *header);
    GstRTSPMethod       gst_rtsp_find_method                (const gchar *method);

## Description

Provides common defines for the RTSP library. Last reviewed on 2007-07-24 (0.10.14)

## Details

### GST_RTSP_CHECK()

    #define             GST_RTSP_CHECK(stmt, label)

Macro that checks the return value of `stmt` and jumps to `label` when it does not equal GST_RTSP_OK.

`stmt` : | a statement
`label` : | a label

### GST_RTSP_AUTH_MAX

    #define GST_RTSP_AUTH_MAX GST_RTSP_AUTH_DIGEST

Strongest available authentication method

### enum GstRTSPEvent

    typedef enum {
      GST_RTSP_EV_READ  = (1 << 0),
      GST_RTSP_EV_WRITE = (1 << 1)
    } GstRTSPEvent;

The possible events for the connection.

`GST_RTSP_EV_READ` | connection is readable
`GST_RTSP_EV_WRITE` | connection is writable

### enum GstRTSPResult

    typedef enum {
      GST_RTSP_OK          =  0,
      /* errors */
      GST_RTSP_ERROR       = -1,
      GST_RTSP_EINVAL      = -2,
      GST_RTSP_EINTR       = -3,
      GST_RTSP_ENOMEM      = -4,
      GST_RTSP_ERESOLV     = -5,
      GST_RTSP_ENOTIMPL    = -6,
      GST_RTSP_ESYS        = -7,
      GST_RTSP_EPARSE      = -8,
      GST_RTSP_EWSASTART   = -9,
      GST_RTSP_EWSAVERSION = -10,
      GST_RTSP_EEOF        = -11,
      GST_RTSP_ENET        = -12,
      GST_RTSP_ENOTIP      = -13,
      GST_RTSP_ETIMEOUT    = -14,
      GST_RTSP_ETGET       = -15,
      GST_RTSP_ETPOST      = -16,

      GST_RTSP_ELAST       = -17
    } GstRTSPResult;

Result codes from the RTSP functions.

`GST_RTSP_OK` | no error
`GST_RTSP_ERROR` | some unspecified error occured
`GST_RTSP_EINVAL` | invalid arguments were provided to a function
`GST_RTSP_EINTR` | an operation was canceled
`GST_RTSP_ENOMEM` | no memory was available for the operation
`GST_RTSP_ERESOLV` | a host resolve error occured
`GST_RTSP_ENOTIMPL` | function not implemented
`GST_RTSP_ESYS` | a system error occured, errno contains more details
`GST_RTSP_EPARSE` | a persing error occured
`GST_RTSP_EWSASTART` | windows networking could not start
`GST_RTSP_EWSAVERSION` | windows networking stack has wrong version
`GST_RTSP_EEOF` | end-of-file was reached
`GST_RTSP_ENET` | a network problem occured, h_errno contains more details
`GST_RTSP_ENOTIP` | the host is not an IP host
`GST_RTSP_ETIMEOUT` | a timeout occured
`GST_RTSP_ETGET` | the tunnel GET request has been performed
`GST_RTSP_ETPOST` | the tunnel POST request has been performed
`GST_RTSP_ELAST` | last error

### enum GstRTSPFamily

    typedef enum {
      GST_RTSP_FAM_NONE,
      GST_RTSP_FAM_INET,
      GST_RTSP_FAM_INET6
    } GstRTSPFamily;

The possible network families.

`GST_RTSP_FAM_NONE` | unknown network family
`GST_RTSP_FAM_INET` | internet
`GST_RTSP_FAM_INET6` | internet V6

### enum GstRTSPState

    typedef enum {
      GST_RTSP_STATE_INVALID,
      GST_RTSP_STATE_INIT,
      GST_RTSP_STATE_READY,
      GST_RTSP_STATE_SEEKING,
      GST_RTSP_STATE_PLAYING,
      GST_RTSP_STATE_RECORDING
    } GstRTSPState;

The different RTSP states.

`GST_RTSP_STATE_INVALID` | invalid state
`GST_RTSP_STATE_INIT` | initializing
`GST_RTSP_STATE_READY` | ready for operation
`GST_RTSP_STATE_SEEKING` | seeking in progress
`GST_RTSP_STATE_PLAYING` | playing
`GST_RTSP_STATE_RECORDING` | recording

### enum GstRTSPVersion

    typedef enum {
      GST_RTSP_VERSION_INVALID = 0x00,
      GST_RTSP_VERSION_1_0     = 0x10,
      GST_RTSP_VERSION_1_1     = 0x11
    } GstRTSPVersion;

The supported RTSP versions.

`GST_RTSP_VERSION_INVALID` | unknown/invalid version
`GST_RTSP_VERSION_1_0` | version 1.0
`GST_RTSP_VERSION_1_1` | version 1.1. Since 0.10.25

### enum GstRTSPMethod

    typedef enum {
      GST_RTSP_INVALID          = 0,
      GST_RTSP_DESCRIBE         = (1 <<  0),
      GST_RTSP_ANNOUNCE         = (1 <<  1),
      GST_RTSP_GET_PARAMETER    = (1 <<  2),
      GST_RTSP_OPTIONS          = (1 <<  3),
      GST_RTSP_PAUSE            = (1 <<  4),
      GST_RTSP_PLAY             = (1 <<  5),
      GST_RTSP_RECORD           = (1 <<  6),
      GST_RTSP_REDIRECT         = (1 <<  7),
      GST_RTSP_SETUP            = (1 <<  8),
      GST_RTSP_SET_PARAMETER    = (1 <<  9),
      GST_RTSP_TEARDOWN         = (1 << 10),
      GST_RTSP_GET              = (1 << 11),
      GST_RTSP_POST             = (1 << 12)
    } GstRTSPMethod;

The different supported RTSP methods.

`GST_RTSP_INVALID` | invalid method
`GST_RTSP_DESCRIBE` | the DESCRIBE method
`GST_RTSP_ANNOUNCE` | the ANNOUNCE method
`GST_RTSP_GET_PARAMETER` | the GET_PARAMETER method
`GST_RTSP_OPTIONS` | the OPTIONS method
`GST_RTSP_PAUSE` | the PAUSE method
`GST_RTSP_PLAY` | the PLAY method
`GST_RTSP_RECORD` | the RECORD method
`GST_RTSP_REDIRECT` | the REDIRECT method
`GST_RTSP_SETUP` | the SETUP method
`GST_RTSP_SET_PARAMETER` | the SET_PARAMETER method
`GST_RTSP_TEARDOWN` | the TEARDOWN method
`GST_RTSP_GET` | the GET method (HTTP). Since 0.10.25
`GST_RTSP_POST` | the POST method (HTTP). Since 0.10.25

### enum GstRTSPAuthMethod

    typedef enum {
      GST_RTSP_AUTH_NONE    = 0x00,
      GST_RTSP_AUTH_BASIC   = 0x01,
      GST_RTSP_AUTH_DIGEST  = 0x02
    } GstRTSPAuthMethod;

Authentication methods, ordered by strength

`GST_RTSP_AUTH_NONE` | no authentication
`GST_RTSP_AUTH_BASIC` | basic authentication
`GST_RTSP_AUTH_DIGEST` | digest authentication

### enum GstRTSPHeaderField

    typedef enum {
    } GstRTSPHeaderField;

Enumeration of rtsp header fields.

### enum GstRTSPStatusCode

    typedef enum {
    } GstRTSPStatusCode;

Enumeration of rtsp status codes.

### gst_rtsp_strresult ()

    gchar *             gst_rtsp_strresult                  (GstRTSPResult result);

Convert `result` in a human readable string.

`result` : | a GstRTSPResult
Returns : | a newly allocated string. `g_free()` after usage.

### gst_rtsp_method_as_text ()

    const gchar *       gst_rtsp_method_as_text             (GstRTSPMethod method);

Convert `method` to a string.

`method` : | a GstRTSPMethod
Returns : | a string representation of `method`.

### gst_rtsp_version_as_text ()

    const gchar *       gst_rtsp_version_as_text            (GstRTSPVersion version);

Convert `version` to a string.

`version` : | a GstRTSPVersion
Returns : | a string representation of `version`.

### gst_rtsp_header_as_text ()

    const gchar *       gst_rtsp_header_as_text             (GstRTSPHeaderField field);

Convert `field` to a string.

`field` : | a GstRTSPHeaderField
Returns : | a string representation of `field`.

### gst_rtsp_header_allow_multiple ()

    gboolean            gst_rtsp_header_allow_multiple      (GstRTSPHeaderField field);

Check whether `field` may appear multiple times in a message.

`field` : | a GstRTSPHeaderField
Returns : | `TRUE` if multiple headers are allowed.

Since 0.10.25

### gst_rtsp_status_as_text ()

    const gchar *       gst_rtsp_status_as_text             (GstRTSPStatusCode code);

Convert `code` to a string.

`code` : | a GstRTSPStatusCode
Returns : | a string representation of `code`.

### gst_rtsp_options_as_text ()

    gchar *             gst_rtsp_options_as_text            (GstRTSPMethod options);

Convert `options` to a string.

`options` : | one or more GstRTSPMethod
Returns : | a new string of `options`. `g_free()` after usage.

Since 0.10.23

### gst_rtsp_find_header_field ()

    GstRTSPHeaderField  gst_rtsp_find_header_field          (const gchar *header);

Convert `header` to a GstRTSPHeaderField.

`header` : | a header string
Returns : | a GstRTSPHeaderField for `header` or GST_RTSP_HDR_INVALID if the header field is unknown.

### gst_rtsp_find_method ()

    GstRTSPMethod       gst_rtsp_find_method                (const gchar *method);

Convert `method` to a GstRTSPMethod.

`method` : | a method
Returns : | a GstRTSPMethod for `method` or GST_RTSP_INVALID if the method is unknown.

## See Also

gstrtspurl, gstrtspconnection