[pulseaudio-commits] r2500 - in /branches/coling/airtunes/src/modules/rtp: raop_client.c rtsp_client.c rtsp_client.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Mon Jun 9 14:59:42 PDT 2008
Author: coling
Date: Mon Jun 9 23:59:41 2008
New Revision: 2500
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2500&root=pulseaudio&view=rev
Log:
Add seq and rtptime params to record/flush with a view to using these for timing and device suspension
Modified:
branches/coling/airtunes/src/modules/rtp/raop_client.c
branches/coling/airtunes/src/modules/rtp/rtsp_client.c
branches/coling/airtunes/src/modules/rtp/rtsp_client.h
Modified: branches/coling/airtunes/src/modules/rtp/raop_client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/coling/airtunes/src/modules/rtp/raop_client.c?rev=2500&root=pulseaudio&r1=2499&r2=2500&view=diff
==============================================================================
--- branches/coling/airtunes/src/modules/rtp/raop_client.c (original)
+++ branches/coling/airtunes/src/modules/rtp/raop_client.c Mon Jun 9 23:59:41 2008
@@ -89,6 +89,9 @@
pa_socket_client *sc;
int fd;
+
+ uint16_t seq;
+ uint32_t rtptime;
pa_raop_client_cb_t callback;
void* userdata;
@@ -317,7 +320,7 @@
} else {
pa_log_warn("Audio Jack Status missing");
}
- pa_rtsp_record(c->rtsp);
+ pa_rtsp_record(c->rtsp, &c->seq, &c->rtptime);
break;
}
@@ -403,8 +406,6 @@
}
-static void noop(PA_GCC_UNUSED void* p) {}
-
int pa_raop_client_encode_sample(pa_raop_client* c, pa_memchunk* raw, pa_memchunk* encoded)
{
uint16_t len;
Modified: branches/coling/airtunes/src/modules/rtp/rtsp_client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/coling/airtunes/src/modules/rtp/rtsp_client.c?rev=2500&root=pulseaudio&r1=2499&r2=2500&view=diff
==============================================================================
--- branches/coling/airtunes/src/modules/rtp/rtsp_client.c (original)
+++ branches/coling/airtunes/src/modules/rtp/rtsp_client.c Mon Jun 9 23:59:41 2008
@@ -47,6 +47,8 @@
#include <pulsecore/strbuf.h>
#include <pulsecore/poll.h>
#include <pulsecore/ioline.h>
+#include <pulsecore/time-smoother.h>
+#include <pulsecore/rtclock.h>
#include "rtsp_client.h"
@@ -467,9 +469,10 @@
}
-int pa_rtsp_record(pa_rtsp_client* c) {
+int pa_rtsp_record(pa_rtsp_client* c, uint16_t* seq, uint32_t* rtptime) {
pa_headerlist* headers;
int rv;
+ char *info;
pa_assert(c);
if (!c->session) {
@@ -477,9 +480,14 @@
return -1;
}
+ /* Todo: Generate these values randomly as per spec */
+ *seq = *rtptime = 0;
+
headers = pa_headerlist_new();
pa_headerlist_puts(headers, "Range", "npt=0-");
- pa_headerlist_puts(headers, "RTP-Info", "seq=0;rtptime=0");
+ info = pa_sprintf_malloc("seq=%u;rtptime=%u", *seq, *rtptime);
+ pa_headerlist_puts(headers, "RTP-Info", info);
+ pa_xfree(info);
c->state = STATE_RECORD;
rv = rtsp_exec(c, "RECORD", NULL, NULL, 1, headers);
@@ -506,14 +514,17 @@
}
-int pa_rtsp_flush(pa_rtsp_client *c) {
+int pa_rtsp_flush(pa_rtsp_client *c, uint16_t seq, uint32_t rtptime) {
pa_headerlist* headers;
int rv;
+ char *info;
pa_assert(c);
headers = pa_headerlist_new();
- pa_headerlist_puts(headers, "RTP-Info", "seq=0;rtptime=0");
+ info = pa_sprintf_malloc("seq=%u;rtptime=%u", seq, rtptime);
+ pa_headerlist_puts(headers, "RTP-Info", info);
+ pa_xfree(info);
c->state = STATE_FLUSH;
rv = rtsp_exec(c, "FLUSH", NULL, NULL, 1, headers);
Modified: branches/coling/airtunes/src/modules/rtp/rtsp_client.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/coling/airtunes/src/modules/rtp/rtsp_client.h?rev=2500&root=pulseaudio&r1=2499&r2=2500&view=diff
==============================================================================
--- branches/coling/airtunes/src/modules/rtp/rtsp_client.h (original)
+++ branches/coling/airtunes/src/modules/rtp/rtsp_client.h Mon Jun 9 23:59:41 2008
@@ -66,10 +66,10 @@
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);
+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);
+int pa_rtsp_flush(pa_rtsp_client* c, uint16_t seq, uint32_t rtptime);
#endif
More information about the pulseaudio-commits
mailing list