History

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

Michael Niedermayer committed 14 years ago

Commit 53ce9902 parents a48b890 154486f16 files · +93 −30Browse files

Unified · Split

16 files
  1. Changelog +1 −1
  2. doc/APIchanges +3 −0
  3. doc/fate.texi +8 −0
  4. doc/protocols.texi +1 −1
  5. ffmpeg.c +6 −2
  6. libavformat/movenchint.c +3 −3
  7. libavformat/rtmpproto.c +2 −1
  8. libavformat/rtpenc.c +3 −1
  9. libavformat/rtpenc_chain.c +22 −11
  10. libavformat/rtpenc_chain.h +2 −2
  11. libavformat/rtsp.c +5 −3
  12. libavformat/sapenc.c +5 −3
  13. libavformat/version.h +1 −1
  14. libavutil/avutil.h +1 −1
  15. libavutil/opt.c +29 −0
  16. libavutil/opt.h +1 −0
Changelog+1−1
@@ -44,7 +44,7 @@ Fixes:CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777, · 43 unmodified lines
4444 - vorbis parser
4545 - png parser
4646 - audio mix filter
47−
47+- avprobe output is now standard INI or JSON.
4848
4949 version 0.10:
5050 - Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,
doc/APIchanges+3−0
@@ -31,6 +31,9 @@ API changes, most recent first: · 30 unmodified lines
3131 2012-03-26 - a67d9cf - lavfi 2.66.100
3232 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
3333
34+2012-05-25 - e0e0793 - lavu 51.31.0 - opt.h
35+ Add av_opt_set_bin()
36+
3437 2012-05-15 - lavfi 2.17.0
3538 Add support for audio filters
3639 ac71230/a2cd9be - add video/audio buffer sink in a new installed
doc/fate.texi+8−0
@@ -78,6 +78,9 @@ Do not put a '~' character in the samples path to indicate a home · 77 unmodified lines
7878 directory. Because of shell nuances, this will cause FATE to fail.
7979 @end float
8080
81+To use a custom wrapper to run the test, pass @option{--target-exec} to
82+@command{configure} or set the @var{TARGET_EXEC} Make variable.
83+
8184
8285 @chapter Submitting the results to the FFmpeg result aggregation server
8386
@@ -168,6 +171,11 @@ the synchronisation of the samples directory. · 84 unmodified lines
168171 quite useful to detect thread-related regressions.
169172 @item CPUFLAGS
170173 Specify CPU flags.
174+@item TARGET_EXEC
175+ Specify or override the wrapper used to run the tests.
176+ The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
177+ @command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
178+ through @command{ssh}.
171179 @end table
172180
173181 Example:
doc/protocols.texi+1−1
@@ -194,7 +194,7 @@ content across a TCP/IP network. · 193 unmodified lines
194194
195195 The required syntax is:
196196 @example
197−rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
197+rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
198198 @end example
199199
200200 The accepted parameters are:
ffmpeg.c+6−2
@@ -3294,8 +3294,12 @@ static int transcode_init(void) · 3293 unmodified lines
32943294 for (i = 0; i < nb_output_files; i++) {
32953295 oc = output_files[i]->ctx;
32963296 oc->interrupt_callback = int_cb;
3297− if (avformat_write_header(oc, &output_files[i]->opts) < 0) {
3298− snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?)", i);
3297+ if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) {
3298+ char errbuf[128];
3299+ const char *errbuf_ptr = errbuf;
3300+ if (av_strerror(ret, errbuf, sizeof(errbuf)) < 0)
3301+ errbuf_ptr = strerror(AVUNERROR(ret));
3302+ snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?): %s", i, errbuf_ptr);
32993303 ret = AVERROR(EINVAL);
33003304 goto dump_format;
33013305 }
libavformat/movenchint.c+3−3
@@ -43,9 +43,9 @@ int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index) · 42 unmodified lines
4343 track->enc->codec_type = AVMEDIA_TYPE_DATA;
4444 track->enc->codec_tag = track->tag;
4545
46− track->rtp_ctx = ff_rtp_chain_mux_open(s, src_st, NULL,
47− RTP_MAX_PACKET_SIZE);
48− if (!track->rtp_ctx)
46+ ret = ff_rtp_chain_mux_open(&track->rtp_ctx, s, src_st, NULL,
47+ RTP_MAX_PACKET_SIZE);
48+ if (ret < 0)
4949 goto fail;
5050
5151 /* Copy the RTP AVStream timebase back to the hint AVStream */
libavformat/rtmpproto.c+2−1
@@ -1037,9 +1037,10 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 1036 unmodified lines
10371037 fname = next;
10381038 rt->app[0] = '\0';
10391039 } else {
1040+ // make sure we do not mismatch a playpath for an application instance
10401041 char *c = strchr(p + 1, ':');
10411042 fname = strchr(p + 1, '/');
1042− if (!fname || c < fname) {
1043+ if (!fname || (c && c < fname)) {
10431044 fname = p + 1;
10441045 av_strlcpy(rt->app, path + 1, p - path);
10451046 } else {
libavformat/rtpenc.c+3−1
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 static const AVOption options[] = {
3434 FF_RTP_FLAG_OPTS(RTPMuxContext, flags)
3535 { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },
36+ { "ssrc", "Stream identifier", offsetof(RTPMuxContext, ssrc), AV_OPT_TYPE_INT, { 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
3637 { NULL },
3738 };
3839
@@ -101,7 +102,8 @@ static int rtp_write_header(AVFormatContext *s1) · 62 unmodified lines
101102 s->base_timestamp = av_get_random_seed();
102103 s->timestamp = s->base_timestamp;
103104 s->cur_timestamp = 0;
104− s->ssrc = av_get_random_seed();
105+ if (!s->ssrc)
106+ s->ssrc = av_get_random_seed();
105107 s->first_packet = 1;
106108 s->first_rtcp_ntp_time = ff_ntp_time();
107109 if (s1->start_time_realtime)
libavformat/rtpenc_chain.c+22−11
@@ -25,27 +25,31 @@ · 24 unmodified lines
2525 #include "avio_internal.h"
2626 #include "libavutil/opt.h"
2727
28−AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
29− URLContext *handle, int packet_size)
28+int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
29+ AVStream *st, URLContext *handle, int packet_size)
3030 {
31− AVFormatContext *rtpctx;
31+ AVFormatContext *rtpctx = NULL;
3232 int ret;
3333 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
3434 uint8_t *rtpflags;
3535 AVDictionary *opts = NULL;
3636
37− if (!rtp_format)
38− return NULL;
37+ if (!rtp_format) {
38+ ret = AVERROR(ENOSYS);
39+ goto fail;
40+ }
3941
4042 /* Allocate an AVFormatContext for each output stream */
4143 rtpctx = avformat_alloc_context();
42− if (!rtpctx)
43− return NULL;
44+ if (!rtpctx) {
45+ ret = AVERROR(ENOMEM);
46+ goto fail;
47+ }
4448
4549 rtpctx->oformat = rtp_format;
4650 if (!avformat_new_stream(rtpctx, NULL)) {
47− av_free(rtpctx);
48− return NULL;
51+ ret = AVERROR(ENOMEM);
52+ goto fail;
4953 }
5054 /* Pass the interrupt callback on */
5155 rtpctx->interrupt_callback = s->interrupt_callback;
@@ -79,8 +83,15 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, · 27 unmodified lines
7983 av_free(ptr);
8084 }
8185 avformat_free_context(rtpctx);
82− return NULL;
86+ return ret;
8387 }
8488
85− return rtpctx;
89+ *out = rtpctx;
90+ return 0;
91+
92+fail:
93+ av_free(rtpctx);
94+ if (handle)
95+ ffurl_close(handle);
96+ return ret;
8697 }
libavformat/rtpenc_chain.h+2−2
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include "avformat.h"
2626 #include "url.h"
2727
28−AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
29− URLContext *handle, int packet_size);
28+int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
29+ AVStream *st, URLContext *handle, int packet_size);
3030
3131 #endif /* AVFORMAT_RTPENC_CHAIN_H */
libavformat/rtsp.c+5−3
@@ -606,11 +606,13 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) · 605 unmodified lines
606606 s->ctx_flags |= AVFMTCTX_NOHEADER;
607607
608608 if (s->oformat && CONFIG_RTSP_MUXER) {
609− rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
610− rtsp_st->rtp_handle,
611− RTSP_TCP_MAX_PACKET_SIZE);
609+ int ret = ff_rtp_chain_mux_open(&rtsp_st->transport_priv, s, st,
610+ rtsp_st->rtp_handle,
611+ RTSP_TCP_MAX_PACKET_SIZE);
612612 /* Ownership of rtp_handle is passed to the rtp mux context */
613613 rtsp_st->rtp_handle = NULL;
614+ if (ret < 0)
615+ return ret;
614616 } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
615617 rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
616618 rtsp_st->dynamic_protocol_context,
libavformat/sapenc.c+5−3
@@ -150,8 +150,10 @@ static int sap_write_header(AVFormatContext *s) · 149 unmodified lines
150150 ret = AVERROR(EIO);
151151 goto fail;
152152 }
153− s->streams[i]->priv_data = contexts[i] =
154− ff_rtp_chain_mux_open(s, s->streams[i], fd, 0);
153+ ret = ff_rtp_chain_mux_open(&contexts[i], s, s->streams[i], fd, 0);
154+ if (ret < 0)
155+ goto fail;
156+ s->streams[i]->priv_data = contexts[i];
155157 av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));
156158 }
157159
@@ -209,7 +211,7 @@ static int sap_write_header(AVFormatContext *s) · 51 unmodified lines
209211 pos += strlen(&sap->ann[pos]) + 1;
210212
211213 if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
212− sap->ann_size - pos)) {
214+ sap->ann_size - pos)) {
213215 ret = AVERROR_INVALIDDATA;
214216 goto fail;
215217 }
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131
3232 #define LIBAVFORMAT_VERSION_MAJOR 54
3333 #define LIBAVFORMAT_VERSION_MINOR 6
34−#define LIBAVFORMAT_VERSION_MICRO 100
34+#define LIBAVFORMAT_VERSION_MICRO 101
3535
3636 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3737 LIBAVFORMAT_VERSION_MINOR, \
libavutil/avutil.h+1−1
@@ -153,7 +153,7 @@ · 152 unmodified lines
153153 */
154154
155155 #define LIBAVUTIL_VERSION_MAJOR 51
156−#define LIBAVUTIL_VERSION_MINOR 54
156+#define LIBAVUTIL_VERSION_MINOR 55
157157 #define LIBAVUTIL_VERSION_MICRO 100
158158
159159 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
libavutil/opt.c+29−0
@@ -323,6 +323,35 @@ int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags) · 322 unmodified lines
323323 return set_number(obj, name, val.num, val.den, 1, search_flags);
324324 }
325325
326+int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
327+{
328+ void *target_obj;
329+ const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
330+ uint8_t *ptr;
331+ uint8_t **dst;
332+ int *lendst;
333+
334+ if (!o || !target_obj)
335+ return AVERROR_OPTION_NOT_FOUND;
336+
337+ if (o->type != AV_OPT_TYPE_BINARY)
338+ return AVERROR(EINVAL);
339+
340+ ptr = av_malloc(len);
341+ if (!ptr)
342+ return AVERROR(ENOMEM);
343+
344+ dst = (uint8_t **)(((uint8_t *)target_obj) + o->offset);
345+ lendst = (int *)(dst + 1);
346+
347+ av_free(*dst);
348+ *dst = ptr;
349+ *lendst = len;
350+ memcpy(ptr, val, len);
351+
352+ return 0;
353+}
354+
326355 #if FF_API_OLD_AVOPTIONS
327356 /**
328357 *
libavutil/opt.h+1−0
@@ -562,6 +562,7 @@ int av_opt_set (void *obj, const char *name, const char *val, int search_f · 561 unmodified lines
562562 int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
563563 int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
564564 int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
565+int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
565566 /**
566567 * @}
567568 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t