summaryrefslogtreecommitdiff
path: root/libavfilter/src_movie.c
Commit message (Collapse)AuthorAge
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* avfilter: convert to new channel layout APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/src_movie: add format_opts for the opened fileLimin Wang2021-11-29
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/src_movie: make the number of decode thread configurableLimin Wang2021-11-12
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/src_movie: Deduplicate AVClassesAndreas Rheinhardt2021-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/src_movie: Free outpads' names genericallyAndreas Rheinhardt2021-08-22
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Remove unused feature to add pads in the middleAndreas Rheinhardt2021-08-17
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify the API wrt AV(In|Out)putFormatAndreas Rheinhardt2021-04-27
| | | | | | | Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavfi/src_movie: switch to new decoding APIAnton Khirnov2020-11-20
|
* fftools, libavcodec, libavfilter: Add const to some AVCodec *Andreas Rheinhardt2020-09-11
| | | | | | | | The user has no business modifying the underlying AVCodec. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/src_movie: Fix leak of packet upon errorAndreas Rheinhardt2020-09-10
| | | | | | | | | If allocating the AVFrame to contain a decoded frame fails, the AVPacket containing the data intended to be decoded leaks. This commit fixes this. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/src_movie: Remove unnecessary secondary AVPacketAndreas Rheinhardt2020-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The movie and amovie filters currently use two packets. One of the two, pkt0, is the owner of the returned packet; it is also the destination packet for av_read_frame(). The other one pkt is initially (i.e. after av_read_frame()) a copy of pkt0; copy means that the contents of both are absolutely the same: They both point to the same AVBufferRef and the same side data. This violation of the refcounted packet API is only possible because pkt is not considered to own its data. Only pkt0 is ever unreferenced. The reason for pkt's existence seems to be historic: The API used for decoding audio (namely avcodec_decode_audio4()) could consume frames partially, i.e. it could return multiple frames for one packet and therefore it returned how much of the input buffer had been consumed. The caller was then supposed to update the packet's data and size pointer to reflect this and call avcodec_decode_audio4() again with the updated packet to get the next frame. But before the introduction of refcounted AVPackets where knowledge and responsibility about what to free lies with the underlying AVBuffer such a procedure required a spare packet (or one would need to record the original data and size fields separately to restore them before freeing the packet; notice that this code has been written when AVPackets still had a destruct field). But these times are long gone, so just remove the secondary AVPacket. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/src_movie: Remove unneeded resetting of AVPacketAndreas Rheinhardt2020-09-10
| | | | | | | av_read_frame() already returns clean packets on error. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Revert "avfilter/src_movie: switch to activate"Nicolas George2020-09-08
| | | | | | | | | | This reverts commit abc884bcc005c450a34e56cd1f4b8b6fa17ea768. This patch was pushed without actual review. An actual review would have revealed that the switch to activate was not done correctly because the logic between request_frame() and frame_wanted is not as direct with filters with multiple outputs than with a single output.
* lavfi: regroup formats lists in a single structure.Nicolas George2020-09-08
| | | | | | | | | | | | | | | It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)
* avfilter/src_movie: switch to activatePaul B Mahol2020-09-04
| | | | Allow to set the EOF timestamp.
* avfilter/src_movie: Avoid intermediate buffer for writing stringAndreas Rheinhardt2020-08-31
| | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Schedule avfilter_make_format64_list() for removalAndreas Rheinhardt2020-08-12
| | | | | | | | | | | | Despite its name, this function is not part of the public API, as formats.h, the header containing its declaration, is a private header. The formats API was once public API, but that changed long ago (b74a1da49db5ebed51aceae6cacc2329288a92c1, the commit scheduling it to become private, is from 2012). That avfilter_make_format64_list() was forgotten is probably a result of the confusion resulting from the libav-ffmpeg split. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* remove CHAR_MIN/CHAR_MAX usagePaul B Mahol2020-03-17
| | | | It is not needed at all.
* lavfi/movie: Use filter thread count for decoding threads.Carl Eugen Hoyos2019-10-01
| | | | Fixes ticket #7542.
* lav*,tests: remove several register_all callsJosh de Kock2018-04-02
| | | | | | | avdevice_register_all() is still required to register devices into lavf (this is required due to lavd being somewhat of a hack). Signed-off-by: Josh de Kock <josh@itanimul.li>
* avfilter/src_movie: check ff_insert_outpad() for failurePaul B Mahol2017-08-25
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* Merge commit 'ce6f780bc6656ad3895f81a988b239ad3c8af4b8'James Almer2017-04-04
| | | | | | | * commit 'ce6f780bc6656ad3895f81a988b239ad3c8af4b8': configure: Add missing asyncts filter, movie filter, and output example deps Merged-by: James Almer <jamrial@gmail.com>
* avfilter/src_movie: Add option to remove timestamp discontinuitiesMichael Niedermayer2016-06-26
| | | | | | This can also be extended to remove discontiuities caused by seek commands Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/src_movie: call open_stream after guess_channel_layoutMuhammad Faiz2016-06-09
| | | | | | | fix error 'Channel layout change is not supported' when opening wav file Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* avfilter/src_movie: add various commandsMuhammad Faiz2016-05-25
| | | | | | | | | add seek command add get_duration command Update to codecpar by commiter Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '1138eb5509d3db7f6d565cb45f137a786d22beb9'Derek Buitenhuis2016-04-11
| | | | | | | * commit '1138eb5509d3db7f6d565cb45f137a786d22beb9': vsrc_movie: convert to codecpar Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avfilter/src_movie: fix how we check for overflows with seek_pointMarios Titas2016-04-03
| | | | | | | | | | | | | | | | | Currently, if the movie source filter is used and a seek_point is specified on a file that has a negative start time, ffmpeg will fail. An easy way to reproduce this is as follows: $ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4 $ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null - The problem is caused by checking for int64_t overflow the wrong way. In general, to check whether a + b overflows, it is not enough to do: a > INT64_MAX - b because b might be negative; the correct way is: b > 0 && > a > INT64_MAX - b Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
|
* avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-14
| | | | | | | | | | | | | | | | | | Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM). This propagates the return values. All of these were found by using av_warn_unused_result, demonstrating its utility. Tested with FATE. I am least sure of the changes to avfilter/filtergraph, since I don't know what/how reduce_format is intended to behave and how it should react to errors. Fixes: CID 1325680, 1325679, 1325678. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Previous version Reviewed-by: Nicolas George <george@nsup.org> Previous version Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* Remove left-over FF_API_AVFILTERBUFFER cruftHendrik Leppkes2015-09-05
|
* Replace av_dlog with ff_dlog.Ronald S. Bultje2015-08-18
| | | | | ff_dlog checks compilability, and is non-public. av_dlog is deprecated and no longer exists if FF_API_DLOG=0.
* lavfi: check av_strdup() return valuePaul B Mahol2015-01-06
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/src_movie: minor simplificationsLukasz Marek2014-07-24
| | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi/src_movie: remove frame from priv contextLukasz Marek2014-07-24
| | | | | | | | | | This variable is used only inside one function. There is no need to store it in context. This also may prevent crush by double free frame. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '58400ac133bcfb6bf8196b4e5208bc178307739b'Michael Niedermayer2014-04-19
| | | | | | | | | | | | | | | | | * commit '58400ac133bcfb6bf8196b4e5208bc178307739b': lavfi: name anonymous structs Conflicts: libavfilter/buffersink.c libavfilter/f_select.c libavfilter/src_movie.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_overlay.c libavfilter/vf_showinfo.c libavfilter/vf_unsharp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/src_movie: Check that the pixel format hasnt changedMichael Niedermayer2014-03-18
| | | | | | Fixes assertion failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi/movie: fix display of pushed frame informationStefano Sabatini2014-02-02
| | | | | | | | | It was broken since 7e350379f87e7f7. Also fix warnings: libavfilter/src_movie.c: In function ‘describe_frame_to_str’: libavfilter/src_movie.c:392:5: warning: ‘type’ is deprecated (declared at ./libavutil/frame.h:313) [-Wdeprecated-declarations] libavfilter/src_movie.c:408:9: warning: ‘type’ is deprecated (declared at ./libavutil/frame.h:313) [-Wdeprecated-declarations]
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-24
| | | | | | | | | | | | | | * qatar/master: Add missing #includes for *INT64_MAX and *INT64_C Conflicts: ffmpeg.c ffmpeg_filter.c ffplay.c libavformat/assdec.c libavformat/avidec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavfi: do not export the filters from shared objects Conflicts: libavfilter/af_amix.c libavfilter/af_anull.c libavfilter/asrc_anullsrc.c libavfilter/f_select.c libavfilter/f_settb.c libavfilter/split.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_blackframe.c libavfilter/vf_colorbalance.c libavfilter/vf_copy.c libavfilter/vf_crop.c libavfilter/vf_cropdetect.c libavfilter/vf_drawbox.c libavfilter/vf_format.c libavfilter/vf_framestep.c libavfilter/vf_frei0r.c libavfilter/vf_hflip.c libavfilter/vf_libopencv.c libavfilter/vf_lut.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_unsharp.c libavfilter/vf_vflip.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/src_movie: Fix handling of packet size for videoMichael Niedermayer2013-06-26
| | | | | | See Ticket2556 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavfilter/src_movie: fix which packet is resetMichael Niedermayer2013-06-26
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi/movie: free packet on decoder errorMichael Niedermayer2013-06-25
| | | | | | Prevents infinite loop, see Ticket2556 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'eeeb5c291d3f78eaade5b99c2614c7cab0e9be79'Michael Niedermayer2013-06-21
| | | | | | | | | | * commit 'eeeb5c291d3f78eaade5b99c2614c7cab0e9be79': vsrc_movie: do not free avoption variables in uninit() Conflicts: libavfilter/src_movie.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi/src_movie: Use movie_common_init instead individual wrappersAlexander Strasser2013-06-18
| | | | | | | Makes it easier to understand that there is no difference in init callback for movie and amovie. Also saves a few lines of code. Signed-off-by: Alexander Strasser <eclipse7@gmx.net>