rtsp_client.h
来自「AMLOGIC DPF source code」· C头文件 代码 · 共 177 行
H
177 行
/*******************************************************************
*
* Copyright C 2004 by Amlogic, Inc. All Rights Reserved.
*
* Description: RTSP Client declarations
*
* Created: Mon Oct 18 20:30:03 2004, Eric Knudstrup
*
*******************************************************************/
#ifndef RTSP_CLIENT_H
#define RTSP_CLIENT_H
/**
* @file rtsp_client.h>
* Top level RTSP client application routines. Provided by rtsp.lib.
*/
/** @defgroup rtsp_client RTSP client application routines.
* @ingroup Network
*/
/*@{*/
/** Used to specify which commands will be accepted by the RTSP server */
typedef enum {
RTSP_REQUEST_DESCRIBE = (1<<0), /**< DESCRIBE */
RTSP_REQUEST_ANNOUNCE = (1<<1), /**< ANNOUNCE */
RTSP_REQUEST_GET_PARAMETER = (1<<2), /**< GET_PARAMETER */
RTSP_REQUEST_OPTIONS = (1<<3), /**< OPTIONS */
RTSP_REQUEST_PAUSE = (1<<4), /**< PAUSE */
RTSP_REQUEST_PLAY = (1<<5), /**< PLAY */
RTSP_REQUEST_RECORD = (1<<6), /**< RECORD */
RTSP_REQUEST_REDIRECT = (1<<7), /**< REDIRECT */
RTSP_REQUEST_SETUP = (1<<8), /**< SETUP */
RTSP_REQUEST_SET_PARAMETER = (1<<9), /**< SET_PARAMETER */
RTSP_REQUEST_TEARDOWN = (1<<10), /**< TEARDOWN */
} RTSPRequestTypes;
typedef enum {
RTSP_CMD_SENT, /**< Successful, request enqueued */
RTSP_CMD_DISALLOWED, /**< According to the last OPTIONS result, this command would not be accepted. */
RTSP_CMD_CON_ERROR, /**< Unable to connect */
RTSP_CMD_ENOMEM, /**< Memory allocation error */
RTSP_CMD_ERR_ARG, /**< Invalid argument */
} RTSPCmdResult_t;
/**
* Descriptor for an RTSP control connection.
*/
typedef struct _rtsp_client_s RTSPClient;
/**
* Callback for RTSP command completion.
*/
typedef void (*RTSPCompleteCb) (RTSPClient *client, HTTPInputMessage_t *response);
/*;emacs generated header for file rtsp_client.c. Global function declarations only. */
/**
* Send an RTSP DESCRIBE command to the server.
*
* @param[in] rtsp_client Connection to send the SETUP command for.
* @param[in] uri URI to DESCRIBE.
* @returns RTSPCmdResult_t
*/
extern RTSPCmdResult_t
rtspDESCRIBE(RTSPClient * rtsp_client, char *uri);
/**
* Send an RTSP TEARDOWN command to the server.
*
* @param[in] rtsp_client Connection to send the TEARDOWN command for.
* @param[in] uri URI to TEARDOWN.
* @returns RTSPCmdResult_t
*/
extern RTSPCmdResult_t
rtspTEARDOWN(RTSPClient * rtsp_client, char *uri);
/**
* Send an RTSP PAUSE command to the server.
*
* @param[in] rtsp_client Connection to send the SETUP command for.
* @param[in] uri URI to PAUSE.
* @returns RTSPCmdResult_t
*/
extern RTSPCmdResult_t
rtspPAUSE(RTSPClient * rtsp_client, char *uri);
/**
* Send an RTSP PLAY command to the server.
*
* @param[in] rtsp_client Connection to send the SETUP command for.
* @param[in] uri URI to PLAY.
* @returns RTSPCmdResult_t
*/
extern RTSPCmdResult_t
rtspPLAY(RTSPClient * rtsp_client, char *uri);
/**
* Send an RTSP SETUP command to the server.
*
* @param[in] rtsp_client Connection to send the SETUP command for.
* @param[in] transport Transport protocol information to put
* into the Transport field.
* @param[in] uri URI of the resource.
*
* @returns RTSPCmdResult_t
*/
extern RTSPCmdResult_t
rtspSETUP(RTSPClient * rtsp_client,
RTSPTransportInfo_t * transport,
char *uri);
/**
* Remove a static header field from this session
*
* @returns TRUE if the field was found, FALSE if not
*/
extern int
rtsp_remove_static_header(RTSPClient *rtsp_client, char *field);
/**
* Add a static header field to be appended to each request/response.
* Example:
* rtsp_add_static_header(client, "Host", "www.test.com");
*
* @returns TRUE if the field was inserted, FALSE if not
*/
extern int
rtsp_add_static_header(RTSPClient * rtsp_client,
char *field, char *value);
/**
* Destroy an RTSP client connection.
*
* @param[in] rtsp_client Connection to destroy.
*/
extern void
rtsp_client_destroy(RTSPClient * rtsp_client);
/**
* Set the RTSP Scale parameter for a connection.
*
*/
extern void
rtsp_client_set_scale(RTSPClient * rtsp_client, int scale);
/**
* Return the user_context value that was passed into the create
* function.
*/
extern void *
rtsp_client_context(RTSPClient * rtsp_client);
/**
* Create an RTSP client connection.
*
* @param[in] complete_cb Function called to notify that a
* transaction has completed.
* @param[in] content_init_cb Function called to set up
* content reception.
* @param[in] user_context User context used in callbacks.
* @param[in] uri Parsed URI of stream.
*
* @returns A pointer to an RTSPClient if successfully allocated.
*/
extern RTSPClient *
rtsp_client_create(RTSPCompleteCb complete_cb,
HTTPContentInitCb content_init_cb,
void *user_context,
URI_t *uri);
/*;end emacs generated header for file rtsp_client.c. Global function declarations only. */
#endif
/*@}*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?