RTP STAP-A and GStreamer
Rudolfs Bundulis
rudolfs.bundulis at gmail.com
Fri May 30 05:21:41 PDT 2014
I was looking at the code at gstrtph264depay.c that handles STAP-A:
case 24:
{
/* strip headers */
payload += header_len;
payload_len -= header_len;
rtph264depay->wait_start = FALSE;
/* STAP-A Single-time aggregation packet 5.7.1 */
while (payload_len > 2) {
/* 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | NALU Size |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
nalu_size = (payload[0] << 8) | payload[1];
/* dont include nalu_size */
if (nalu_size > (payload_len - 2))
nalu_size = payload_len - 2;
outsize = nalu_size + sizeof (sync_bytes);
outbuf = gst_buffer_new_and_alloc (outsize);
gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
if (rtph264depay->byte_stream) {
memcpy (map.data, sync_bytes, sizeof (sync_bytes));
} else {
map.data[0] = map.data[1] = 0;
map.data[2] = payload[0];
map.data[3] = payload[1];
}
/* strip NALU size */
payload += 2;
payload_len -= 2;
memcpy (map.data + sizeof (sync_bytes), payload, nalu_size);
gst_buffer_unmap (outbuf, &map);
gst_adapter_push (rtph264depay->adapter, outbuf);
payload += nalu_size;
payload_len -= nalu_size;
}
outsize = gst_adapter_available (rtph264depay->adapter);
outbuf = gst_adapter_take_buffer (rtph264depay->adapter, outsize);
outbuf = gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf,
timestamp,
marker);
break;
}
I'm not very familiar with the API's but is that fine that there is only one
call to gst_rtp_h264_depay_handle_nal() ? Shouldn't that be done for each
NAL in the STAP-A packet?
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/RTP-STAP-A-and-GStreamer-tp4667293p4667307.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list