]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/sdp.c
Send RTSP OPTIONS command to detect server type.
[ffmpeg] / libavformat / sdp.c
index cf83e607105b733caed33d2cff030105185434cd..dfbe52e7dd5a3fddef367eb9e7c0c49a26026901 100644 (file)
@@ -21,6 +21,7 @@
 #include "libavutil/avstring.h"
 #include "libavutil/base64.h"
 #include "avformat.h"
+#include "internal.h"
 #include "avc.h"
 #include "rtp.h"
 
@@ -56,7 +57,7 @@ static void dest_write(char *buff, int size, const char *dest_addr, int ttl)
 static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
 {
     av_strlcatf(buff, size, "v=%d\r\n"
-                            "o=- %d %d IN IPV4 %s\r\n"
+                            "o=- %d %d IN IP4 %s\r\n"
                             "t=%d %d\r\n"
                             "s=%s\r\n"
                             "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",
@@ -135,27 +136,6 @@ static char *extradata2psets(AVCodecContext *c)
     return psets;
 }
 
-static void digit_to_char(char *dst, uint8_t src)
-{
-    if (src < 10) {
-        *dst = '0' + src;
-    } else {
-        *dst = 'A' + src - 10;
-    }
-}
-
-static char *data_to_hex(char *buff, const uint8_t *src, int s)
-{
-    int i;
-
-    for(i = 0; i < s; i++) {
-        digit_to_char(buff + 2 * i, src[i] >> 4);
-        digit_to_char(buff + 2 * i + 1, src[i] & 0xF);
-    }
-
-    return buff;
-}
-
 static char *extradata2config(AVCodecContext *c)
 {
     char *config;
@@ -171,7 +151,7 @@ static char *extradata2config(AVCodecContext *c)
         return NULL;
     }
     memcpy(config, "; config=", 9);
-    data_to_hex(config + 9, c->extradata, c->extradata_size);
+    ff_data_to_hex(config + 9, c->extradata, c->extradata_size);
     config[9 + c->extradata_size * 2] = 0;
 
     return config;