On 02/13/2015 11:18 PM, Diego Biurrun wrote:
On Fri, Feb 13, 2015 at 10:43:16PM +0100, Thomas Volkert wrote:
--- a/libavformat/rtpdec_hevc.c
+++ b/libavformat/rtpdec_hevc.c
@@ -355,6 +345,78 @@ 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;
+
+        /* pass the HEVC DONL field */
+        if (rtp_hevc_ctx->using_donl_field) {
+            buf += RTP_HEVC_DONL_FIELD_SIZE;
+            len -= RTP_HEVC_DONL_FIELD_SIZE;
+        }
+
+        /*
+         * pass 0: determine overall size of the A/V packet
+         * pass 1: create resulting A/V packet
+         */
+        {
+            int pass          = 0;
+            int pkt_size      = 0;
+            uint8_t *pkt_data = NULL;
Is there a reason to introduce a new block here instead of moving the
variable declarations up a bit?


I tried to avoid to reinvent everything.
My code is intentionally kept similar to the one of the H.264 parser.
Maybe we will find a way to generalize the code and use it both in the H.264 and HEVC parser in the near future.

Best regards,
Thomas.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to