]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtp_h264.c
Make sure strcasecmp() is declared.
[ffmpeg] / libavformat / rtp_h264.c
index 69f4608366bf8cad8fb437efd9fc19a64d41a7a7..c83b3a71780a396c17dc1268091f975c54ea7fc9 100644 (file)
  *
  */
 
+#include "libavutil/base64.h"
+#include "libavutil/avstring.h"
+#include "libavcodec/bitstream.h"
 #include "avformat.h"
 #include "mpegts.h"
-#include "bitstream.h"
 
 #include <unistd.h>
 #include "network.h"
@@ -46,7 +48,6 @@
 
 #include "rtp_internal.h"
 #include "rtp_h264.h"
-#include "base64.h"
 
 /**
     RTP/H264 specific private data.
@@ -77,8 +78,8 @@ static void sdp_parse_fmtp_config_h264(AVStream * stream,
     assert(h264_data != NULL);
 
     if (!strcmp(attr, "packetization-mode")) {
-        av_log(NULL, AV_LOG_DEBUG, "H.264/RTP Packetization Mode: %d\n", atoi(attr));
-        h264_data->packetization_mode = atoi(attr);
+        av_log(NULL, AV_LOG_DEBUG, "H.264/RTP Packetization Mode: %d\n", atoi(value));
+        h264_data->packetization_mode = atoi(value);
         /*
            Packetization Mode:
            0 or not present: Single NAL mode (Only nals from 1-23 are allowed)
@@ -162,7 +163,7 @@ static int h264_handle_packet(RTPDemuxContext * s,
                               AVPacket * pkt,
                               uint32_t * timestamp,
                               const uint8_t * buf,
-                              int len)
+                              int len, int flags)
 {
 #ifdef DEBUG
     h264_rtp_extra_data *data = s->dynamic_protocol_context;
@@ -172,8 +173,10 @@ static int h264_handle_packet(RTPDemuxContext * s,
     int result= 0;
     uint8_t start_sequence[]= {0, 0, 1};
 
+#ifdef DEBUG
     assert(data);
     assert(data->cookie == MAGIC_COOKIE);
+#endif
     assert(buf);
 
     if (type >= 1 && type <= 23)
@@ -277,7 +280,7 @@ static int h264_handle_packet(RTPDemuxContext * s,
 
             // reconstruct this packet's true nal; only the data follows..
             reconstructed_nal = fu_indicator & (0xe0);  // the original nal forbidden bit and NRI are stored in this packet's nal;
-            reconstructed_nal |= (nal_type & 0x1f);
+            reconstructed_nal |= nal_type;
 
             // skip the fu_header...
             buf++;
@@ -285,7 +288,7 @@ static int h264_handle_packet(RTPDemuxContext * s,
 
 #ifdef DEBUG
             if (start_bit)
-                data->packet_types_received[nal_type & 0x1f]++;
+                data->packet_types_received[nal_type]++;
 #endif
             if(start_bit) {
                 // copy in the start sequence, and the reconstructed nal....
@@ -357,7 +360,7 @@ static int parse_h264_sdp_line(AVStream * stream, void *data,
 
     assert(h264_data->cookie == MAGIC_COOKIE);
 
-    if (strstart(p, "framesize:", &p)) {
+    if (av_strstart(p, "framesize:", &p)) {
         char buf1[50];
         char *dst = buf1;
 
@@ -375,7 +378,7 @@ static int parse_h264_sdp_line(AVStream * stream, void *data,
         codec->width = atoi(buf1);
         codec->height = atoi(p + 1); // skip the -
         codec->pix_fmt = PIX_FMT_YUV420P;
-    } else if (strstart(p, "fmtp:", &p)) {
+    } else if (av_strstart(p, "fmtp:", &p)) {
         char attr[256];
         char value[4096];
 
@@ -390,7 +393,7 @@ static int parse_h264_sdp_line(AVStream * stream, void *data,
             /* grab the codec extra_data from the config parameter of the fmtp line */
             sdp_parse_fmtp_config_h264(stream, h264_data, attr, value);
         }
-    } else if (strstart(p, "cliprect:", &p)) {
+    } else if (av_strstart(p, "cliprect:", &p)) {
         // could use this if we wanted.
     }