aboutsummaryrefslogtreecommitdiffstats
path: root/airtunes2.rst
diff options
context:
space:
mode:
Diffstat (limited to 'airtunes2.rst')
-rw-r--r--airtunes2.rst45
1 files changed, 31 insertions, 14 deletions
diff --git a/airtunes2.rst b/airtunes2.rst
index 6ec0e1b..8b06838 100644
--- a/airtunes2.rst
+++ b/airtunes2.rst
@@ -32,7 +32,7 @@ the server in the RECORD RTSP request).
Both are updated when sending audio packets. Audio data is encapsulated in
RTP packets which are sent sent as UDP packets to the audio port.
-There are ``TIMESTAMPS_PER_SECOND`` timestamp ticks per second (equivalent
+There are ``TIMESTAMPS_PER_SECOND`` RTP timestamp ticks per second (equivalent
to the number of frames per second).
Up to ``PACKET_BACKLOG`` audio packets should be kept around after encoding and
@@ -149,8 +149,11 @@ RtpHeader
}
-RtpTime
-~~~~~~~
+NTP Timestamp
+~~~~~~~~~~~~~
+
+This is an NTP Timestamp as described in RFC 3450 Section 4. and RFC 1305
+(TODO: check this is actually true)
::
@@ -164,6 +167,14 @@ RtpTime
}
+RTP Timestamp
+~~~~~~~~~~~~~
+
+This is a 32 bit network order value increasing by 1 for each frame of data
+transmitted, which means it increases by FRAMES_PER_PACKET for every RTP
+packet sent.
+
+
TimingPacket
~~~~~~~~~~~~
@@ -172,10 +183,10 @@ TimingPacket
/* sizeof(TimingPacket) == 32 */
struct TimingPacket {
RtpHeader header;
- RtpTime timestamp;
- RtpTime reference_time;
- RtpTime received_time;
- RtpTime send_time;
+ uint32_t zero_padding;
+ NtpTime reference_time;
+ NtpTime received_time;
+ NtpTime send_time;
}
@@ -187,9 +198,9 @@ SyncPacket
/* sizeof(SyncPacket) == 20 */
struct SyncPacket {
RtpHeader header;
- uint32_t timestamp;
- RtpTime some_time;
- uint32_t next_timestamp;
+ RtpTimestamp timestamp;
+ NtpTime some_time;
+ RtpTimestamp next_timestamp;
}
@@ -462,9 +473,15 @@ Replying to timing packet
TimingPacket res;
res.header = req.header;
res.header.payload_type = PAYLOAD_TIMING_RESPONSE;
- res.reftime = req.send_time;
+ /* these 3 times are NTP times (ie 64 bit values) */
+ res.reference_time = req.send_time;
res.received_time = time_now();
res.send_time = time_now();
+ /* TODO: is req.send_time the time on the server? the (virtual) NTP time
+ * of the audio packet that is being played by the server? Is one of the
+ * other timestamp the time on the sender, and the other one, some kind of
+ * "common time" to be used by the server and the sender?
+ */
send(res);
}
@@ -494,9 +511,9 @@ Sending sync packet
packet.header.extension = True;
}
- packet.now_timestamp = /* TODO */;
- packet.next_timestamp = timestamp;
- packet.some_time = /* TODO */;
+ packet.now_timestamp = /* TODO: RTP timestamp taking into account latency? */;
+ packet.next_timestamp = current_rtp_timestamp; /* RTP Timestamp that will be used for the next RTP audio packet */
+ packet.some_time = /* TODO: an NTP timestamp */
}