summaryrefslogtreecommitdiff
path: root/src/h264.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-03-04 12:33:30 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-03-04 12:33:30 +0100
commit7c27675cb85790652320cf231055ffee830ee595 (patch)
tree5c8fd561adae5678a61c7cb2fe33b18800c3789d /src/h264.c
parente3dbaea50b75bf2da6e7bc5baa1e82ba5adcd655 (diff)
h264: add function to convert NAL unit type to a string
Diffstat (limited to 'src/h264.c')
-rw-r--r--src/h264.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/h264.c b/src/h264.c
index 4ee36dc..5f56d9d 100644
--- a/src/h264.c
+++ b/src/h264.c
@@ -180,3 +180,26 @@ int h264_packetize(uint64_t rtp_ts, const uint8_t *buf, size_t len,
return err;
}
+
+
+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 "???";
+}