]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec.c
fate: exit with error immediately if test command fails
[ffmpeg] / libavformat / rtpdec.c
index 456e2e42de4a3ec7669236087b26ad12c5f5b066..ca06bfff0044b86730157a58953f5620f6ad89eb 100644 (file)
@@ -35,6 +35,7 @@
 #include "rtpdec_h263.h"
 #include "rtpdec_h264.h"
 #include "rtpdec_mpeg4.h"
+#include "rtpdec_svq3.h"
 #include "rtpdec_xiph.h"
 
 //#define DEBUG
@@ -68,6 +69,7 @@ void av_register_rtp_dynamic_payload_handlers(void)
     ff_register_dynamic_payload_handler(&ff_h264_dynamic_handler);
     ff_register_dynamic_payload_handler(&ff_vorbis_dynamic_handler);
     ff_register_dynamic_payload_handler(&ff_theora_dynamic_handler);
+    ff_register_dynamic_payload_handler(&ff_svq3_dynamic_handler);
 
     ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfv_handler);
     ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfa_handler);
@@ -531,3 +533,37 @@ void rtp_parse_close(RTPDemuxContext *s)
     }
     av_free(s);
 }
+
+int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
+                  int (*parse_fmtp)(AVStream *stream,
+                                    PayloadContext *data,
+                                    char *attr, char *value))
+{
+    char attr[256];
+    char *value;
+    int res;
+    int value_size = strlen(p) + 1;
+
+    if (!(value = av_malloc(value_size))) {
+        av_log(stream, AV_LOG_ERROR, "Failed to allocate data for FMTP.");
+        return AVERROR(ENOMEM);
+    }
+
+    // remove protocol identifier
+    while (*p && *p == ' ') p++; // strip spaces
+    while (*p && *p != ' ') p++; // eat protocol identifier
+    while (*p && *p == ' ') p++; // strip trailing spaces
+
+    while (ff_rtsp_next_attr_and_value(&p,
+                                       attr, sizeof(attr),
+                                       value, value_size)) {
+
+        res = parse_fmtp(stream, data, attr, value);
+        if (res < 0 && res != AVERROR_PATCHWELCOME) {
+            av_free(value);
+            return res;
+        }
+    }
+    av_free(value);
+    return 0;
+}