Commit 53ce9905 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents a48b8903 154486f9
......@@ -44,7 +44,7 @@ Fixes:CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777,
- vorbis parser
- png parser
- audio mix filter
- avprobe output is now standard INI or JSON.
version 0.10:
- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,
......
......@@ -31,6 +31,9 @@ API changes, most recent first:
2012-03-26 - a67d9cf - lavfi 2.66.100
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
Add support for audio filters
ac71230/a2cd9be - add video/audio buffer sink in a new installed
......
......@@ -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.
@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
......@@ -168,6 +171,11 @@ the synchronisation of the samples directory.
quite useful to detect thread-related regressions.
@item CPUFLAGS
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
Example:
......
......@@ -194,7 +194,7 @@ content across a TCP/IP network.
The required syntax is:
@example
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
@end example
The accepted parameters are:
......
......@@ -3294,8 +3294,12 @@ static int transcode_init(void)
for (i = 0; i < nb_output_files; i++) {
oc = output_files[i]->ctx;
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);
goto dump_format;
}
......
......@@ -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_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;
/* Copy the RTP AVStream timebase back to the hint AVStream */
......
......@@ -1037,9 +1037,10 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
fname = next;
rt->app[0] = '\0';
} else {
// make sure we do not mismatch a playpath for an application instance
char *c = strchr(p + 1, ':');
fname = strchr(p + 1, '/');
if (!fname || c < fname) {
if (!fname || (c && c < fname)) {
fname = p + 1;
av_strlcpy(rt->app, path + 1, p - path);
} else {
......
......@@ -33,6 +33,7 @@
static const AVOption options[] = {
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 },
{ "ssrc", "Stream identifier", offsetof(RTPMuxContext, ssrc), AV_OPT_TYPE_INT, { 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
};
......@@ -101,7 +102,8 @@ static int rtp_write_header(AVFormatContext *s1)
s->base_timestamp = av_get_random_seed();
s->timestamp = s->base_timestamp;
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_rtcp_ntp_time = ff_ntp_time();
if (s1->start_time_realtime)
......
......@@ -25,27 +25,31 @@
#include "avio_internal.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;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
uint8_t *rtpflags;
AVDictionary *opts = NULL;
if (!rtp_format)
return NULL;
if (!rtp_format) {
ret = AVERROR(ENOSYS);
goto fail;
}
/* Allocate an AVFormatContext for each output stream */
rtpctx = avformat_alloc_context();
if (!rtpctx)
return NULL;
if (!rtpctx) {
ret = AVERROR(ENOMEM);
goto fail;
}
rtpctx->oformat = rtp_format;
if (!avformat_new_stream(rtpctx, NULL)) {
av_free(rtpctx);
return NULL;
ret = AVERROR(ENOMEM);
goto fail;
}
/* Pass the interrupt callback on */
rtpctx->interrupt_callback = s->interrupt_callback;
......@@ -79,8 +83,15 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
av_free(ptr);
}
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;
}
......@@ -25,7 +25,7 @@
#include "avformat.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 */
......@@ -606,11 +606,13 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
s->ctx_flags |= AVFMTCTX_NOHEADER;
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 */
rtsp_st->rtp_handle = NULL;
if (ret < 0)
return ret;
} else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
rtsp_st->dynamic_protocol_context,
......
......@@ -150,8 +150,10 @@ static int sap_write_header(AVFormatContext *s)
ret = AVERROR(EIO);
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));
}
......@@ -209,7 +211,7 @@ static int sap_write_header(AVFormatContext *s)
pos += strlen(&sap->ann[pos]) + 1;
if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
sap->ann_size - pos)) {
sap->ann_size - pos)) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
......
......@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 54
#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, \
LIBAVFORMAT_VERSION_MINOR, \
......
......@@ -153,7 +153,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 54
#define LIBAVUTIL_VERSION_MINOR 55
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
......
......@@ -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);
}
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
/**
*
......
......@@ -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_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_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
/**
* @}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment