153a5a1b3Sopenharmony_ci#ifndef foortspclienthfoo 253a5a1b3Sopenharmony_ci#define foortspclienthfoo 353a5a1b3Sopenharmony_ci 453a5a1b3Sopenharmony_ci/*** 553a5a1b3Sopenharmony_ci This file is part of PulseAudio. 653a5a1b3Sopenharmony_ci 753a5a1b3Sopenharmony_ci Copyright 2008 Colin Guthrie 853a5a1b3Sopenharmony_ci 953a5a1b3Sopenharmony_ci PulseAudio is free software; you can redistribute it and/or modify 1053a5a1b3Sopenharmony_ci it under the terms of the GNU Lesser General Public License as published 1153a5a1b3Sopenharmony_ci by the Free Software Foundation; either version 2.1 of the License, 1253a5a1b3Sopenharmony_ci or (at your option) any later version. 1353a5a1b3Sopenharmony_ci 1453a5a1b3Sopenharmony_ci PulseAudio is distributed in the hope that it will be useful, but 1553a5a1b3Sopenharmony_ci WITHOUT ANY WARRANTY; without even the implied warranty of 1653a5a1b3Sopenharmony_ci MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1753a5a1b3Sopenharmony_ci General Public License for more details. 1853a5a1b3Sopenharmony_ci 1953a5a1b3Sopenharmony_ci You should have received a copy of the GNU Lesser General Public License 2053a5a1b3Sopenharmony_ci along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 2153a5a1b3Sopenharmony_ci***/ 2253a5a1b3Sopenharmony_ci 2353a5a1b3Sopenharmony_ci#include <inttypes.h> 2453a5a1b3Sopenharmony_ci#include <sys/socket.h> 2553a5a1b3Sopenharmony_ci#include <sys/types.h> 2653a5a1b3Sopenharmony_ci#include <netdb.h> 2753a5a1b3Sopenharmony_ci 2853a5a1b3Sopenharmony_ci#include <pulsecore/socket-client.h> 2953a5a1b3Sopenharmony_ci#include <pulse/mainloop-api.h> 3053a5a1b3Sopenharmony_ci 3153a5a1b3Sopenharmony_ci#include "headerlist.h" 3253a5a1b3Sopenharmony_ci 3353a5a1b3Sopenharmony_citypedef struct pa_rtsp_client pa_rtsp_client; 3453a5a1b3Sopenharmony_ci 3553a5a1b3Sopenharmony_citypedef enum pa_rtsp_state { 3653a5a1b3Sopenharmony_ci STATE_CONNECT, 3753a5a1b3Sopenharmony_ci STATE_OPTIONS, 3853a5a1b3Sopenharmony_ci STATE_ANNOUNCE, 3953a5a1b3Sopenharmony_ci STATE_SETUP, 4053a5a1b3Sopenharmony_ci STATE_RECORD, 4153a5a1b3Sopenharmony_ci STATE_SET_PARAMETER, 4253a5a1b3Sopenharmony_ci STATE_FLUSH, 4353a5a1b3Sopenharmony_ci STATE_TEARDOWN, 4453a5a1b3Sopenharmony_ci STATE_DISCONNECTED 4553a5a1b3Sopenharmony_ci} pa_rtsp_state_t; 4653a5a1b3Sopenharmony_ci 4753a5a1b3Sopenharmony_citypedef enum pa_rtsp_status { 4853a5a1b3Sopenharmony_ci STATUS_OK = 200, 4953a5a1b3Sopenharmony_ci STATUS_BAD_REQUEST = 400, 5053a5a1b3Sopenharmony_ci STATUS_UNAUTHORIZED = 401, 5153a5a1b3Sopenharmony_ci STATUS_NO_RESPONSE = 444, 5253a5a1b3Sopenharmony_ci STATUS_INTERNAL_ERROR = 500 5353a5a1b3Sopenharmony_ci} pa_rtsp_status_t; 5453a5a1b3Sopenharmony_ci 5553a5a1b3Sopenharmony_citypedef void (*pa_rtsp_cb_t)(pa_rtsp_client *c, pa_rtsp_state_t state, pa_rtsp_status_t code, pa_headerlist *headers, void *userdata); 5653a5a1b3Sopenharmony_ci 5753a5a1b3Sopenharmony_cipa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char *hostname, uint16_t port, const char *useragent, bool autoreconnect); 5853a5a1b3Sopenharmony_civoid pa_rtsp_client_free(pa_rtsp_client *c); 5953a5a1b3Sopenharmony_ci 6053a5a1b3Sopenharmony_ciint pa_rtsp_connect(pa_rtsp_client *c); 6153a5a1b3Sopenharmony_civoid pa_rtsp_set_callback(pa_rtsp_client *c, pa_rtsp_cb_t callback, void *userdata); 6253a5a1b3Sopenharmony_civoid pa_rtsp_disconnect(pa_rtsp_client *c); 6353a5a1b3Sopenharmony_ci 6453a5a1b3Sopenharmony_ciconst char* pa_rtsp_localip(pa_rtsp_client *c); 6553a5a1b3Sopenharmony_ciuint32_t pa_rtsp_serverport(pa_rtsp_client *c); 6653a5a1b3Sopenharmony_cibool pa_rtsp_exec_ready(const pa_rtsp_client *c); 6753a5a1b3Sopenharmony_ci 6853a5a1b3Sopenharmony_civoid pa_rtsp_set_url(pa_rtsp_client *c, const char *url); 6953a5a1b3Sopenharmony_ci 7053a5a1b3Sopenharmony_cibool pa_rtsp_has_header(pa_rtsp_client *c, const char *key); 7153a5a1b3Sopenharmony_civoid pa_rtsp_add_header(pa_rtsp_client *c, const char *key, const char *value); 7253a5a1b3Sopenharmony_ciconst char* pa_rtsp_get_header(pa_rtsp_client *c, const char *key); 7353a5a1b3Sopenharmony_civoid pa_rtsp_remove_header(pa_rtsp_client *c, const char *key); 7453a5a1b3Sopenharmony_ci 7553a5a1b3Sopenharmony_ciint pa_rtsp_options(pa_rtsp_client *c); 7653a5a1b3Sopenharmony_ciint pa_rtsp_announce(pa_rtsp_client *c, const char *sdp); 7753a5a1b3Sopenharmony_ciint pa_rtsp_setup(pa_rtsp_client *c, const char *transport); 7853a5a1b3Sopenharmony_ciint pa_rtsp_record(pa_rtsp_client *c, uint16_t *seq, uint32_t *rtptime); 7953a5a1b3Sopenharmony_ciint pa_rtsp_setparameter(pa_rtsp_client *c, const char *param); 8053a5a1b3Sopenharmony_ciint pa_rtsp_flush(pa_rtsp_client *c, uint16_t seq, uint32_t rtptime); 8153a5a1b3Sopenharmony_ciint pa_rtsp_teardown(pa_rtsp_client *c); 8253a5a1b3Sopenharmony_ci 8353a5a1b3Sopenharmony_ci#endif 84