Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  opt: Add av_opt_set_bin()
  avconv: Display the error returned by avformat_write_header
  rtpenc_chain: Return an error code instead of just a plain pointer
  rtpenc_chain: Free the URLContext on failure
  rtpenc: Expose the ssrc as an avoption
  avprobe: display the codec profile in show_stream()
  avprobe: fix function prototype
  cosmetics: Fix indentation
  avprobe: changelog entry
  avprobe: update documentation
  avprobe: provide JSON output
  avprobe: output proper INI format
  avprobe: improve formatting
  rtmp: fix url parsing
  fate: document TARGET_EXEC and its usage

Conflicts:
	doc/APIchanges
	doc/fate.texi
	doc/ffprobe.texi
	ffprobe.c
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.0
Michael Niedermayer 13 years ago
parent
commit
53ce990513
16 changed files with 93 additions and 30 deletions
  1. +1
    -1
      Changelog
  2. +3
    -0
      doc/APIchanges
  3. +8
    -0
      doc/fate.texi
  4. +1
    -1
      doc/protocols.texi
  5. +6
    -2
      ffmpeg.c
  6. +3
    -3
      libavformat/movenchint.c
  7. +2
    -1
      libavformat/rtmpproto.c
  8. +3
    -1
      libavformat/rtpenc.c
  9. +22
    -11
      libavformat/rtpenc_chain.c
  10. +2
    -2
      libavformat/rtpenc_chain.h
  11. +5
    -3
      libavformat/rtsp.c
  12. +5
    -3
      libavformat/sapenc.c
  13. +1
    -1
      libavformat/version.h
  14. +1
    -1
      libavutil/avutil.h
  15. +29
    -0
      libavutil/opt.c
  16. +1
    -0
      libavutil/opt.h

+ 1
- 1
Changelog View File

@@ -44,7 +44,7 @@ Fixes:CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777,
- vorbis parser - vorbis parser
- png parser - png parser
- audio mix filter - audio mix filter
- avprobe output is now standard INI or JSON.


version 0.10: version 0.10:
- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936, - Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,


+ 3
- 0
doc/APIchanges View File

@@ -31,6 +31,9 @@ API changes, most recent first:
2012-03-26 - a67d9cf - lavfi 2.66.100 2012-03-26 - a67d9cf - lavfi 2.66.100
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions. Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.


2012-05-25 - e0e0793 - lavu 51.31.0 - opt.h
Add av_opt_set_bin()

2012-05-15 - lavfi 2.17.0 2012-05-15 - lavfi 2.17.0
Add support for audio filters Add support for audio filters
ac71230/a2cd9be - add video/audio buffer sink in a new installed ac71230/a2cd9be - add video/audio buffer sink in a new installed


+ 8
- 0
doc/fate.texi View File

@@ -78,6 +78,9 @@ Do not put a '~' character in the samples path to indicate a home
directory. Because of shell nuances, this will cause FATE to fail. directory. Because of shell nuances, this will cause FATE to fail.
@end float @end float


To use a custom wrapper to run the test, pass @option{--target-exec} to
@command{configure} or set the @var{TARGET_EXEC} Make variable.



@chapter Submitting the results to the FFmpeg result aggregation server @chapter Submitting the results to the FFmpeg result aggregation server


@@ -168,6 +171,11 @@ the synchronisation of the samples directory.
quite useful to detect thread-related regressions. quite useful to detect thread-related regressions.
@item CPUFLAGS @item CPUFLAGS
Specify CPU flags. Specify CPU flags.
@item TARGET_EXEC
Specify or override the wrapper used to run the tests.
The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
@command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
through @command{ssh}.
@end table @end table


Example: Example:


+ 1
- 1
doc/protocols.texi View File

@@ -194,7 +194,7 @@ content across a TCP/IP network.


The required syntax is: The required syntax is:
@example @example
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
@end example @end example


The accepted parameters are: The accepted parameters are:


+ 6
- 2
ffmpeg.c View File

@@ -3294,8 +3294,12 @@ static int transcode_init(void)
for (i = 0; i < nb_output_files; i++) { for (i = 0; i < nb_output_files; i++) {
oc = output_files[i]->ctx; oc = output_files[i]->ctx;
oc->interrupt_callback = int_cb; oc->interrupt_callback = int_cb;
if (avformat_write_header(oc, &output_files[i]->opts) < 0) {
snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?)", i);
if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) {
char errbuf[128];
const char *errbuf_ptr = errbuf;
if (av_strerror(ret, errbuf, sizeof(errbuf)) < 0)
errbuf_ptr = strerror(AVUNERROR(ret));
snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?): %s", i, errbuf_ptr);
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto dump_format; goto dump_format;
} }


+ 3
- 3
libavformat/movenchint.c View File

@@ -43,9 +43,9 @@ int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
track->enc->codec_type = AVMEDIA_TYPE_DATA; track->enc->codec_type = AVMEDIA_TYPE_DATA;
track->enc->codec_tag = track->tag; track->enc->codec_tag = track->tag;


track->rtp_ctx = ff_rtp_chain_mux_open(s, src_st, NULL,
RTP_MAX_PACKET_SIZE);
if (!track->rtp_ctx)
ret = ff_rtp_chain_mux_open(&track->rtp_ctx, s, src_st, NULL,
RTP_MAX_PACKET_SIZE);
if (ret < 0)
goto fail; goto fail;


/* Copy the RTP AVStream timebase back to the hint AVStream */ /* Copy the RTP AVStream timebase back to the hint AVStream */


+ 2
- 1
libavformat/rtmpproto.c View File

@@ -1037,9 +1037,10 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
fname = next; fname = next;
rt->app[0] = '\0'; rt->app[0] = '\0';
} else { } else {
// make sure we do not mismatch a playpath for an application instance
char *c = strchr(p + 1, ':'); char *c = strchr(p + 1, ':');
fname = strchr(p + 1, '/'); fname = strchr(p + 1, '/');
if (!fname || c < fname) {
if (!fname || (c && c < fname)) {
fname = p + 1; fname = p + 1;
av_strlcpy(rt->app, path + 1, p - path); av_strlcpy(rt->app, path + 1, p - path);
} else { } else {


+ 3
- 1
libavformat/rtpenc.c View File

@@ -33,6 +33,7 @@
static const AVOption options[] = { static const AVOption options[] = {
FF_RTP_FLAG_OPTS(RTPMuxContext, flags) FF_RTP_FLAG_OPTS(RTPMuxContext, flags)
{ "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM }, { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },
{ "ssrc", "Stream identifier", offsetof(RTPMuxContext, ssrc), AV_OPT_TYPE_INT, { 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }, { NULL },
}; };


@@ -101,7 +102,8 @@ static int rtp_write_header(AVFormatContext *s1)
s->base_timestamp = av_get_random_seed(); s->base_timestamp = av_get_random_seed();
s->timestamp = s->base_timestamp; s->timestamp = s->base_timestamp;
s->cur_timestamp = 0; s->cur_timestamp = 0;
s->ssrc = av_get_random_seed();
if (!s->ssrc)
s->ssrc = av_get_random_seed();
s->first_packet = 1; s->first_packet = 1;
s->first_rtcp_ntp_time = ff_ntp_time(); s->first_rtcp_ntp_time = ff_ntp_time();
if (s1->start_time_realtime) if (s1->start_time_realtime)


+ 22
- 11
libavformat/rtpenc_chain.c View File

@@ -25,27 +25,31 @@
#include "avio_internal.h" #include "avio_internal.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"


AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
URLContext *handle, int packet_size)
int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
AVStream *st, URLContext *handle, int packet_size)
{ {
AVFormatContext *rtpctx;
AVFormatContext *rtpctx = NULL;
int ret; int ret;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
uint8_t *rtpflags; uint8_t *rtpflags;
AVDictionary *opts = NULL; AVDictionary *opts = NULL;


if (!rtp_format)
return NULL;
if (!rtp_format) {
ret = AVERROR(ENOSYS);
goto fail;
}


/* Allocate an AVFormatContext for each output stream */ /* Allocate an AVFormatContext for each output stream */
rtpctx = avformat_alloc_context(); rtpctx = avformat_alloc_context();
if (!rtpctx)
return NULL;
if (!rtpctx) {
ret = AVERROR(ENOMEM);
goto fail;
}


rtpctx->oformat = rtp_format; rtpctx->oformat = rtp_format;
if (!avformat_new_stream(rtpctx, NULL)) { if (!avformat_new_stream(rtpctx, NULL)) {
av_free(rtpctx);
return NULL;
ret = AVERROR(ENOMEM);
goto fail;
} }
/* Pass the interrupt callback on */ /* Pass the interrupt callback on */
rtpctx->interrupt_callback = s->interrupt_callback; rtpctx->interrupt_callback = s->interrupt_callback;
@@ -79,8 +83,15 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
av_free(ptr); av_free(ptr);
} }
avformat_free_context(rtpctx); avformat_free_context(rtpctx);
return NULL;
return ret;
} }


return rtpctx;
*out = rtpctx;
return 0;

fail:
av_free(rtpctx);
if (handle)
ffurl_close(handle);
return ret;
} }

+ 2
- 2
libavformat/rtpenc_chain.h View File

@@ -25,7 +25,7 @@
#include "avformat.h" #include "avformat.h"
#include "url.h" #include "url.h"


AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
URLContext *handle, int packet_size);
int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
AVStream *st, URLContext *handle, int packet_size);


#endif /* AVFORMAT_RTPENC_CHAIN_H */ #endif /* AVFORMAT_RTPENC_CHAIN_H */

+ 5
- 3
libavformat/rtsp.c View File

@@ -606,11 +606,13 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
s->ctx_flags |= AVFMTCTX_NOHEADER; s->ctx_flags |= AVFMTCTX_NOHEADER;


if (s->oformat && CONFIG_RTSP_MUXER) { if (s->oformat && CONFIG_RTSP_MUXER) {
rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
rtsp_st->rtp_handle,
RTSP_TCP_MAX_PACKET_SIZE);
int ret = ff_rtp_chain_mux_open(&rtsp_st->transport_priv, s, st,
rtsp_st->rtp_handle,
RTSP_TCP_MAX_PACKET_SIZE);
/* Ownership of rtp_handle is passed to the rtp mux context */ /* Ownership of rtp_handle is passed to the rtp mux context */
rtsp_st->rtp_handle = NULL; rtsp_st->rtp_handle = NULL;
if (ret < 0)
return ret;
} else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index, rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_protocol_context,


+ 5
- 3
libavformat/sapenc.c View File

@@ -150,8 +150,10 @@ static int sap_write_header(AVFormatContext *s)
ret = AVERROR(EIO); ret = AVERROR(EIO);
goto fail; goto fail;
} }
s->streams[i]->priv_data = contexts[i] =
ff_rtp_chain_mux_open(s, s->streams[i], fd, 0);
ret = ff_rtp_chain_mux_open(&contexts[i], s, s->streams[i], fd, 0);
if (ret < 0)
goto fail;
s->streams[i]->priv_data = contexts[i];
av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename)); av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));
} }


@@ -209,7 +211,7 @@ static int sap_write_header(AVFormatContext *s)
pos += strlen(&sap->ann[pos]) + 1; pos += strlen(&sap->ann[pos]) + 1;


if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos], if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
sap->ann_size - pos)) {
sap->ann_size - pos)) {
ret = AVERROR_INVALIDDATA; ret = AVERROR_INVALIDDATA;
goto fail; goto fail;
} }


+ 1
- 1
libavformat/version.h View File

@@ -31,7 +31,7 @@


#define LIBAVFORMAT_VERSION_MAJOR 54 #define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 6 #define LIBAVFORMAT_VERSION_MINOR 6
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_MICRO 101


#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \


+ 1
- 1
libavutil/avutil.h View File

@@ -153,7 +153,7 @@
*/ */


#define LIBAVUTIL_VERSION_MAJOR 51 #define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 54
#define LIBAVUTIL_VERSION_MINOR 55
#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_MICRO 100


#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \


+ 29
- 0
libavutil/opt.c View File

@@ -323,6 +323,35 @@ int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
return set_number(obj, name, val.num, val.den, 1, search_flags); return set_number(obj, name, val.num, val.den, 1, search_flags);
} }


int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
{
void *target_obj;
const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
uint8_t *ptr;
uint8_t **dst;
int *lendst;

if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND;

if (o->type != AV_OPT_TYPE_BINARY)
return AVERROR(EINVAL);

ptr = av_malloc(len);
if (!ptr)
return AVERROR(ENOMEM);

dst = (uint8_t **)(((uint8_t *)target_obj) + o->offset);
lendst = (int *)(dst + 1);

av_free(*dst);
*dst = ptr;
*lendst = len;
memcpy(ptr, val, len);

return 0;
}

#if FF_API_OLD_AVOPTIONS #if FF_API_OLD_AVOPTIONS
/** /**
* *


+ 1
- 0
libavutil/opt.h View File

@@ -562,6 +562,7 @@ int av_opt_set (void *obj, const char *name, const char *val, int search_f
int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags); int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
int av_opt_set_double(void *obj, const char *name, double val, int search_flags); int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags); int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
/** /**
* @} * @}
*/ */


Loading…
Cancel
Save