summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-26 22:37:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-26 22:37:37 +0200
commit53ce9905134e042516ddd7a4476dc668c0b094c4 (patch)
tree05e80abb4ef8b78c7c93bc920b32fb34ac268cc7
parenta48b890392aa22033f182421ba9e3f3b3256461d (diff)
parent154486f9adc621e620dacd76d78c30a02cc1dcd3 (diff)
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>
-rw-r--r--Changelog2
-rw-r--r--doc/APIchanges3
-rw-r--r--doc/fate.texi8
-rw-r--r--doc/protocols.texi2
-rw-r--r--ffmpeg.c8
-rw-r--r--libavformat/movenchint.c6
-rw-r--r--libavformat/rtmpproto.c3
-rw-r--r--libavformat/rtpenc.c4
-rw-r--r--libavformat/rtpenc_chain.c33
-rw-r--r--libavformat/rtpenc_chain.h4
-rw-r--r--libavformat/rtsp.c8
-rw-r--r--libavformat/sapenc.c8
-rw-r--r--libavformat/version.h2
-rw-r--r--libavutil/avutil.h2
-rw-r--r--libavutil/opt.c29
-rw-r--r--libavutil/opt.h1
16 files changed, 93 insertions, 30 deletions
diff --git a/Changelog b/Changelog
index 18b5d49f6f..0c01ec4139 100644
--- a/Changelog
+++ b/Changelog
@@ -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,
diff --git a/doc/APIchanges b/doc/APIchanges
index b6b78b5237..b14204af29 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -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
diff --git a/doc/fate.texi b/doc/fate.texi
index 07d8c53599..cfb694ab65 100644
--- a/doc/fate.texi
+++ b/doc/fate.texi
@@ -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:
diff --git a/doc/protocols.texi b/doc/protocols.texi
index ae1c9b84e6..4575a679b9 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -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:
diff --git a/ffmpeg.c b/ffmpeg.c
index fad21c0b61..d8396dc1f9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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;
}
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index 1ee59877d2..9c4ddeb372 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -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 */
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 0f643e6c8a..a9e39a50bb 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -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 {
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index c2736b1728..57d025a364 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -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)
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index e4edfc28e1..c0f9530ac8 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -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;
}
diff --git a/libavformat/rtpenc_chain.h b/libavformat/rtpenc_chain.h
index 8e6b80aa3f..1ba3617188 100644
--- a/libavformat/rtpenc_chain.h
+++ b/libavformat/rtpenc_chain.h
@@ -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 */
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 504b9f850d..e3b6e1df5f 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -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,
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 609dab4b40..c1923f31c6 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -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;
}
diff --git a/libavformat/version.h b/libavformat/version.h
index 1158fdf212..7042990579 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -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, \
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index ee8b071383..acef213c1c 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -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, \
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 3f4a5fe957..956edf5ce7 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -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
/**
*
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 1b1ebe2e41..dc0dfa791e 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -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);
/**
* @}
*/