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
44- vorbis parser44- vorbis parser
45- png parser45- png parser
46- audio mix filter46- audio mix filter
47 47- avprobe output is now standard INI or JSON.
48 48
49version 0.10:49version 0.10:
50- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,50- 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
312012-03-26 - a67d9cf - lavfi 2.66.100312012-03-26 - a67d9cf - lavfi 2.66.100
32 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.32 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
33 33
342012-05-25 - e0e0793 - lavu 51.31.0 - opt.h
35 Add av_opt_set_bin()
36
342012-05-15 - lavfi 2.17.0372012-05-15 - lavfi 2.17.0
35 Add support for audio filters38 Add support for audio filters
36 ac71230/a2cd9be - add video/audio buffer sink in a new installed39 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
78directory. Because of shell nuances, this will cause FATE to fail.78directory. Because of shell nuances, this will cause FATE to fail.
79@end float79@end float
80 80
81To 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
81 84
82@chapter Submitting the results to the FFmpeg result aggregation server85@chapter Submitting the results to the FFmpeg result aggregation server
83 86
@@ -168,6 +171,11 @@ the synchronisation of the samples directory. · 84 unmodified lines
168 quite useful to detect thread-related regressions.171 quite useful to detect thread-related regressions.
169@item CPUFLAGS172@item CPUFLAGS
170 Specify CPU flags.173 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}.
171@end table179@end table
172 180
173Example:181Example:
doc/protocols.texi+1−1
@@ -194,7 +194,7 @@ content across a TCP/IP network. · 193 unmodified lines
194 194
195The required syntax is:195The required syntax is:
196@example196@example
197rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]197rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
198@end example198@end example
199 199
200The accepted parameters are:200The accepted parameters are:
ffmpeg.c+6−2
@@ -3294,8 +3294,12 @@ static int transcode_init(void) · 3293 unmodified lines
3294 for (i = 0; i < nb_output_files; i++) {3294 for (i = 0; i < nb_output_files; i++) {
3295 oc = output_files[i]->ctx;3295 oc = output_files[i]->ctx;
3296 oc->interrupt_callback = int_cb;3296 oc->interrupt_callback = int_cb;
3297 if (avformat_write_header(oc, &output_files[i]->opts) < 0) {3297 if ((ret = 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);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);
3299 ret = AVERROR(EINVAL);3303 ret = AVERROR(EINVAL);
3300 goto dump_format;3304 goto dump_format;
3301 }3305 }
libavformat/movenchint.c+3−3
@@ -43,9 +43,9 @@ int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index) · 42 unmodified lines
43 track->enc->codec_type = AVMEDIA_TYPE_DATA;43 track->enc->codec_type = AVMEDIA_TYPE_DATA;
44 track->enc->codec_tag = track->tag;44 track->enc->codec_tag = track->tag;
45 45
46 track->rtp_ctx = ff_rtp_chain_mux_open(s, src_st, NULL,46 ret = ff_rtp_chain_mux_open(&track->rtp_ctx, s, src_st, NULL,
47 RTP_MAX_PACKET_SIZE);47 RTP_MAX_PACKET_SIZE);
48 if (!track->rtp_ctx)48 if (ret < 0)
49 goto fail;49 goto fail;
50 50
51 /* Copy the RTP AVStream timebase back to the hint AVStream */51 /* 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
1037 fname = next;1037 fname = next;
1038 rt->app[0] = '\0';1038 rt->app[0] = '\0';
1039 } else {1039 } else {
1040 // make sure we do not mismatch a playpath for an application instance
1040 char *c = strchr(p + 1, ':');1041 char *c = strchr(p + 1, ':');
1041 fname = strchr(p + 1, '/');1042 fname = strchr(p + 1, '/');
1042 if (!fname || c < fname) {1043 if (!fname || (c && c < fname)) {
1043 fname = p + 1;1044 fname = p + 1;
1044 av_strlcpy(rt->app, path + 1, p - path);1045 av_strlcpy(rt->app, path + 1, p - path);
1045 } else {1046 } else {
libavformat/rtpenc.c+3−1
@@ -33,6 +33,7 @@ · 32 unmodified lines
33static const AVOption options[] = {33static const AVOption options[] = {
34 FF_RTP_FLAG_OPTS(RTPMuxContext, flags)34 FF_RTP_FLAG_OPTS(RTPMuxContext, flags)
35 { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },35 { "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 },
36 { NULL },37 { NULL },
37};38};
38 39
@@ -101,7 +102,8 @@ static int rtp_write_header(AVFormatContext *s1) · 62 unmodified lines
101 s->base_timestamp = av_get_random_seed();102 s->base_timestamp = av_get_random_seed();
102 s->timestamp = s->base_timestamp;103 s->timestamp = s->base_timestamp;
103 s->cur_timestamp = 0;104 s->cur_timestamp = 0;
104 s->ssrc = av_get_random_seed();105 if (!s->ssrc)
106 s->ssrc = av_get_random_seed();
105 s->first_packet = 1;107 s->first_packet = 1;
106 s->first_rtcp_ntp_time = ff_ntp_time();108 s->first_rtcp_ntp_time = ff_ntp_time();
107 if (s1->start_time_realtime)109 if (s1->start_time_realtime)
libavformat/rtpenc_chain.c+22−11
@@ -25,27 +25,31 @@ · 24 unmodified lines
25#include "avio_internal.h"25#include "avio_internal.h"
26#include "libavutil/opt.h"26#include "libavutil/opt.h"
27 27
28AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,28int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
29 URLContext *handle, int packet_size)29 AVStream *st, URLContext *handle, int packet_size)
30{30{
31 AVFormatContext *rtpctx;31 AVFormatContext *rtpctx = NULL;
32 int ret;32 int ret;
33 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);33 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
34 uint8_t *rtpflags;34 uint8_t *rtpflags;
35 AVDictionary *opts = NULL;35 AVDictionary *opts = NULL;
36 36
37 if (!rtp_format)37 if (!rtp_format) {
38 return NULL;38 ret = AVERROR(ENOSYS);
39 goto fail;
40 }
39 41
40 /* Allocate an AVFormatContext for each output stream */42 /* Allocate an AVFormatContext for each output stream */
41 rtpctx = avformat_alloc_context();43 rtpctx = avformat_alloc_context();
42 if (!rtpctx)44 if (!rtpctx) {
43 return NULL;45 ret = AVERROR(ENOMEM);
46 goto fail;
47 }
44 48
45 rtpctx->oformat = rtp_format;49 rtpctx->oformat = rtp_format;
46 if (!avformat_new_stream(rtpctx, NULL)) {50 if (!avformat_new_stream(rtpctx, NULL)) {
47 av_free(rtpctx);51 ret = AVERROR(ENOMEM);
48 return NULL;52 goto fail;
49 }53 }
50 /* Pass the interrupt callback on */54 /* Pass the interrupt callback on */
51 rtpctx->interrupt_callback = s->interrupt_callback;55 rtpctx->interrupt_callback = s->interrupt_callback;
@@ -79,8 +83,15 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, · 27 unmodified lines
79 av_free(ptr);83 av_free(ptr);
80 }84 }
81 avformat_free_context(rtpctx);85 avformat_free_context(rtpctx);
82 return NULL;86 return ret;
83 }87 }
84 88
85 return rtpctx;89 *out = rtpctx;
90 return 0;
91
92fail:
93 av_free(rtpctx);
94 if (handle)
95 ffurl_close(handle);
96 return ret;
86}97}
libavformat/rtpenc_chain.h+2−2
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include "avformat.h"25#include "avformat.h"
26#include "url.h"26#include "url.h"
27 27
28AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,28int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
29 URLContext *handle, int packet_size);29 AVStream *st, URLContext *handle, int packet_size);
30 30
31#endif /* AVFORMAT_RTPENC_CHAIN_H */31#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
606 s->ctx_flags |= AVFMTCTX_NOHEADER;606 s->ctx_flags |= AVFMTCTX_NOHEADER;
607 607
608 if (s->oformat && CONFIG_RTSP_MUXER) {608 if (s->oformat && CONFIG_RTSP_MUXER) {
609 rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,609 int ret = ff_rtp_chain_mux_open(&rtsp_st->transport_priv, s, st,
610 rtsp_st->rtp_handle,610 rtsp_st->rtp_handle,
611 RTSP_TCP_MAX_PACKET_SIZE);611 RTSP_TCP_MAX_PACKET_SIZE);
612 /* Ownership of rtp_handle is passed to the rtp mux context */612 /* Ownership of rtp_handle is passed to the rtp mux context */
613 rtsp_st->rtp_handle = NULL;613 rtsp_st->rtp_handle = NULL;
614 if (ret < 0)
615 return ret;
614 } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)616 } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
615 rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,617 rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
616 rtsp_st->dynamic_protocol_context,618 rtsp_st->dynamic_protocol_context,
libavformat/sapenc.c+5−3
@@ -150,8 +150,10 @@ static int sap_write_header(AVFormatContext *s) · 149 unmodified lines
150 ret = AVERROR(EIO);150 ret = AVERROR(EIO);
151 goto fail;151 goto fail;
152 }152 }
153 s->streams[i]->priv_data = contexts[i] =153 ret = ff_rtp_chain_mux_open(&contexts[i], s, s->streams[i], fd, 0);
154 ff_rtp_chain_mux_open(s, s->streams[i], fd, 0);154 if (ret < 0)
155 goto fail;
156 s->streams[i]->priv_data = contexts[i];
155 av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));157 av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));
156 }158 }
157 159
@@ -209,7 +211,7 @@ static int sap_write_header(AVFormatContext *s) · 51 unmodified lines
209 pos += strlen(&sap->ann[pos]) + 1;211 pos += strlen(&sap->ann[pos]) + 1;
210 212
211 if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],213 if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
212 sap->ann_size - pos)) {214 sap->ann_size - pos)) {
213 ret = AVERROR_INVALIDDATA;215 ret = AVERROR_INVALIDDATA;
214 goto fail;216 goto fail;
215 }217 }
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#define LIBAVFORMAT_VERSION_MAJOR 5432#define LIBAVFORMAT_VERSION_MAJOR 54
33#define LIBAVFORMAT_VERSION_MINOR 633#define LIBAVFORMAT_VERSION_MINOR 6
34#define LIBAVFORMAT_VERSION_MICRO 10034#define LIBAVFORMAT_VERSION_MICRO 101
35 35
36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
37 LIBAVFORMAT_VERSION_MINOR, \37 LIBAVFORMAT_VERSION_MINOR, \
libavutil/avutil.h+1−1
@@ -153,7 +153,7 @@ · 152 unmodified lines
153 */153 */
154 154
155#define LIBAVUTIL_VERSION_MAJOR 51155#define LIBAVUTIL_VERSION_MAJOR 51
156#define LIBAVUTIL_VERSION_MINOR 54156#define LIBAVUTIL_VERSION_MINOR 55
157#define LIBAVUTIL_VERSION_MICRO 100157#define LIBAVUTIL_VERSION_MICRO 100
158 158
159#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \159#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
323 return set_number(obj, name, val.num, val.den, 1, search_flags);323 return set_number(obj, name, val.num, val.den, 1, search_flags);
324}324}
325 325
326int 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
326#if FF_API_OLD_AVOPTIONS355#if FF_API_OLD_AVOPTIONS
327/**356/**
328 *357 *
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
562int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);562int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
563int av_opt_set_double(void *obj, const char *name, double val, int search_flags);563int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
564int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);564int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
565int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
565/**566/**
566 * @}567 * @}
567 */568 */

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