summaryrefslogtreecommitdiff
path: root/src/h264.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/h264.c')
-rw-r--r--src/h264.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/h264.c b/src/h264.c
index 8da811d..2bb4a26 100644
--- a/src/h264.c
+++ b/src/h264.c
@@ -103,23 +103,24 @@ const uint8_t *h264_find_startcode(const uint8_t *p, const uint8_t *end)
static int rtp_send_data(const uint8_t *hdr, size_t hdr_sz,
- const uint8_t *buf, size_t sz, bool eof,
+ const uint8_t *buf, size_t sz,
+ bool eof, uint32_t rtp_ts,
videnc_packet_h *pkth, void *arg)
{
- return pkth(eof, hdr, hdr_sz, buf, sz, arg);
+ return pkth(eof, rtp_ts, hdr, hdr_sz, buf, sz, arg);
}
int h264_nal_send(bool first, bool last,
- bool marker, uint32_t ihdr, const uint8_t *buf,
- size_t size, size_t maxsz,
+ bool marker, uint32_t ihdr, uint32_t rtp_ts,
+ const uint8_t *buf, size_t size, size_t maxsz,
videnc_packet_h *pkth, void *arg)
{
uint8_t hdr = (uint8_t)ihdr;
int err = 0;
if (first && last && size <= maxsz) {
- err = rtp_send_data(&hdr, 1, buf, size, marker,
+ err = rtp_send_data(&hdr, 1, buf, size, marker, rtp_ts,
pkth, arg);
}
else {
@@ -133,6 +134,7 @@ int h264_nal_send(bool first, bool last,
while (size > sz) {
err |= rtp_send_data(fu_hdr, 2, buf, sz, false,
+ rtp_ts,
pkth, arg);
buf += sz;
size -= sz;
@@ -143,6 +145,7 @@ int h264_nal_send(bool first, bool last,
fu_hdr[1] |= 1<<6; /* end bit */
err |= rtp_send_data(fu_hdr, 2, buf, size, marker && last,
+ rtp_ts,
pkth, arg);
}
@@ -150,8 +153,8 @@ int h264_nal_send(bool first, bool last,
}
-int h264_packetize(const uint8_t *buf, size_t len, size_t pktsize,
- videnc_packet_h *pkth, void *arg)
+int h264_packetize(uint32_t rtp_ts, const uint8_t *buf, size_t len,
+ size_t pktsize, videnc_packet_h *pkth, void *arg)
{
const uint8_t *start = buf;
const uint8_t *end = buf + len;
@@ -170,7 +173,7 @@ int h264_packetize(const uint8_t *buf, size_t len, size_t pktsize,
r1 = h264_find_startcode(r, end);
err |= h264_nal_send(true, true, (r1 >= end), r[0],
- r+1, r1-r-1, pktsize,
+ rtp_ts, r+1, r1-r-1, pktsize,
pkth, arg);
r = r1;
}