* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "avstring.h"
+#include "libavutil/avstring.h"
+#include "libavutil/base64.h"
#include "avformat.h"
+#include "internal.h"
#include "avc.h"
-#include "base64.h"
#include "rtp.h"
#ifdef CONFIG_RTP_MUXER
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\r\n",
+ "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",
s->sdp_version,
s->id, s->version, s->src_addr,
s->start_time, s->end_time,
p++;
}
if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) {
- av_log(c, AV_LOG_ERROR, "Cannot BASE64 encode %d %d!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
+ av_log(c, AV_LOG_ERROR, "Cannot BASE64 encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
av_free(psets);
return NULL;
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;
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;