Mercurial > libavformat.hg
diff sdp.c @ 3788:ca6df1ecb412 libavformat
Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
move it from sdp.c into utils.c. Also add new header internal.h specifically
for lavf-specific internal API. See discussion in "Realmedia patch" thread
on mailinglist.
author | rbultje |
---|---|
date | Wed, 27 Aug 2008 23:43:28 +0000 |
parents | e8d0c5f2ee60 |
children | 116a6910592c |
line wrap: on
line diff
--- a/sdp.c Wed Aug 27 20:28:11 2008 +0000 +++ b/sdp.c Wed Aug 27 23:43:28 2008 +0000 @@ -21,6 +21,7 @@ #include "libavutil/avstring.h" #include "libavutil/base64.h" #include "avformat.h" +#include "internal.h" #include "avc.h" #include "rtp.h" @@ -135,27 +136,6 @@ 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 @@ 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;