summaryrefslogtreecommitdiff
path: root/src/h264.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/h264.c')
-rw-r--r--src/h264.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/h264.c b/src/h264.c
index 2bb4a26..3786559 100644
--- a/src/h264.c
+++ b/src/h264.c
@@ -104,7 +104,7 @@ 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, uint32_t rtp_ts,
+ bool eof, uint64_t rtp_ts,
videnc_packet_h *pkth, void *arg)
{
return pkth(eof, rtp_ts, hdr, hdr_sz, buf, sz, arg);
@@ -112,7 +112,7 @@ static int rtp_send_data(const uint8_t *hdr, size_t hdr_sz,
int h264_nal_send(bool first, bool last,
- bool marker, uint32_t ihdr, uint32_t rtp_ts,
+ bool marker, uint32_t ihdr, uint64_t rtp_ts,
const uint8_t *buf, size_t size, size_t maxsz,
videnc_packet_h *pkth, void *arg)
{
@@ -153,7 +153,7 @@ int h264_nal_send(bool first, bool last,
}
-int h264_packetize(uint32_t rtp_ts, const uint8_t *buf, size_t len,
+int h264_packetize(uint64_t rtp_ts, const uint8_t *buf, size_t len,
size_t pktsize, videnc_packet_h *pkth, void *arg)
{
const uint8_t *start = buf;
@@ -180,3 +180,33 @@ int h264_packetize(uint32_t rtp_ts, const uint8_t *buf, size_t len,
return err;
}
+
+
+/**
+ * Get the name of an H.264 nal unit
+ *
+ * @param type NAL unit type
+ *
+ * @return A string containing the NAL unit name
+ */
+const char *h264_nalunit_name(int type)
+{
+ switch (type) {
+
+ case H264_NAL_SLICE: return "SLICE";
+ case H264_NAL_DPA: return "DPA";
+ case H264_NAL_DPB: return "DPB";
+ case H264_NAL_DPC: return "DPC";
+ case H264_NAL_IDR_SLICE: return "IDR_SLICE";
+ case H264_NAL_SEI: return "SEI";
+ case H264_NAL_SPS: return "SPS";
+ case H264_NAL_PPS: return "PPS";
+ case H264_NAL_AUD: return "AUD";
+ case H264_NAL_FILLER_DATA: return "FILLER";
+
+ case H264_NAL_FU_A: return "FU-A";
+ case H264_NAL_FU_B: return "FU-B";
+ }
+
+ return "???";
+}