[FFmpeg-cvslog] rtpdec_hevc: Implement parsing of aggregated packets

Thomas Volkert git at videolan.org
Sat Feb 21 13:32:38 CET 2015


ffmpeg | branch: master | Thomas Volkert <thomas at homer-conferencing.com> | Fri Feb 13 22:43:16 2015 +0100| [cbdd1806ead8758949f22b4e4f214b035c78e2b9] | committer: Martin Storsjö

rtpdec_hevc: Implement parsing of aggregated packets

With significant changes by Martin Storsjö, to use the shared
function instead of reimplementing it.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cbdd1806ead8758949f22b4e4f214b035c78e2b9
---

 libavformat/rtpdec_hevc.c |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c
index 6f1d680..98701a6 100644
--- a/libavformat/rtpdec_hevc.c
+++ b/libavformat/rtpdec_hevc.c
@@ -30,6 +30,7 @@
 #define RTP_HEVC_PAYLOAD_HEADER_SIZE  2
 #define RTP_HEVC_FU_HEADER_SIZE       1
 #define RTP_HEVC_DONL_FIELD_SIZE      2
+#define RTP_HEVC_DOND_FIELD_SIZE      1
 #define HEVC_SPECIFIED_NAL_UNIT_TYPES 48
 
 /* SDP out-of-band signaling data */
@@ -283,19 +284,6 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
     }
 
     switch (nal_type) {
-    /* aggregated packets (AP) */
-    case 48:
-        /* pass the HEVC payload header */
-        buf += RTP_HEVC_PAYLOAD_HEADER_SIZE;
-        len -= RTP_HEVC_PAYLOAD_HEADER_SIZE;
-
-        /* pass the HEVC DONL field */
-        if (rtp_hevc_ctx->using_donl_field) {
-            buf += RTP_HEVC_DONL_FIELD_SIZE;
-            len -= RTP_HEVC_DONL_FIELD_SIZE;
-        }
-
-        /* fall-through */
     /* video parameter set (VPS) */
     case 32:
     /* sequence parameter set (SPS) */
@@ -323,6 +311,19 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
         memcpy(pkt->data + sizeof(start_sequence), buf, len);
 
         break;
+    /* aggregated packet (AP) - with two or more NAL units */
+    case 48:
+        /* pass the HEVC payload header */
+        buf += RTP_HEVC_PAYLOAD_HEADER_SIZE;
+        len -= RTP_HEVC_PAYLOAD_HEADER_SIZE;
+
+        res = ff_h264_handle_aggregated_packet(ctx, pkt, buf, len,
+                                               rtp_hevc_ctx->using_donl_field ?
+                                               RTP_HEVC_DONL_FIELD_SIZE : 0,
+                                               NULL, 0);
+        if (res < 0)
+            return res;
+        break;
     /* fragmentation unit (FU) */
     case 49:
         /* pass the HEVC payload header */



More information about the ffmpeg-cvslog mailing list