mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
module-raop-sink: Send POST /feedback every 2 seconds
This commit is contained in:
parent
2ae850aa49
commit
4823e573dc
1 changed files with 23 additions and 0 deletions
|
|
@ -236,6 +236,7 @@ struct impl {
|
||||||
uint16_t control_port;
|
uint16_t control_port;
|
||||||
int control_fd;
|
int control_fd;
|
||||||
struct spa_source *control_source;
|
struct spa_source *control_source;
|
||||||
|
struct spa_source *feedback_timer;
|
||||||
|
|
||||||
uint16_t timing_port;
|
uint16_t timing_port;
|
||||||
int timing_fd;
|
int timing_fd;
|
||||||
|
|
@ -984,6 +985,14 @@ static int rtsp_send_volume(struct impl *impl)
|
||||||
return rtsp_send(impl, "SET_PARAMETER", "text/parameters", header, rtsp_log_reply_status);
|
return rtsp_send(impl, "SET_PARAMETER", "text/parameters", header, rtsp_log_reply_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rtsp_do_post_feedback(void *data, uint64_t expirations)
|
||||||
|
{
|
||||||
|
struct impl *impl = data;
|
||||||
|
|
||||||
|
pw_rtsp_client_url_send(impl->rtsp, "/feedback", "POST", &impl->headers->dict,
|
||||||
|
NULL, NULL, 0, rtsp_log_reply_status, impl);
|
||||||
|
}
|
||||||
|
|
||||||
static int rtsp_record_reply(void *data, int status, const struct spa_dict *headers, const struct pw_array *content)
|
static int rtsp_record_reply(void *data, int status, const struct spa_dict *headers, const struct pw_array *content)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
|
|
@ -994,9 +1003,19 @@ static int rtsp_record_reply(void *data, int status, const struct spa_dict *head
|
||||||
struct spa_pod_builder b;
|
struct spa_pod_builder b;
|
||||||
struct spa_latency_info latency;
|
struct spa_latency_info latency;
|
||||||
char progress[128];
|
char progress[128];
|
||||||
|
struct timespec timeout, interval;
|
||||||
|
|
||||||
pw_log_info("record status: %d", status);
|
pw_log_info("record status: %d", status);
|
||||||
|
|
||||||
|
timeout.tv_sec = 2;
|
||||||
|
timeout.tv_nsec = 0;
|
||||||
|
interval.tv_sec = 2;
|
||||||
|
interval.tv_nsec = 0;
|
||||||
|
|
||||||
|
if (!impl->feedback_timer)
|
||||||
|
impl->feedback_timer = pw_loop_add_timer(impl->loop, rtsp_do_post_feedback, impl);
|
||||||
|
pw_loop_update_timer(impl->loop, impl->feedback_timer, &timeout, &interval, false);
|
||||||
|
|
||||||
if ((str = spa_dict_lookup(headers, "Audio-Latency")) != NULL) {
|
if ((str = spa_dict_lookup(headers, "Audio-Latency")) != NULL) {
|
||||||
uint32_t l;
|
uint32_t l;
|
||||||
if (spa_atou32(str, &l, 0))
|
if (spa_atou32(str, &l, 0))
|
||||||
|
|
@ -1574,6 +1593,10 @@ static void connection_cleanup(struct impl *impl)
|
||||||
close(impl->timing_fd);
|
close(impl->timing_fd);
|
||||||
impl->timing_fd = -1;
|
impl->timing_fd = -1;
|
||||||
}
|
}
|
||||||
|
if (impl->feedback_timer != NULL) {
|
||||||
|
pw_loop_destroy_source(impl->loop, impl->feedback_timer);
|
||||||
|
impl->feedback_timer = NULL;
|
||||||
|
}
|
||||||
free(impl->auth_method);
|
free(impl->auth_method);
|
||||||
impl->auth_method = NULL;
|
impl->auth_method = NULL;
|
||||||
free(impl->realm);
|
free(impl->realm);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue