• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Pipewireパッケージ(ちょっと変更)


Commit MetaInfo

修訂4823e573dcc3131e458310b1fdcb7a148d3db294 (tree)
時間2023-09-27 02:11:08
作者Christian Glombek <lorbus@fedo...>
CommiterChristian Glombek

Log Message

module-raop-sink: Send POST /feedback every 2 seconds

Change Summary

差異

--- a/src/modules/module-raop-sink.c
+++ b/src/modules/module-raop-sink.c
@@ -236,6 +236,7 @@ struct impl {
236236 uint16_t control_port;
237237 int control_fd;
238238 struct spa_source *control_source;
239+ struct spa_source *feedback_timer;
239240
240241 uint16_t timing_port;
241242 int timing_fd;
@@ -984,6 +985,14 @@ static int rtsp_send_volume(struct impl *impl)
984985 return rtsp_send(impl, "SET_PARAMETER", "text/parameters", header, rtsp_log_reply_status);
985986 }
986987
988+static void rtsp_do_post_feedback(void *data, uint64_t expirations)
989+{
990+ struct impl *impl = data;
991+
992+ pw_rtsp_client_url_send(impl->rtsp, "/feedback", "POST", &impl->headers->dict,
993+ NULL, NULL, 0, rtsp_log_reply_status, impl);
994+}
995+
987996 static int rtsp_record_reply(void *data, int status, const struct spa_dict *headers, const struct pw_array *content)
988997 {
989998 struct impl *impl = data;
@@ -994,9 +1003,19 @@ static int rtsp_record_reply(void *data, int status, const struct spa_dict *head
9941003 struct spa_pod_builder b;
9951004 struct spa_latency_info latency;
9961005 char progress[128];
1006+ struct timespec timeout, interval;
9971007
9981008 pw_log_info("record status: %d", status);
9991009
1010+ timeout.tv_sec = 2;
1011+ timeout.tv_nsec = 0;
1012+ interval.tv_sec = 2;
1013+ interval.tv_nsec = 0;
1014+
1015+ if (!impl->feedback_timer)
1016+ impl->feedback_timer = pw_loop_add_timer(impl->loop, rtsp_do_post_feedback, impl);
1017+ pw_loop_update_timer(impl->loop, impl->feedback_timer, &timeout, &interval, false);
1018+
10001019 if ((str = spa_dict_lookup(headers, "Audio-Latency")) != NULL) {
10011020 uint32_t l;
10021021 if (spa_atou32(str, &l, 0))
@@ -1574,6 +1593,10 @@ static void connection_cleanup(struct impl *impl)
15741593 close(impl->timing_fd);
15751594 impl->timing_fd = -1;
15761595 }
1596+ if (impl->feedback_timer != NULL) {
1597+ pw_loop_destroy_source(impl->loop, impl->feedback_timer);
1598+ impl->feedback_timer = NULL;
1599+ }
15771600 free(impl->auth_method);
15781601 impl->auth_method = NULL;
15791602 free(impl->realm);