Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RTSP: add GET_PARAMETER and PAUSE commands
  • Loading branch information
spdfrk authored and perexg committed Mar 16, 2016
1 parent 46c49fe commit e229aed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/http.c
Expand Up @@ -50,16 +50,17 @@ static pthread_mutex_t http_paths_mutex = PTHREAD_MUTEX_INITIALIZER;
static http_path_list_t http_paths;

static struct strtab HTTP_cmdtab[] = {
{ "NONE", HTTP_CMD_NONE },
{ "GET", HTTP_CMD_GET },
{ "HEAD", HTTP_CMD_HEAD },
{ "POST", HTTP_CMD_POST },
{ "DESCRIBE", RTSP_CMD_DESCRIBE },
{ "OPTIONS", RTSP_CMD_OPTIONS },
{ "SETUP", RTSP_CMD_SETUP },
{ "PLAY", RTSP_CMD_PLAY },
{ "TEARDOWN", RTSP_CMD_TEARDOWN },
{ "PAUSE", RTSP_CMD_PAUSE },
{ "NONE", HTTP_CMD_NONE },
{ "GET", HTTP_CMD_GET },
{ "HEAD", HTTP_CMD_HEAD },
{ "POST", HTTP_CMD_POST },
{ "DESCRIBE", RTSP_CMD_DESCRIBE },
{ "OPTIONS", RTSP_CMD_OPTIONS },
{ "SETUP", RTSP_CMD_SETUP },
{ "PLAY", RTSP_CMD_PLAY },
{ "TEARDOWN", RTSP_CMD_TEARDOWN },
{ "PAUSE", RTSP_CMD_PAUSE },
{ "GET_PARAMETER", RTSP_CMD_GET_PARAMETER },
};


Expand Down
10 changes: 10 additions & 0 deletions src/http.h
Expand Up @@ -110,6 +110,7 @@ typedef enum http_cmd {
RTSP_CMD_TEARDOWN,
RTSP_CMD_PLAY,
RTSP_CMD_PAUSE,
RTSP_CMD_GET_PARAMETER,
} http_cmd_t;

#define HTTP_CMD_OPTIONS RTSP_CMD_OPTIONS
Expand Down Expand Up @@ -408,11 +409,20 @@ rtsp_play( http_client_t *hc, const char *path, const char *query ) {
return rtsp_send(hc, RTSP_CMD_PLAY, path, query, NULL);
}

static inline int
rtsp_pause( http_client_t *hc, const char *path, const char *query ) {
return rtsp_send(hc, RTSP_CMD_PAUSE, path, query, NULL);
}

static inline int
rtsp_teardown( http_client_t *hc, const char *path, const char *query ) {
return rtsp_send(hc, RTSP_CMD_TEARDOWN, path, query, NULL);
}

static inline int rtsp_get_parameter( http_client_t *hc, const char *parameter ) {
return rtsp_send(hc, RTSP_CMD_GET_PARAMETER, NULL, parameter, NULL);
}

int rtsp_describe_decode( http_client_t *hc );
static inline int
rtsp_describe( http_client_t *hc, const char *path, const char *query ) {
Expand Down

0 comments on commit e229aed

Please sign in to comment.