[FFmpeg-cvslog] avfilter/vf_maskedclamp: ignore SAR from all inputs
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 11:19:19 2017 +0100| [2afeb3f8ab0041d470d905102d23080c88d67d92] | committer: Paul B Mahol avfilter/vf_maskedclamp: ignore SAR from all inputs Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2afeb3f8ab0041d470d905102d23080c88d67d92 --- libavfilter/vf_maskedclamp.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c index 67a979f8c0..9812e08533 100644 --- a/libavfilter/vf_maskedclamp.c +++ b/libavfilter/vf_maskedclamp.c @@ -235,27 +235,15 @@ static int config_output(AVFilterLink *outlink) av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n"); return AVERROR(EINVAL); } -if (base->w != dark->w || -base->h != dark->h || -base->sample_aspect_ratio.num != dark->sample_aspect_ratio.num || -base->sample_aspect_ratio.den != dark->sample_aspect_ratio.den || -base->w != bright->w || -base->h != bright->h || -base->sample_aspect_ratio.num != bright->sample_aspect_ratio.num || -base->sample_aspect_ratio.den != bright->sample_aspect_ratio.den) { +if (base->w != dark->w || base->h != dark->h || +base->w != bright->w || base->h != bright->h) { av_log(ctx, AV_LOG_ERROR, "First input link %s parameters " - "(size %dx%d, SAR %d:%d) do not match the corresponding " - "second input link %s parameters (%dx%d, SAR %d:%d) " - "and/or third input link %s parameters (%dx%d, SAR %d:%d)\n", + "(size %dx%d) do not match the corresponding " + "second input link %s parameters (%dx%d) " + "and/or third input link %s parameters (size %dx%d)\n", ctx->input_pads[0].name, base->w, base->h, - base->sample_aspect_ratio.num, - base->sample_aspect_ratio.den, ctx->input_pads[1].name, dark->w, dark->h, - dark->sample_aspect_ratio.num, - dark->sample_aspect_ratio.den, - ctx->input_pads[2].name, bright->w, bright->h, - bright->sample_aspect_ratio.num, - bright->sample_aspect_ratio.den); + ctx->input_pads[2].name, bright->w, bright->h); return AVERROR(EINVAL); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_blend: ignore SAR from all inputs
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 11:39:16 2017 +0100| [79aa9d8aeee0e164a1af2087f481f69d73969c6b] | committer: Paul B Mahol avfilter/vf_blend: ignore SAR from all inputs Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79aa9d8aeee0e164a1af2087f481f69d73969c6b --- libavfilter/vf_blend.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c index 054c0d55d0..70c37c75da 100644 --- a/libavfilter/vf_blend.c +++ b/libavfilter/vf_blend.c @@ -524,19 +524,12 @@ static int config_output(AVFilterLink *outlink) av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n"); return AVERROR(EINVAL); } -if (toplink->w != bottomlink->w || -toplink->h != bottomlink->h || -toplink->sample_aspect_ratio.num != bottomlink->sample_aspect_ratio.num || -toplink->sample_aspect_ratio.den != bottomlink->sample_aspect_ratio.den) { +if (toplink->w != bottomlink->w || toplink->h != bottomlink->h) { av_log(ctx, AV_LOG_ERROR, "First input link %s parameters " - "(size %dx%d, SAR %d:%d) do not match the corresponding " - "second input link %s parameters (%dx%d, SAR %d:%d)\n", + "(size %dx%d) do not match the corresponding " + "second input link %s parameters (size %dx%d)\n", ctx->input_pads[TOP].name, toplink->w, toplink->h, - toplink->sample_aspect_ratio.num, - toplink->sample_aspect_ratio.den, - ctx->input_pads[BOTTOM].name, bottomlink->w, bottomlink->h, - bottomlink->sample_aspect_ratio.num, - bottomlink->sample_aspect_ratio.den); + ctx->input_pads[BOTTOM].name, bottomlink->w, bottomlink->h); return AVERROR(EINVAL); } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_maskedmerge: ignore SAR from all inputs
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 11:43:06 2017 +0100| [789731affa81f7c7c11ae96e9ad89e6dfbef9ad3] | committer: Paul B Mahol avfilter/vf_maskedmerge: ignore SAR from all inputs Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=789731affa81f7c7c11ae96e9ad89e6dfbef9ad3 --- libavfilter/vf_maskedmerge.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c index d31b92659e..86559abdac 100644 --- a/libavfilter/vf_maskedmerge.c +++ b/libavfilter/vf_maskedmerge.c @@ -199,27 +199,15 @@ static int config_output(AVFilterLink *outlink) av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n"); return AVERROR(EINVAL); } -if (base->w != overlay->w || -base->h != overlay->h || -base->sample_aspect_ratio.num != overlay->sample_aspect_ratio.num || -base->sample_aspect_ratio.den != overlay->sample_aspect_ratio.den || -base->w != mask->w || -base->h != mask->h || -base->sample_aspect_ratio.num != mask->sample_aspect_ratio.num || -base->sample_aspect_ratio.den != mask->sample_aspect_ratio.den) { +if (base->w != overlay->w || base->h != overlay->h || +base->w != mask->w|| base->h != mask->h) { av_log(ctx, AV_LOG_ERROR, "First input link %s parameters " - "(size %dx%d, SAR %d:%d) do not match the corresponding " - "second input link %s parameters (%dx%d, SAR %d:%d) " - "and/or third input link %s parameters (%dx%d, SAR %d:%d)\n", + "(size %dx%d) do not match the corresponding " + "second input link %s parameters (size %dx%d) " + "and/or third input link %s parameters (size %dx%d)\n", ctx->input_pads[0].name, base->w, base->h, - base->sample_aspect_ratio.num, - base->sample_aspect_ratio.den, ctx->input_pads[1].name, overlay->w, overlay->h, - overlay->sample_aspect_ratio.num, - overlay->sample_aspect_ratio.den, - ctx->input_pads[2].name, mask->w, mask->h, - mask->sample_aspect_ratio.num, - mask->sample_aspect_ratio.den); + ctx->input_pads[2].name, mask->w, mask->h); return AVERROR(EINVAL); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_hysteresis: allow using framesync options
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 11:48:52 2017 +0100| [5f1bb258aba5bac5bb38483ec208e6e17a885ff7] | committer: Paul B Mahol avfilter/vf_hysteresis: allow using framesync options Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f1bb258aba5bac5bb38483ec208e6e17a885ff7 --- libavfilter/vf_hysteresis.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_hysteresis.c b/libavfilter/vf_hysteresis.c index edca40fa21..551b33f332 100644 --- a/libavfilter/vf_hysteresis.c +++ b/libavfilter/vf_hysteresis.c @@ -33,6 +33,7 @@ typedef struct HysteresisContext { const AVClass *class; +FFFrameSync fs; int planes; int threshold; @@ -40,7 +41,6 @@ typedef struct HysteresisContext { int width[4], height[4]; int nb_planes; int depth; -FFFrameSync fs; uint8_t *map; uint32_t *xy; @@ -58,8 +58,6 @@ static const AVOption hysteresis_options[] = { { NULL } }; -AVFILTER_DEFINE_CLASS(hysteresis); - static int query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat pix_fmts[] = { @@ -350,6 +348,8 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->xy); } +FRAMESYNC_DEFINE_CLASS(hysteresis, HysteresisContext, fs); + static const AVFilterPad hysteresis_inputs[] = { { .name = "base", @@ -375,6 +375,7 @@ static const AVFilterPad hysteresis_outputs[] = { AVFilter ff_vf_hysteresis = { .name = "hysteresis", .description = NULL_IF_CONFIG_SMALL("Grow first stream into second stream by connecting components."), +.preinit = hysteresis_framesync_preinit, .priv_size = sizeof(HysteresisContext), .uninit= uninit, .query_formats = query_formats, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_lut2: ignore SAR from all inputs
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 11:40:49 2017 +0100| [a28e70beab05a877ed277f5d93ba515b5874ffd7] | committer: Paul B Mahol avfilter/vf_lut2: ignore SAR from all inputs Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a28e70beab05a877ed277f5d93ba515b5874ffd7 --- libavfilter/vf_lut2.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c index 585d121ca3..1385cba9b1 100644 --- a/libavfilter/vf_lut2.c +++ b/libavfilter/vf_lut2.c @@ -304,20 +304,13 @@ static int lut2_config_output(AVFilterLink *outlink) av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n"); return AVERROR(EINVAL); } -if (srcx->w != srcy->w || -srcx->h != srcy->h || -srcx->sample_aspect_ratio.num != srcy->sample_aspect_ratio.num || -srcx->sample_aspect_ratio.den != srcy->sample_aspect_ratio.den) { +if (srcx->w != srcy->w || srcx->h != srcy->h) { av_log(ctx, AV_LOG_ERROR, "First input link %s parameters " - "(size %dx%d, SAR %d:%d) do not match the corresponding " - "second input link %s parameters (%dx%d, SAR %d:%d)\n", + "(size %dx%d) do not match the corresponding " + "second input link %s parameters (size %dx%d)\n", ctx->input_pads[0].name, srcx->w, srcx->h, - srcx->sample_aspect_ratio.num, - srcx->sample_aspect_ratio.den, ctx->input_pads[1].name, - srcy->w, srcy->h, - srcy->sample_aspect_ratio.num, - srcy->sample_aspect_ratio.den); + srcy->w, srcy->h); return AVERROR(EINVAL); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_hysteresis: ignore SAR from all inputs
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 11:35:32 2017 +0100| [19d2108a984f7009e74eeddf883e6bad758a98e6] | committer: Paul B Mahol avfilter/vf_hysteresis: ignore SAR from all inputs Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19d2108a984f7009e74eeddf883e6bad758a98e6 --- libavfilter/vf_hysteresis.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libavfilter/vf_hysteresis.c b/libavfilter/vf_hysteresis.c index a788e1b9ee..edca40fa21 100644 --- a/libavfilter/vf_hysteresis.c +++ b/libavfilter/vf_hysteresis.c @@ -301,20 +301,13 @@ static int config_output(AVFilterLink *outlink) av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n"); return AVERROR(EINVAL); } -if (base->w != alt->w || -base->h != alt->h || -base->sample_aspect_ratio.num != alt->sample_aspect_ratio.num || -base->sample_aspect_ratio.den != alt->sample_aspect_ratio.den) { +if (base->w != alt->w || base->h != alt->h) { av_log(ctx, AV_LOG_ERROR, "First input link %s parameters " - "(size %dx%d, SAR %d:%d) do not match the corresponding " - "second input link %s parameters (%dx%d, SAR %d:%d)\n", + "(size %dx%d) do not match the corresponding " + "second input link %s parameters (size %dx%d)\n", ctx->input_pads[0].name, base->w, base->h, - base->sample_aspect_ratio.num, - base->sample_aspect_ratio.den, ctx->input_pads[1].name, - alt->w, alt->h, - alt->sample_aspect_ratio.num, - alt->sample_aspect_ratio.den); + alt->w, alt->h); return AVERROR(EINVAL); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] Merge commit 'd34a133b78afe2793cd8537f3c7f42437f441e94'
2017-11-11 4:56 GMT+01:00 James Almer : > ffmpeg | branch: master | James Almer | Sat Nov 11 > 00:54:19 2017 -0300| [ecf4e6b7205f6021fbdcf3d419733edae28d8bdd] | committer: > James Almer > > Merge commit 'd34a133b78afe2793cd8537f3c7f42437f441e94' > > * commit 'd34a133b78afe2793cd8537f3c7f42437f441e94': > dfa: Disallow odd width/height and add proper bounds check for DDS1 chunks Is this just for redundancy or does this break files that worked before? Carl Eugen ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Revert "lavf/dashdec: Fix several memleaks."
ffmpeg | branch: master | Steven Liu | Sun Nov 12 22:19:28 2017 +0800| [56960ed9c3a632e155a12312089ce3bf15df71e9] | committer: Steven Liu Revert "lavf/dashdec: Fix several memleaks." This reverts commit e7fe5e511aaeb3b8d949706b7f8620042cdfbd6c. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=56960ed9c3a632e155a12312089ce3bf15df71e9 --- libavformat/dashdec.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 0e3afd2a3b..0f5f91c6b5 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -328,17 +328,17 @@ static void free_representation(struct representation *pls) } av_freep(&pls->url_template); -av_freep(&pls); +av_freep(pls); } -static void set_httpheader_options(DASHContext *c, AVDictionary **opts) +static void set_httpheader_options(DASHContext *c, AVDictionary *opts) { // broker prior HTTP options that should be consistent across requests -av_dict_set(opts, "user-agent", c->user_agent, 0); -av_dict_set(opts, "cookies", c->cookies, 0); -av_dict_set(opts, "headers", c->headers, 0); +av_dict_set(&opts, "user-agent", c->user_agent, 0); +av_dict_set(&opts, "cookies", c->cookies, 0); +av_dict_set(&opts, "headers", c->headers, 0); if (c->is_live) { -av_dict_set(opts, "seekable", "0", 0); +av_dict_set(&opts, "seekable", "0", 0); } } static void update_options(char **dest, const char *name, void *src) @@ -885,7 +885,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) if (!in) { close_in = 1; -set_httpheader_options(c, &opts); +set_httpheader_options(c, opts); ret = avio_open2(&in, url, AVIO_FLAG_READ, c->interrupt_callback, &opts); av_dict_free(&opts); if (ret < 0) @@ -1301,7 +1301,7 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen char url[MAX_URL_SIZE]; int ret; -set_httpheader_options(c, &opts); +set_httpheader_options(c, opts); if (seg->size >= 0) { /* try to restrict the HTTP request to the part we want * (if this is in fact a HTTP request) */ @@ -1465,12 +1465,8 @@ static int save_avio_options(AVFormatContext *s) if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { if (buf[0] != '\0') { ret = av_dict_set(&c->avio_opts, *opt, buf, AV_DICT_DONT_STRDUP_VAL); -if (ret < 0) { -av_freep(&buf); +if (ret < 0) return ret; -} -} else { -av_freep(&buf); } } opt++; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/dashdec: Fix several memleaks.
ffmpeg | branch: master | Carl Eugen Hoyos | Sun Nov 12 22:20:22 2017 +0800| [52b9575d4a900afd0629331f19af78024f43b6bc] | committer: Steven Liu lavf/dashdec: Fix several memleaks. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52b9575d4a900afd0629331f19af78024f43b6bc --- libavformat/dashdec.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 0f5f91c6b5..0e3afd2a3b 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -328,17 +328,17 @@ static void free_representation(struct representation *pls) } av_freep(&pls->url_template); -av_freep(pls); +av_freep(&pls); } -static void set_httpheader_options(DASHContext *c, AVDictionary *opts) +static void set_httpheader_options(DASHContext *c, AVDictionary **opts) { // broker prior HTTP options that should be consistent across requests -av_dict_set(&opts, "user-agent", c->user_agent, 0); -av_dict_set(&opts, "cookies", c->cookies, 0); -av_dict_set(&opts, "headers", c->headers, 0); +av_dict_set(opts, "user-agent", c->user_agent, 0); +av_dict_set(opts, "cookies", c->cookies, 0); +av_dict_set(opts, "headers", c->headers, 0); if (c->is_live) { -av_dict_set(&opts, "seekable", "0", 0); +av_dict_set(opts, "seekable", "0", 0); } } static void update_options(char **dest, const char *name, void *src) @@ -885,7 +885,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) if (!in) { close_in = 1; -set_httpheader_options(c, opts); +set_httpheader_options(c, &opts); ret = avio_open2(&in, url, AVIO_FLAG_READ, c->interrupt_callback, &opts); av_dict_free(&opts); if (ret < 0) @@ -1301,7 +1301,7 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen char url[MAX_URL_SIZE]; int ret; -set_httpheader_options(c, opts); +set_httpheader_options(c, &opts); if (seg->size >= 0) { /* try to restrict the HTTP request to the part we want * (if this is in fact a HTTP request) */ @@ -1465,8 +1465,12 @@ static int save_avio_options(AVFormatContext *s) if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { if (buf[0] != '\0') { ret = av_dict_set(&c->avio_opts, *opt, buf, AV_DICT_DONT_STRDUP_VAL); -if (ret < 0) +if (ret < 0) { +av_freep(&buf); return ret; +} +} else { +av_freep(&buf); } } opt++; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] MAINTAINERS: update for cuvid/nvdec changes
ffmpeg | branch: master | Timo Rothenpieler | Sat Nov 11 14:48:37 2017 +0100| [65c4f4d1069b1ffbfb6484e133b827556c80fe65] | committer: Timo Rothenpieler MAINTAINERS: update for cuvid/nvdec changes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65c4f4d1069b1ffbfb6484e133b827556c80fe65 --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index c70d949a71..4df6c6533d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -158,7 +158,7 @@ Codecs: cpia.cStephan Hilb crystalhd.c Philip Langdale cscd.cReimar Doeffinger - cuvid.c Timo Rothenpieler + cuviddec.cTimo Rothenpieler dca* foo86 dirac*Rostislav Pehlivanov dnxhd*Baptiste Coudurier @@ -213,7 +213,7 @@ Codecs: msrle.c Mike Melanson msvideo1.cMike Melanson nuv.c Reimar Doeffinger - nvenc*Timo Rothenpieler + nvdec*, nvenc*Timo Rothenpieler opus* Rostislav Pehlivanov paf.* Paul B Mahol pcx.c Ivo van Poorten ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/nvdec: check hardware capabilities
ffmpeg | branch: master | Timo Rothenpieler | Sat Nov 11 16:08:53 2017 +0100| [c60bc02bf4bc4f6f57fd0fd4c5b2e63253623185] | committer: Timo Rothenpieler avcodec/nvdec: check hardware capabilities > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c60bc02bf4bc4f6f57fd0fd4c5b2e63253623185 --- libavcodec/nvdec.c | 56 ++ 1 file changed, 56 insertions(+) diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 58ebeeb9c1..6287897343 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -74,6 +74,56 @@ static int map_chroma_format(enum AVPixelFormat pix_fmt) return -1; } +static int nvdec_test_capabilities(NVDECDecoder *decoder, + CUVIDDECODECREATEINFO *params, void *logctx) +{ +CUresult err; +CUVIDDECODECAPS caps = { 0 }; + +caps.eCodecType = params->CodecType; +caps.eChromaFormat = params->ChromaFormat; +caps.nBitDepthMinus8 = params->bitDepthMinus8; + +err = decoder->cvdl->cuvidGetDecoderCaps(&caps); +if (err != CUDA_SUCCESS) { +av_log(logctx, AV_LOG_ERROR, "Failed querying decoder capabilities\n"); +return AVERROR_UNKNOWN; +} + +av_log(logctx, AV_LOG_VERBOSE, "NVDEC capabilities:\n"); +av_log(logctx, AV_LOG_VERBOSE, "format supported: %s, max_mb_count: %d\n", + caps.bIsSupported ? "yes" : "no", caps.nMaxMBCount); +av_log(logctx, AV_LOG_VERBOSE, "min_width: %d, max_width: %d\n", + caps.nMinWidth, caps.nMaxWidth); +av_log(logctx, AV_LOG_VERBOSE, "min_height: %d, max_height: %d\n", + caps.nMinHeight, caps.nMaxHeight); + +if (!caps.bIsSupported) { +av_log(logctx, AV_LOG_ERROR, "Hardware is lacking required capabilities\n"); +return AVERROR(EINVAL); +} + +if (params->ulWidth > caps.nMaxWidth || params->ulWidth < caps.nMinWidth) { +av_log(logctx, AV_LOG_ERROR, "Video width %d not within range from %d to %d\n", + (int)params->ulWidth, caps.nMinWidth, caps.nMaxWidth); +return AVERROR(EINVAL); +} + +if (params->ulHeight > caps.nMaxHeight || params->ulHeight < caps.nMinHeight) { +av_log(logctx, AV_LOG_ERROR, "Video height %d not within range from %d to %d\n", + (int)params->ulHeight, caps.nMinHeight, caps.nMaxHeight); +return AVERROR(EINVAL); +} + +if ((params->ulWidth * params->ulHeight) / 256 > caps.nMaxMBCount) { +av_log(logctx, AV_LOG_ERROR, "Video macroblock count %d exceeds maximum of %d\n", + (int)(params->ulWidth * params->ulHeight) / 256, caps.nMaxMBCount); +return AVERROR(EINVAL); +} + +return 0; +} + static void nvdec_decoder_free(void *opaque, uint8_t *data) { NVDECDecoder *decoder = (NVDECDecoder*)data; @@ -132,6 +182,12 @@ static int nvdec_decoder_create(AVBufferRef **out, AVBufferRef *hw_device_ref, goto fail; } +ret = nvdec_test_capabilities(decoder, params, logctx); +if (ret < 0) { +decoder->cudl->cuCtxPopCurrent(&dummy); +goto fail; +} + err = decoder->cvdl->cuvidCreateDecoder(&decoder->decoder, params); decoder->cudl->cuCtxPopCurrent(&dummy); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/nvdec: add support for 12 bit formats
ffmpeg | branch: master | Timo Rothenpieler | Sat Nov 11 15:07:41 2017 +0100| [3f6294a53d58ececeacb42ce2ba8349a8b0a4abb] | committer: Timo Rothenpieler avcodec/nvdec: add support for 12 bit formats > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f6294a53d58ececeacb42ce2ba8349a8b0a4abb --- libavcodec/nvdec.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 6287897343..274f69f997 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -489,9 +489,21 @@ int ff_nvdec_frame_params(AVCodecContext *avctx, frames_ctx->format= AV_PIX_FMT_CUDA; frames_ctx->width = avctx->coded_width; frames_ctx->height= avctx->coded_height; -frames_ctx->sw_format = sw_desc->comp[0].depth > 8 ? -AV_PIX_FMT_P010 : AV_PIX_FMT_NV12; frames_ctx->initial_pool_size = dpb_size; +switch (sw_desc->comp[0].depth) { +case 8: +frames_ctx->sw_format = AV_PIX_FMT_NV12; +break; +case 10: +frames_ctx->sw_format = AV_PIX_FMT_P010; +break; +case 12: +frames_ctx->sw_format = AV_PIX_FMT_P016; +break; +default: +return AVERROR(EINVAL); +} + return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/nvdec: don't add thread buffer twice
ffmpeg | branch: master | Timo Rothenpieler | Sun Nov 12 15:15:55 2017 +0100| [3e0e1634585b1a26b7d753aa42c7f350636927ae] | committer: Timo Rothenpieler avcodec/nvdec: don't add thread buffer twice This is already added to the initial pool size in ff_decode_get_hw_frames_ctx, so adding it here again increases the amount of surfaces needlessly. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e0e1634585b1a26b7d753aa42c7f350636927ae --- libavcodec/nvdec.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index e4babad43e..58ebeeb9c1 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -430,9 +430,6 @@ int ff_nvdec_frame_params(AVCodecContext *avctx, return AVERROR(EINVAL); } -if (avctx->thread_type & FF_THREAD_FRAME) -dpb_size += avctx->thread_count; - frames_ctx->format= AV_PIX_FMT_CUDA; frames_ctx->width = avctx->coded_width; frames_ctx->height= avctx->coded_height; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hwcontext_vaapi: Fix build with libva 2.0
ffmpeg | branch: master | Mark Thompson | Sun Nov 12 15:20:45 2017 +| [1ef4af2d492e87e6d9fc9157a2d9c7f95585f61c] | committer: Mark Thompson hwcontext_vaapi: Fix build with libva 2.0 vaExportSurfaceHandle() wasn't included in the 2.0 release. Fixes ticket #6828. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ef4af2d492e87e6d9fc9157a2d9c7f95585f61c --- libavutil/hwcontext_vaapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 40a85d288c..0382eb06f2 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -1076,7 +1076,7 @@ static void vaapi_unmap_to_drm(AVHWFramesContext *dst_fc, static int vaapi_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags) { -#if CONFIG_VAAPI_1 +#if VA_CHECK_VERSION(1, 1, 0) AVVAAPIDeviceContext *hwctx = hwfc->device_ctx->hwctx; VASurfaceID surface_id; VAStatus vas; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h265_metadata_bsf: fix the AVClass version number
ffmpeg | branch: master | James Almer | Sat Nov 11 01:45:46 2017 -0300| [9549f22bf88dfe622760f0416a29482ba91d5423] | committer: James Almer avcodec/h265_metadata_bsf: fix the AVClass version number Reviewed-by: Michael Niedermayer Reviewed-by: jkqxz Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9549f22bf88dfe622760f0416a29482ba91d5423 --- libavcodec/h265_metadata_bsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h265_metadata_bsf.c b/libavcodec/h265_metadata_bsf.c index 9af5cc256f..67dbe288e3 100644 --- a/libavcodec/h265_metadata_bsf.c +++ b/libavcodec/h265_metadata_bsf.c @@ -440,7 +440,7 @@ static const AVClass h265_metadata_class = { .class_name = "h265_metadata_bsf", .item_name = av_default_item_name, .option = h265_metadata_options, -.version= LIBAVCODEC_VERSION_MAJOR, +.version= LIBAVUTIL_VERSION_INT, }; static const enum AVCodecID h265_metadata_codec_ids[] = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpeg2_metadata_bsf: fix the AVClass version number
ffmpeg | branch: master | James Almer | Sat Nov 11 01:46:01 2017 -0300| [a7e7abf8495f1d5eb2fea43b3603b13fa221553c] | committer: James Almer avcodec/mpeg2_metadata_bsf: fix the AVClass version number Reviewed-by: Michael Niedermayer Reviewed-by: jkqxz Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7e7abf8495f1d5eb2fea43b3603b13fa221553c --- libavcodec/mpeg2_metadata_bsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg2_metadata_bsf.c b/libavcodec/mpeg2_metadata_bsf.c index f1f84e6cd9..b9a49ab943 100644 --- a/libavcodec/mpeg2_metadata_bsf.c +++ b/libavcodec/mpeg2_metadata_bsf.c @@ -294,7 +294,7 @@ static const AVClass mpeg2_metadata_class = { .class_name = "mpeg2_metadata_bsf", .item_name = av_default_item_name, .option = mpeg2_metadata_options, -.version= LIBAVCODEC_VERSION_MAJOR, +.version= LIBAVUTIL_VERSION_INT, }; static const enum AVCodecID mpeg2_metadata_codec_ids[] = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_metadata_bsf: fix the AVClass version number
ffmpeg | branch: master | James Almer | Sat Nov 11 01:45:37 2017 -0300| [9a6e4c88d64149eaaf28d7ea77de80cedf602935] | committer: James Almer avcodec/h264_metadata_bsf: fix the AVClass version number Reviewed-by: Michael Niedermayer Reviewed-by: jkqxz Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a6e4c88d64149eaaf28d7ea77de80cedf602935 --- libavcodec/h264_metadata_bsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c index 73e73e96e4..ada40a57c7 100644 --- a/libavcodec/h264_metadata_bsf.c +++ b/libavcodec/h264_metadata_bsf.c @@ -506,7 +506,7 @@ static const AVClass h264_metadata_class = { .class_name = "h264_metadata_bsf", .item_name = av_default_item_name, .option = h264_metadata_options, -.version= LIBAVCODEC_VERSION_MAJOR, +.version= LIBAVUTIL_VERSION_INT, }; static const enum AVCodecID h264_metadata_codec_ids[] = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_tile: add overlap option
ffmpeg | branch: master | Paul B Mahol | Tue Nov 7 19:41:06 2017 +0100| [7a060867f3d75395e37e724b5e4d43f34f0f60aa] | committer: Paul B Mahol avfilter/vf_tile: add overlap option Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a060867f3d75395e37e724b5e4d43f34f0f60aa --- doc/filters.texi | 4 libavfilter/vf_tile.c | 54 ++- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 5c6729a484..4a35c44c7b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -14441,6 +14441,10 @@ refer to the pad video filter. Specify the color of the unused area. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of @var{color} is "black". + +@item overlap +Set the number of frames to overlap when tiling several successive frames together. +The value must be between @code{0} and @var{nb_frames - 1}. @end table @subsection Examples diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c index e9d246fc73..7717ce12e7 100644 --- a/libavfilter/vf_tile.c +++ b/libavfilter/vf_tile.c @@ -37,11 +37,13 @@ typedef struct TileContext { unsigned w, h; unsigned margin; unsigned padding; +unsigned overlap; unsigned current; unsigned nb_frames; FFDrawContext draw; FFDrawColor blank; AVFrame *out_ref; +AVFrame *prev_out_ref; uint8_t rgba_color[4]; } TileContext; @@ -58,6 +60,8 @@ static const AVOption tile_options[] = { { "padding", "set inner border thickness in pixels", OFFSET(padding), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1024, FLAGS }, { "color", "set the color of the unused area", OFFSET(rgba_color), AV_OPT_TYPE_COLOR, {.str = "black"}, .flags = FLAGS }, +{ "overlap", "set how many frames to overlap for each render", OFFSET(overlap), +AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS }, { NULL } }; @@ -90,6 +94,11 @@ static av_cold int init(AVFilterContext *ctx) return AVERROR(EINVAL); } +if (tile->overlap >= tile->nb_frames) { +av_log(ctx, AV_LOG_WARNING, "overlap must be less than %d\n", tile->nb_frames); +tile->overlap = tile->nb_frames - 1; +} + return 0; } @@ -120,19 +129,19 @@ static int config_props(AVFilterLink *outlink) outlink->h = tile->h * inlink->h + total_margin_h; outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; outlink->frame_rate = av_mul_q(inlink->frame_rate, - av_make_q(1, tile->nb_frames)); + av_make_q(1, tile->nb_frames - tile->overlap)); ff_draw_init(&tile->draw, inlink->format, 0); ff_draw_color(&tile->draw, &tile->blank, tile->rgba_color); return 0; } -static void get_current_tile_pos(AVFilterContext *ctx, unsigned *x, unsigned *y) +static void get_tile_pos(AVFilterContext *ctx, unsigned *x, unsigned *y, unsigned current) { TileContext *tile= ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; -const unsigned tx = tile->current % tile->w; -const unsigned ty = tile->current / tile->w; +const unsigned tx = current % tile->w; +const unsigned ty = current / tile->w; *x = tile->margin + (inlink->w + tile->padding) * tx; *y = tile->margin + (inlink->h + tile->padding) * ty; @@ -144,7 +153,7 @@ static void draw_blank_frame(AVFilterContext *ctx, AVFrame *out_buf) AVFilterLink *inlink = ctx->inputs[0]; unsigned x0, y0; -get_current_tile_pos(ctx, &x0, &y0); +get_tile_pos(ctx, &x0, &y0, tile->current); ff_fill_rectangle(&tile->draw, &tile->blank, out_buf->data, out_buf->linesize, x0, y0, inlink->w, inlink->h); @@ -160,8 +169,13 @@ static int end_last_frame(AVFilterContext *ctx) while (tile->current < tile->nb_frames) draw_blank_frame(ctx, out_buf); +tile->current = tile->overlap; +if (tile->current) { +av_frame_free(&tile->prev_out_ref); +tile->prev_out_ref = av_frame_clone(out_buf); +} ret = ff_filter_frame(outlink, out_buf); -tile->current = 0; +tile->out_ref = NULL; return ret; } @@ -176,7 +190,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) AVFilterLink *outlink = ctx->outputs[0]; unsigned x0, y0; -if (!tile->current) { +if (!tile->out_ref) { tile->out_ref = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!tile->out_ref) { av_frame_free(&picref); @@ -194,7 +208,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) 0, 0, outlink->w, outlink->h); } -get_current_tile_pos(ctx, &x0, &y0); +if (tile->prev_out_ref) { +unsigned x1, y1, i; + +for (i = tile->nb_frames - tile->overlap; i < tile->nb_frames; i++) { +get_
[FFmpeg-cvslog] videotoolbox: add frame_params support
ffmpeg | branch: master | wm4 | Tue Oct 31 15:12:24 2017 +0100| [c31ce95f1c4c504ff9e3a90b1e4e37f695547c72] | committer: James Almer videotoolbox: add frame_params support Allows decoding with API users which require this API. Reviewed-by: Aman Gupta > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c31ce95f1c4c504ff9e3a90b1e4e37f695547c72 --- libavcodec/videotoolbox.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index ecb2502c1f..f0790e7353 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -947,6 +947,19 @@ fail: return err; } +static int videotoolbox_frame_params(AVCodecContext *avctx, + AVBufferRef *hw_frames_ctx) +{ +AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ctx->data; + +frames_ctx->format= AV_PIX_FMT_VIDEOTOOLBOX; +frames_ctx->width = avctx->coded_width; +frames_ctx->height= avctx->coded_height; +frames_ctx->sw_format = AV_PIX_FMT_NV12; + +return 0; +} + AVHWAccel ff_h263_videotoolbox_hwaccel = { .name = "h263_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, @@ -956,6 +969,7 @@ AVHWAccel ff_h263_videotoolbox_hwaccel = { .start_frame= videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, .end_frame = videotoolbox_mpeg_end_frame, +.frame_params = videotoolbox_frame_params, .init = videotoolbox_common_init, .uninit = videotoolbox_uninit, .priv_data_size = sizeof(VTContext), @@ -970,6 +984,7 @@ AVHWAccel ff_hevc_videotoolbox_hwaccel = { .start_frame= ff_videotoolbox_h264_start_frame, .decode_slice = ff_videotoolbox_h264_decode_slice, .end_frame = videotoolbox_hevc_end_frame, +.frame_params = videotoolbox_frame_params, .init = videotoolbox_common_init, .uninit = ff_videotoolbox_uninit, .priv_data_size = sizeof(VTContext), @@ -984,6 +999,7 @@ AVHWAccel ff_h264_videotoolbox_hwaccel = { .start_frame= ff_videotoolbox_h264_start_frame, .decode_slice = ff_videotoolbox_h264_decode_slice, .end_frame = videotoolbox_h264_end_frame, +.frame_params = videotoolbox_frame_params, .init = videotoolbox_common_init, .uninit = videotoolbox_uninit, .priv_data_size = sizeof(VTContext), @@ -998,6 +1014,7 @@ AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { .start_frame= videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, .end_frame = videotoolbox_mpeg_end_frame, +.frame_params = videotoolbox_frame_params, .init = videotoolbox_common_init, .uninit = videotoolbox_uninit, .priv_data_size = sizeof(VTContext), @@ -1012,6 +1029,7 @@ AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { .start_frame= videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, .end_frame = videotoolbox_mpeg_end_frame, +.frame_params = videotoolbox_frame_params, .init = videotoolbox_common_init, .uninit = videotoolbox_uninit, .priv_data_size = sizeof(VTContext), @@ -1026,6 +1044,7 @@ AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { .start_frame= videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, .end_frame = videotoolbox_mpeg_end_frame, +.frame_params = videotoolbox_frame_params, .init = videotoolbox_common_init, .uninit = videotoolbox_uninit, .priv_data_size = sizeof(VTContext), ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/ty: check if header is correctly parsed and is still present
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 20:26:42 2017 +0100| [6665938ca8b7ad8b7ec77c23e611bb8224e88a90] | committer: Paul B Mahol avformat/ty: check if header is correctly parsed and is still present Fixes #6829. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6665938ca8b7ad8b7ec77c23e611bb8224e88a90 --- libavformat/ty.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/ty.c b/libavformat/ty.c index 02ab59aa2e..0f08e787f5 100644 --- a/libavformat/ty.c +++ b/libavformat/ty.c @@ -440,6 +440,8 @@ static int get_chunk(AVFormatContext *s) return AVERROR_INVALIDDATA; ty->rec_hdrs = parse_chunk_headers(ty->chunk + 4, num_recs); +if (!ty->rec_hdrs) +return AVERROR(ENOMEM); ty->cur_chunk_pos += 16 * num_recs; return 0; @@ -723,8 +725,8 @@ static int ty_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR_EOF; while (ret <= 0) { -if (ty->first_chunk || ty->cur_rec >= ty->num_recs) { -if (get_chunk(s) < 0 || ty->num_recs == 0) +if (!ty->rec_hdrs || ty->first_chunk || ty->cur_rec >= ty->num_recs) { +if (get_chunk(s) < 0 || ty->num_recs <= 0) return AVERROR_EOF; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/ty: fix memory leaks
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 20:38:30 2017 +0100| [a38b14a432b3a031d6bafdbb5f790724b9b2094d] | committer: Paul B Mahol avformat/ty: fix memory leaks Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a38b14a432b3a031d6bafdbb5f790724b9b2094d --- libavformat/ty.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/libavformat/ty.c b/libavformat/ty.c index 0f08e787f5..ba874280ea 100644 --- a/libavformat/ty.c +++ b/libavformat/ty.c @@ -764,6 +764,16 @@ static int ty_read_packet(AVFormatContext *s, AVPacket *pkt) return 0; } +static int ty_read_close(AVFormatContext *s) +{ +TYDemuxContext *ty = s->priv_data; + +av_freep(&ty->seq_table); +av_freep(&ty->rec_hdrs); + +return 0; +} + AVInputFormat ff_ty_demuxer = { .name = "ty", .long_name = NULL_IF_CONFIG_SMALL("TiVo TY Stream"), @@ -771,6 +781,7 @@ AVInputFormat ff_ty_demuxer = { .read_probe = ty_probe, .read_header= ty_read_header, .read_packet= ty_read_packet, +.read_close = ty_read_close, .extensions = "ty,ty+", .flags = AVFMT_TS_DISCONT, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffplay: only use hardware accelerated SDL texture formats
ffmpeg | branch: release/3.4 | Marton Balint | Sat Oct 28 22:46:08 2017 +0200| [46aa734646279ac481e5583d005c8c15b348a244] | committer: Marton Balint ffplay: only use hardware accelerated SDL texture formats Typically only a small subset of the SDL texture formats are supported directly by the SDL renderer drivers, the rest is software emulated. It's better if libswscale does the format conversion to a hardware-accelerated texture format instead of SDL. This should fix video render slowdowns with some texture formats after 3bd2228d05a05eab5f91ac00b01efac9cb07649b. Signed-off-by: Marton Balint (cherry picked from commit 415038f2bd321a3b41564d4e0c6c17d7a096c397) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46aa734646279ac481e5583d005c8c15b348a244 --- fftools/ffplay.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index c8f90d4f3b..982340f073 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -1828,10 +1828,18 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c AVCodecParameters *codecpar = is->video_st->codecpar; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); AVDictionaryEntry *e = NULL; -int i; +int nb_pix_fmts = 0; +int i, j; -for (i = 0; i < FF_ARRAY_ELEMS(pix_fmts); i++) -pix_fmts[i] = sdl_texture_format_map[i].format; +for (i = 0; i < renderer_info.num_texture_formats; i++) { +for (j = 0; j < FF_ARRAY_ELEMS(sdl_texture_format_map) - 1; j++) { +if (renderer_info.texture_formats[i] == sdl_texture_format_map[j].texture_fmt) { +pix_fmts[nb_pix_fmts++] = sdl_texture_format_map[j].format; +break; +} +} +} +pix_fmts[nb_pix_fmts] = AV_PIX_FMT_NONE; while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) { if (!strcmp(e->key, "sws_flags")) { @@ -3748,7 +3756,7 @@ int main(int argc, char **argv) av_log(NULL, AV_LOG_VERBOSE, "Initialized %s renderer.\n", renderer_info.name); } } -if (!window || !renderer) { +if (!window || !renderer || !renderer_info.num_texture_formats) { av_log(NULL, AV_LOG_FATAL, "Failed to create window or renderer: %s", SDL_GetError()); do_exit(NULL); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffplay: use SDL2 audio API
ffmpeg | branch: release/3.4 | Marton Balint | Sat Nov 4 19:31:54 2017 +0100| [88a6fca74d247de5055bbbfbdbcc0a858170a882] | committer: Marton Balint ffplay: use SDL2 audio API It allows us to specify what kind of audio parameter changes are allowed. Should fix ticket #6721. Signed-off-by: Marton Balint (cherry picked from commit d68a557df4937b695a5f6a14877d92647be95aaa) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88a6fca74d247de5055bbbfbdbcc0a858170a882 --- fftools/ffplay.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 982340f073..571dce31d2 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -362,6 +362,7 @@ static AVPacket flush_pkt; static SDL_Window *window; static SDL_Renderer *renderer; static SDL_RendererInfo renderer_info = {0}; +static SDL_AudioDeviceID audio_dev; static const struct TextureFormatEntry { enum AVPixelFormat format; @@ -1192,7 +1193,7 @@ static void stream_component_close(VideoState *is, int stream_index) switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: decoder_abort(&is->auddec, &is->sampq); -SDL_CloseAudio(); +SDL_CloseAudioDevice(audio_dev); decoder_destroy(&is->auddec); swr_free(&is->swr_ctx); av_freep(&is->audio_buf1); @@ -2451,7 +2452,7 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len) else { memset(stream, 0, len1); if (!is->muted && is->audio_buf) -SDL_MixAudio(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1, is->audio_volume); +SDL_MixAudioFormat(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, AUDIO_S16SYS, len1, is->audio_volume); } len -= len1; stream += len1; @@ -2496,7 +2497,7 @@ static int audio_open(void *opaque, int64_t wanted_channel_layout, int wanted_nb wanted_spec.samples = FFMAX(SDL_AUDIO_MIN_BUFFER_SIZE, 2 << av_log2(wanted_spec.freq / SDL_AUDIO_MAX_CALLBACKS_PER_SEC)); wanted_spec.callback = sdl_audio_callback; wanted_spec.userdata = opaque; -while (SDL_OpenAudio(&wanted_spec, &spec) < 0) { +while (!(audio_dev = SDL_OpenAudioDevice(NULL, 0, &wanted_spec, &spec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE))) { av_log(NULL, AV_LOG_WARNING, "SDL_OpenAudio (%d channels, %d Hz): %s\n", wanted_spec.channels, wanted_spec.freq, SDL_GetError()); wanted_spec.channels = next_nb_channels[FFMIN(7, wanted_spec.channels)]; @@ -2666,7 +2667,7 @@ static int stream_component_open(VideoState *is, int stream_index) } if ((ret = decoder_start(&is->auddec, audio_thread, is)) < 0) goto out; -SDL_PauseAudio(0); +SDL_PauseAudioDevice(audio_dev, 0); break; case AVMEDIA_TYPE_VIDEO: is->video_stream = stream_index; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: always init output stream before reaping filters
ffmpeg | branch: release/3.4 | Marton Balint | Wed Oct 4 00:43:30 2017 +0200| [0ca0ec26a62e7913ee725fa4cabf2deaa4e40bed] | committer: Marton Balint ffmpeg: always init output stream before reaping filters Otherwise the frame size of the codec is not set in the buffersink. Fixes ticket #6603 and the following simpler case: ffmpeg -c aac -filter_complex "sine=d=0.1,asetnsamples=1025" out.aac Signed-off-by: Marton Balint (cherry picked from commit f4090940bd3024e69d236257d327f11d1e496229) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ca0ec26a62e7913ee725fa4cabf2deaa4e40bed --- fftools/ffmpeg.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 3ee31473dc..d581b40bf2 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -4536,6 +4536,15 @@ static int transcode_step(void) } if (ost->filter && ost->filter->graph->graph) { +if (!ost->initialized) { +char error[1024] = {0}; +ret = init_output_stream(ost, error, sizeof(error)); +if (ret < 0) { +av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d -- %s\n", + ost->file_index, ost->index, error); +exit_program(1); +} +} if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0) return ret; if (!ist) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffplay: create the window and the renderer before starting playback
ffmpeg | branch: release/3.4 | Marton Balint | Sat Oct 28 22:06:22 2017 +0200| [0158fd527691a8cd70863ee7326ede872a9b8725] | committer: Marton Balint ffplay: create the window and the renderer before starting playback Signed-off-by: Marton Balint (cherry picked from commit 84d31e2475c41b0a69a11c4cba54755d034bb341) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0158fd527691a8cd70863ee7326ede872a9b8725 --- fftools/ffplay.c | 67 +--- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 9f7774613c..c8f90d4f3b 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -361,6 +361,7 @@ static AVPacket flush_pkt; static SDL_Window *window; static SDL_Renderer *renderer; +static SDL_RendererInfo renderer_info = {0}; static const struct TextureFormatEntry { enum AVPixelFormat format; @@ -1320,38 +1321,15 @@ static int video_open(VideoState *is) h = default_height; } -if (!window) { -int flags = SDL_WINDOW_SHOWN; -if (!window_title) -window_title = input_filename; -if (is_full_screen) -flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; -if (borderless) -flags |= SDL_WINDOW_BORDERLESS; -else -flags |= SDL_WINDOW_RESIZABLE; -window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags); -SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); -if (window) { -SDL_RendererInfo info; -renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); -if (!renderer) { -av_log(NULL, AV_LOG_WARNING, "Failed to initialize a hardware accelerated renderer: %s\n", SDL_GetError()); -renderer = SDL_CreateRenderer(window, -1, 0); -} -if (renderer) { -if (!SDL_GetRendererInfo(renderer, &info)) -av_log(NULL, AV_LOG_VERBOSE, "Initialized %s renderer.\n", info.name); -} -} -} else { -SDL_SetWindowSize(window, w, h); -} +if (!window_title) +window_title = input_filename; +SDL_SetWindowTitle(window, window_title); -if (!window || !renderer) { -av_log(NULL, AV_LOG_FATAL, "SDL: could not set video mode - exiting\n"); -do_exit(is); -} +SDL_SetWindowSize(window, w, h); +SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); +if (is_full_screen) +SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); +SDL_ShowWindow(window); is->width = w; is->height = h; @@ -1362,7 +1340,7 @@ static int video_open(VideoState *is) /* display the current picture, if any */ static void video_display(VideoState *is) { -if (!window) +if (!is->width) video_open(is); SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); @@ -3751,6 +3729,31 @@ int main(int argc, char **argv) av_init_packet(&flush_pkt); flush_pkt.data = (uint8_t *)&flush_pkt; +if (!display_disable) { +int flags = SDL_WINDOW_HIDDEN; +if (borderless) +flags |= SDL_WINDOW_BORDERLESS; +else +flags |= SDL_WINDOW_RESIZABLE; +window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags); +SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); +if (window) { +renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); +if (!renderer) { +av_log(NULL, AV_LOG_WARNING, "Failed to initialize a hardware accelerated renderer: %s\n", SDL_GetError()); +renderer = SDL_CreateRenderer(window, -1, 0); +} +if (renderer) { +if (!SDL_GetRendererInfo(renderer, &renderer_info)) +av_log(NULL, AV_LOG_VERBOSE, "Initialized %s renderer.\n", renderer_info.name); +} +} +if (!window || !renderer) { +av_log(NULL, AV_LOG_FATAL, "Failed to create window or renderer: %s", SDL_GetError()); +do_exit(NULL); +} +} + is = stream_open(input_filename, file_iformat); if (!is) { av_log(NULL, AV_LOG_FATAL, "Failed to initialize VideoState!\n"); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/ty: check cur_chunk_pos before using it
ffmpeg | branch: master | Paul B Mahol | Sun Nov 12 22:57:06 2017 +0100| [f38d0d0c22c1871ef0728a718c5e00a6ba93bfa1] | committer: Paul B Mahol avformat/ty: check cur_chunk_pos before using it Fixes #6831. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f38d0d0c22c1871ef0728a718c5e00a6ba93bfa1 --- libavformat/ty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/ty.c b/libavformat/ty.c index ba874280ea..d348643f40 100644 --- a/libavformat/ty.c +++ b/libavformat/ty.c @@ -378,6 +378,8 @@ static void parse_master(AVFormatContext *s) ty->cur_chunk_pos = 32; for (j = 0; j < ty->seq_table_size; j++) { +if (ty->cur_chunk_pos >= CHUNK_SIZE - 8) +return; ty->seq_table[j].timestamp = AV_RB64(ty->chunk + ty->cur_chunk_pos); ty->cur_chunk_pos += 8; if (map_size > 8) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/tls_securetransport: build on iOS
ffmpeg | branch: master | Aman Gupta | Wed Oct 25 11:03:14 2017 -0700| [fd18d310ec200fa7ace29cbfc725d451663bf49c] | committer: Aman Gupta lavf/tls_securetransport: build on iOS This works as expected on iOS, except for the ca_file feature which is disabled because SecItemImport is not available. Signed-off-by: Aman Gupta > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd18d310ec200fa7ace29cbfc725d451663bf49c --- configure | 6 +- libavformat/tls_securetransport.c | 4 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 2f026c45bc..c6fb344929 100755 --- a/configure +++ b/configure @@ -2035,6 +2035,7 @@ SYSTEM_FUNCS=" posix_memalign pthread_cancel sched_getaffinity +SecItemImport SetConsoleTextAttribute SetConsoleCtrlHandler setmode @@ -6032,9 +6033,12 @@ fi enabled securetransport && check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" && -check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" || +check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" || disable securetransport +enabled securetransport && +check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security" + enabled schannel && check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 && check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && diff --git a/libavformat/tls_securetransport.c b/libavformat/tls_securetransport.c index 9958931b0c..b862e0003a 100644 --- a/libavformat/tls_securetransport.c +++ b/libavformat/tls_securetransport.c @@ -69,6 +69,9 @@ static int print_tls_error(URLContext *h, int ret) static int import_pem(URLContext *h, char *path, CFArrayRef *array) { +#if !HAVE_SECITEMIMPORT +return AVERROR_PATCHWELCOME; +#else AVIOContext *s = NULL; CFDataRef data = NULL; int64_t ret = 0; @@ -124,6 +127,7 @@ end: if (s) avio_close(s); return ret; +#endif } static int load_ca(URLContext *h) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: fix writing library dependencies to config.sh
ffmpeg | branch: master | James Almer | Sun Nov 12 22:59:34 2017 -0300| [d9ff1e4c8bdf97cbb1ab4bd97102eefbe8ebf95a] | committer: James Almer configure: fix writing library dependencies to config.sh Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d9ff1e4c8bdf97cbb1ab4bd97102eefbe8ebf95a --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index c6fb344929..46b4815f2e 100755 --- a/configure +++ b/configure @@ -7011,7 +7011,7 @@ EOF for lib in $LIBRARY_LIST; do lib_deps="$(eval echo \$${lib}_deps)" -echo ${lib}_deps=\"$lib_deps\" >> ffbuild/config.sh +echo ${lib}_deps=\"$lib_deps\" >> $TMPH done cp_if_changed $TMPH ffbuild/config.sh ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc: allocate space for terminating null
ffmpeg | branch: master | Timo Rothenpieler | Mon Nov 13 10:44:16 2017 +0800| [3ee63f3fb70c3be36aa62adf9ad0fe2defa2bd51] | committer: Steven Liu avformat/hlsenc: allocate space for terminating null Fixes CID #1420394 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ee63f3fb70c3be36aa62adf9ad0fe2defa2bd51 --- libavformat/hlsenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 5ea9d216a4..b571772f60 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1455,7 +1455,7 @@ static int hls_write_header(AVFormatContext *s) if (basename_size > 0) { hls->base_output_dirname = av_malloc(basename_size); } else { -hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename)); +hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename) + 1); } if (!hls->base_output_dirname) { ret = AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/img2enc: add frame_pts option for make output filename
ffmpeg | branch: master | Steven Liu | Mon Nov 13 10:52:01 2017 +0800| [f3e34072aadf20be60c0fae38cbe14ad4581c6a5] | committer: Steven Liu avformat/img2enc: add frame_pts option for make output filename fix ticket id: #1452 when use frame_pts option, the output image name can be set with PTS of current frame. Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3e34072aadf20be60c0fae38cbe14ad4581c6a5 --- doc/muxers.texi | 9 + libavformat/img2enc.c | 7 +++ 2 files changed, 16 insertions(+) diff --git a/doc/muxers.texi b/doc/muxers.texi index 43f3776b13..616568ebea 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -897,9 +897,18 @@ can be used: ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg" @end example +You can set the file name with current frame's PTS: +@example +ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg" +@end example + @subsection Options @table @option +@item frame_pts +If set to 1, expand the filename with pts from pkt->pts. +Default value is 0. + @item start_number Start the sequence from the specified number. Default value is 1. diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c index 7d64659340..b680676bff 100644 --- a/libavformat/img2enc.c +++ b/libavformat/img2enc.c @@ -42,6 +42,7 @@ typedef struct VideoMuxData { char target[4][1024]; int update; int use_strftime; +int frame_pts; const char *muxer; int use_rename; } VideoMuxData; @@ -99,6 +100,11 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_ERROR, "Could not get frame filename with strftime\n"); return AVERROR(EINVAL); } +} else if (img->frame_pts) { +if (av_get_frame_filename2(filename, sizeof(filename), img->path, pkt->pts, AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) { +av_log(s, AV_LOG_ERROR, "Cannot write filename by pts of the frames."); +return AVERROR(EINVAL); +} } else if (av_get_frame_filename2(filename, sizeof(filename), img->path, img->img_number, AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0 && @@ -206,6 +212,7 @@ static const AVOption muxoptions[] = { { "update", "continuously overwrite one file", OFFSET(update), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, { "start_number", "set first number in the sequence", OFFSET(img_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, ENC }, { "strftime", "use strftime for filename", OFFSET(use_strftime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, +{ "frame_pts","use current frame pts for filename", OFFSET(frame_pts), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, { "atomic_writing", "write files atomically (using temporary files and renames)", OFFSET(use_rename), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC }, { NULL }, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Fix missing used attribute for inline assembly variables
ffmpeg | branch: master | Thomas Köppe | Sun Nov 12 16:24:37 2017 +| [43171a2a738f5114768d34a7278e56e5fde714bc] | committer: Michael Niedermayer Fix missing used attribute for inline assembly variables Variables used in inline assembly need to be marked with attribute((used)). Static constants already were, via the define of DECLARE_ASM_CONST. But DECLARE_ALIGNED does not add this attribute, and some of the variables defined with it are const only used in inline assembly, and therefore appeared dead. This change adds a macro DECLARE_ASM_ALIGNED that marks variables as used. This change makes FFMPEG work with Clang's ThinLTO. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=43171a2a738f5114768d34a7278e56e5fde714bc --- libavcodec/cabac.c | 2 +- libavcodec/x86/constants.c | 20 ++-- libavutil/mem.h| 17 + libswscale/x86/swscale.c | 12 ++-- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index dd2b057c6d..e51139de3b 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -32,7 +32,7 @@ #include "cabac.h" #include "cabac_functions.h" -const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63] = { +DECLARE_ASM_ALIGNED(1, const uint8_t, ff_h264_cabac_tables)[512 + 4*2*64 + 4*64 + 63] = { 9,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c index 11002ee61e..47905c74a1 100644 --- a/libavcodec/x86/constants.c +++ b/libavcodec/x86/constants.c @@ -26,23 +26,23 @@ DECLARE_ALIGNED(32, const ymm_reg, ff_pw_1)= { 0x0001000100010001ULL, 0x000 0x0001000100010001ULL, 0x0001000100010001ULL }; DECLARE_ALIGNED(32, const ymm_reg, ff_pw_2)= { 0x0002000200020002ULL, 0x0002000200020002ULL, 0x0002000200020002ULL, 0x0002000200020002ULL }; -DECLARE_ALIGNED(16, const xmm_reg, ff_pw_3)= { 0x0003000300030003ULL, 0x0003000300030003ULL }; -DECLARE_ALIGNED(32, const ymm_reg, ff_pw_4)= { 0x0004000400040004ULL, 0x0004000400040004ULL, +DECLARE_ASM_ALIGNED(16, const xmm_reg, ff_pw_3)= { 0x0003000300030003ULL, 0x0003000300030003ULL }; +DECLARE_ASM_ALIGNED(32, const ymm_reg, ff_pw_4)= { 0x0004000400040004ULL, 0x0004000400040004ULL, 0x0004000400040004ULL, 0x0004000400040004ULL }; -DECLARE_ALIGNED(16, const xmm_reg, ff_pw_5)= { 0x0005000500050005ULL, 0x0005000500050005ULL }; +DECLARE_ASM_ALIGNED(16, const xmm_reg, ff_pw_5)= { 0x0005000500050005ULL, 0x0005000500050005ULL }; DECLARE_ALIGNED(16, const xmm_reg, ff_pw_8)= { 0x0008000800080008ULL, 0x0008000800080008ULL }; -DECLARE_ALIGNED(16, const xmm_reg, ff_pw_9)= { 0x0009000900090009ULL, 0x0009000900090009ULL }; +DECLARE_ASM_ALIGNED(16, const xmm_reg, ff_pw_9)= { 0x0009000900090009ULL, 0x0009000900090009ULL }; DECLARE_ALIGNED(8, const uint64_t, ff_pw_15) = 0x000F000F000F000FULL; DECLARE_ALIGNED(16, const xmm_reg, ff_pw_16) = { 0x0010001000100010ULL, 0x0010001000100010ULL }; DECLARE_ALIGNED(16, const xmm_reg, ff_pw_17) = { 0x0011001100110011ULL, 0x0011001100110011ULL }; -DECLARE_ALIGNED(16, const xmm_reg, ff_pw_18) = { 0x0012001200120012ULL, 0x0012001200120012ULL }; +DECLARE_ASM_ALIGNED(16, const xmm_reg, ff_pw_18) = { 0x0012001200120012ULL, 0x0012001200120012ULL }; DECLARE_ALIGNED(16, const xmm_reg, ff_pw_20) = { 0x0014001400140014ULL, 0x0014001400140014ULL }; DECLARE_ALIGNED(16, const xmm_reg, ff_pw_32) = { 0x0020002000200020ULL, 0x0020002000200020ULL }; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_42) = 0x002A002A002A002AULL; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_53) = 0x0035003500350035ULL; -DECLARE_ALIGNED(16, const xmm_reg, ff_pw_64) = { 0x0040004000400040ULL, 0x0040004000400040ULL }; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_96) = 0x0060006000600060ULL; -DECLARE_ALIGNED(8, const uint64_t, ff_pw_128) = 0x0080008000800080ULL; +DECLARE_ASM_ALIGNED(8, const uint64_t, ff_pw_42) = 0x002A002A002A002AULL; +DECLARE_ASM_ALIGNED(8, const uint64_t, ff_pw_53) = 0x0035003500350035ULL; +DECLARE_ASM_ALIGNED(16, const xmm_reg, ff_pw_64) = { 0x0040004000400040ULL, 0x0040004000400040ULL }; +DECLARE_ASM_ALIGNED(8, const uint64_t, ff_pw_96) = 0x0060006000600060ULL; +DECLARE_ASM_ALIGNED(8, const uint64_t, ff_pw_128) = 0x0080008000800080ULL; DECLARE_ALIGNED(32, const ymm_reg, ff_pw_255) = { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL }; DECLARE_ALIGNED(32, const ymm_reg, ff_pw_256) = { 0x0100010001000100ULL, 0x0100010001000100ULL, diff --git a/libavutil/mem.h b/libavutil/mem.h index e5c
[FFmpeg-cvslog] avfilter/vf_*_qsv: Fix flags
ffmpeg | branch: master | Michael Niedermayer | Sun Nov 12 18:07:45 2017 +0100| [1828c549c3ecd45d54ff03aee784b00a41f0e69e] | committer: Michael Niedermayer avfilter/vf_*_qsv: Fix flags Reviewed-by: Mark Thompson Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1828c549c3ecd45d54ff03aee784b00a41f0e69e --- libavfilter/vf_overlay_qsv.c | 2 +- libavfilter/vf_vpp_qsv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c index 471576e35a..1f50d4bb21 100644 --- a/libavfilter/vf_overlay_qsv.c +++ b/libavfilter/vf_overlay_qsv.c @@ -42,7 +42,7 @@ #define OVERLAY 1 #define OFFSET(x) offsetof(QSVOverlayContext, x) -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM) enum var_name { VAR_MAIN_iW, VAR_MW, diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 86af017d2e..eb2f1cc7eb 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -37,7 +37,7 @@ #include "qsvvpp.h" #define OFFSET(x) offsetof(VPPContext, x) -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM) /* number of video enhancement filters */ #define ENH_FILTERS_COUNT (5) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog