mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
raop: Cosmetic fixes / Match coding style
Reviewed-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
d623c689e6
commit
6665acac56
8 changed files with 252 additions and 222 deletions
|
|
@ -73,7 +73,7 @@ struct pa_rtsp_client {
|
|||
char *transport;
|
||||
};
|
||||
|
||||
pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char* hostname, uint16_t port, const char* useragent) {
|
||||
pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char *hostname, uint16_t port, const char *useragent) {
|
||||
pa_rtsp_client *c;
|
||||
|
||||
pa_assert(mainloop);
|
||||
|
|
@ -94,7 +94,7 @@ pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char* hostna
|
|||
return c;
|
||||
}
|
||||
|
||||
void pa_rtsp_client_free(pa_rtsp_client* c) {
|
||||
void pa_rtsp_client_free(pa_rtsp_client *c) {
|
||||
pa_assert(c);
|
||||
|
||||
if (c->sc)
|
||||
|
|
@ -355,25 +355,25 @@ void pa_rtsp_disconnect(pa_rtsp_client *c) {
|
|||
c->ioline = NULL;
|
||||
}
|
||||
|
||||
const char* pa_rtsp_localip(pa_rtsp_client* c) {
|
||||
const char* pa_rtsp_localip(pa_rtsp_client *c) {
|
||||
pa_assert(c);
|
||||
|
||||
return c->localip;
|
||||
}
|
||||
|
||||
uint32_t pa_rtsp_serverport(pa_rtsp_client* c) {
|
||||
uint32_t pa_rtsp_serverport(pa_rtsp_client *c) {
|
||||
pa_assert(c);
|
||||
|
||||
return c->rtp_port;
|
||||
}
|
||||
|
||||
void pa_rtsp_set_url(pa_rtsp_client* c, const char* url) {
|
||||
void pa_rtsp_set_url(pa_rtsp_client *c, const char *url) {
|
||||
pa_assert(c);
|
||||
|
||||
c->url = pa_xstrdup(url);
|
||||
}
|
||||
|
||||
void pa_rtsp_add_header(pa_rtsp_client *c, const char* key, const char* value) {
|
||||
void pa_rtsp_add_header(pa_rtsp_client *c, const char *key, const char *value) {
|
||||
pa_assert(c);
|
||||
pa_assert(key);
|
||||
pa_assert(value);
|
||||
|
|
@ -381,19 +381,19 @@ void pa_rtsp_add_header(pa_rtsp_client *c, const char* key, const char* value) {
|
|||
pa_headerlist_puts(c->headers, key, value);
|
||||
}
|
||||
|
||||
void pa_rtsp_remove_header(pa_rtsp_client *c, const char* key) {
|
||||
void pa_rtsp_remove_header(pa_rtsp_client *c, const char *key) {
|
||||
pa_assert(c);
|
||||
pa_assert(key);
|
||||
|
||||
pa_headerlist_remove(c->headers, key);
|
||||
}
|
||||
|
||||
static int rtsp_exec(pa_rtsp_client* c, const char* cmd,
|
||||
const char* content_type, const char* content,
|
||||
static int rtsp_exec(pa_rtsp_client *c, const char *cmd,
|
||||
const char *content_type, const char *content,
|
||||
int expect_response,
|
||||
pa_headerlist* headers) {
|
||||
pa_strbuf* buf;
|
||||
char* hdrs;
|
||||
pa_headerlist *headers) {
|
||||
pa_strbuf *buf;
|
||||
char *hdrs;
|
||||
|
||||
pa_assert(c);
|
||||
pa_assert(c->url);
|
||||
|
|
@ -443,17 +443,22 @@ static int rtsp_exec(pa_rtsp_client* c, const char* cmd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_rtsp_announce(pa_rtsp_client *c, const char* sdp) {
|
||||
int pa_rtsp_announce(pa_rtsp_client *c, const char *sdp) {
|
||||
int rv;
|
||||
|
||||
pa_assert(c);
|
||||
|
||||
if (!sdp)
|
||||
return -1;
|
||||
|
||||
c->state = STATE_ANNOUNCE;
|
||||
return rtsp_exec(c, "ANNOUNCE", "application/sdp", sdp, 1, NULL);
|
||||
rv = rtsp_exec(c, "ANNOUNCE", "application/sdp", sdp, 1, NULL);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int pa_rtsp_setup(pa_rtsp_client* c) {
|
||||
pa_headerlist* headers;
|
||||
int pa_rtsp_setup(pa_rtsp_client *c) {
|
||||
pa_headerlist *headers;
|
||||
int rv;
|
||||
|
||||
pa_assert(c);
|
||||
|
|
@ -463,16 +468,18 @@ int pa_rtsp_setup(pa_rtsp_client* c) {
|
|||
|
||||
c->state = STATE_SETUP;
|
||||
rv = rtsp_exec(c, "SETUP", NULL, NULL, 1, headers);
|
||||
|
||||
pa_headerlist_free(headers);
|
||||
return rv;
|
||||
}
|
||||
|
||||
int pa_rtsp_record(pa_rtsp_client* c, uint16_t* seq, uint32_t* rtptime) {
|
||||
pa_headerlist* headers;
|
||||
int rv;
|
||||
int pa_rtsp_record(pa_rtsp_client *c, uint16_t *seq, uint32_t *rtptime) {
|
||||
pa_headerlist *headers;
|
||||
char *info;
|
||||
int rv;
|
||||
|
||||
pa_assert(c);
|
||||
|
||||
if (!c->session) {
|
||||
/* No session in progress */
|
||||
return -1;
|
||||
|
|
@ -489,30 +496,40 @@ int pa_rtsp_record(pa_rtsp_client* c, uint16_t* seq, uint32_t* rtptime) {
|
|||
|
||||
c->state = STATE_RECORD;
|
||||
rv = rtsp_exec(c, "RECORD", NULL, NULL, 1, headers);
|
||||
|
||||
pa_headerlist_free(headers);
|
||||
return rv;
|
||||
}
|
||||
|
||||
int pa_rtsp_teardown(pa_rtsp_client *c) {
|
||||
int rv;
|
||||
|
||||
pa_assert(c);
|
||||
|
||||
c->state = STATE_TEARDOWN;
|
||||
return rtsp_exec(c, "TEARDOWN", NULL, NULL, 0, NULL);
|
||||
rv = rtsp_exec(c, "TEARDOWN", NULL, NULL, 0, NULL);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int pa_rtsp_setparameter(pa_rtsp_client *c, const char* param) {
|
||||
int pa_rtsp_setparameter(pa_rtsp_client *c, const char *param) {
|
||||
int rv;
|
||||
|
||||
pa_assert(c);
|
||||
|
||||
if (!param)
|
||||
return -1;
|
||||
|
||||
c->state = STATE_SET_PARAMETER;
|
||||
return rtsp_exec(c, "SET_PARAMETER", "text/parameters", param, 1, NULL);
|
||||
rv = rtsp_exec(c, "SET_PARAMETER", "text/parameters", param, 1, NULL);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int pa_rtsp_flush(pa_rtsp_client *c, uint16_t seq, uint32_t rtptime) {
|
||||
pa_headerlist* headers;
|
||||
int rv;
|
||||
char *info;
|
||||
int rv;
|
||||
|
||||
pa_assert(c);
|
||||
|
||||
|
|
@ -523,6 +540,7 @@ int pa_rtsp_flush(pa_rtsp_client *c, uint16_t seq, uint32_t rtptime) {
|
|||
|
||||
c->state = STATE_FLUSH;
|
||||
rv = rtsp_exec(c, "FLUSH", NULL, NULL, 1, headers);
|
||||
|
||||
pa_headerlist_free(headers);
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,29 +41,29 @@ typedef enum {
|
|||
STATE_SET_PARAMETER,
|
||||
STATE_DISCONNECTED
|
||||
} pa_rtsp_state;
|
||||
typedef void (*pa_rtsp_cb_t)(pa_rtsp_client *c, pa_rtsp_state state, pa_headerlist* hl, void *userdata);
|
||||
typedef void (*pa_rtsp_cb_t)(pa_rtsp_client *c, pa_rtsp_state state, pa_headerlist *hl, void *userdata);
|
||||
|
||||
pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char* hostname, uint16_t port, const char* useragent);
|
||||
void pa_rtsp_client_free(pa_rtsp_client* c);
|
||||
pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char *hostname, uint16_t port, const char *useragent);
|
||||
void pa_rtsp_client_free(pa_rtsp_client *c);
|
||||
|
||||
int pa_rtsp_connect(pa_rtsp_client* c);
|
||||
int pa_rtsp_connect(pa_rtsp_client *c);
|
||||
void pa_rtsp_set_callback(pa_rtsp_client *c, pa_rtsp_cb_t callback, void *userdata);
|
||||
|
||||
void pa_rtsp_disconnect(pa_rtsp_client* c);
|
||||
void pa_rtsp_disconnect(pa_rtsp_client *c);
|
||||
|
||||
const char* pa_rtsp_localip(pa_rtsp_client* c);
|
||||
uint32_t pa_rtsp_serverport(pa_rtsp_client* c);
|
||||
void pa_rtsp_set_url(pa_rtsp_client* c, const char* url);
|
||||
void pa_rtsp_add_header(pa_rtsp_client *c, const char* key, const char* value);
|
||||
void pa_rtsp_remove_header(pa_rtsp_client *c, const char* key);
|
||||
const char* pa_rtsp_localip(pa_rtsp_client *c);
|
||||
uint32_t pa_rtsp_serverport(pa_rtsp_client *c);
|
||||
void pa_rtsp_set_url(pa_rtsp_client *c, const char *url);
|
||||
void pa_rtsp_add_header(pa_rtsp_client *c, const char *key, const char *value);
|
||||
void pa_rtsp_remove_header(pa_rtsp_client *c, const char *key);
|
||||
|
||||
int pa_rtsp_announce(pa_rtsp_client* c, const char* sdp);
|
||||
int pa_rtsp_announce(pa_rtsp_client *c, const char *sdp);
|
||||
|
||||
int pa_rtsp_setup(pa_rtsp_client* c);
|
||||
int pa_rtsp_record(pa_rtsp_client* c, uint16_t* seq, uint32_t* rtptime);
|
||||
int pa_rtsp_teardown(pa_rtsp_client* c);
|
||||
int pa_rtsp_setup(pa_rtsp_client *c);
|
||||
int pa_rtsp_record(pa_rtsp_client *c, uint16_t *seq, uint32_t *rtptime);
|
||||
int pa_rtsp_teardown(pa_rtsp_client *c);
|
||||
|
||||
int pa_rtsp_setparameter(pa_rtsp_client* c, const char* param);
|
||||
int pa_rtsp_flush(pa_rtsp_client* c, uint16_t seq, uint32_t rtptime);
|
||||
int pa_rtsp_setparameter(pa_rtsp_client *c, const char *param);
|
||||
int pa_rtsp_flush(pa_rtsp_client *c, uint16_t seq, uint32_t rtptime);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue