aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/lavfi.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil: remove deprecated FF_API_FRAME_PKTJames Almer2025-03-281-10/+0
| | | | | | Deprecated since 2023-03-20. Signed-off-by: James Almer <jamrial@gmail.com>
* lavd/lavfi: stop using avfilter_graph_create_filter() incorrectlyAnton Khirnov2024-09-281-6/+12
| | | | See previous commits for details.
* avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.hAndreas Rheinhardt2024-03-261-1/+1
| | | | | | | | | and rename it to FF_INFMT_INIT_CLEANUP. This flag is demuxer-only, so this is the more appropriate place for it. This does not preclude adding internal flags common to both demuxer and muxer in the future. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-071-5/+6
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Fix double-free on errorAndreas Rheinhardt2023-09-301-4/+5
| | | | | | | | | | | After the AVFrame has been wrapped into a buffer, it is owned by the buffer and must not be freed manually any more. Yet this happens on subsequent errors. This bug was introduced in 6ca43a9675d651d7ea47c7ba2fafb1bf831c4d0b. Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Remove unnecessary avio_internal.h inclusionAndreas Rheinhardt2023-09-101-1/+0
| | | | | | The stuff declared in said header is actually unusable in libavdevice. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: check that pointer is setPaul B Mahol2023-05-101-0/+4
| | | | Fixes NULL pointer dereference later.
* lavu/frame: deprecate AVFrame.pkt_{pos,size}Anton Khirnov2023-03-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | These fields are supposed to store information about the packet the frame was decoded from, specifically the byte offset it was stored at and its size. However, - the fields are highly ad-hoc - there is no strong reason why specifically those (and not any other) packet properties should have a dedicated field in AVFrame; unlike e.g. the timestamps, there is no fundamental link between coded packet offset/size and decoded frames - they only make sense for frames produced by decoding demuxed packets, and even then it is not always the case that the encoded data was stored in the file as a contiguous sequence of bytes (in order for pos to be well-defined) - pkt_pos was added without much explanation, apparently to allow passthrough of this information through lavfi in order to handle byte seeking in ffplay. That is now implemented using arbitrary user data passthrough in AVFrame.opaque_ref. - several filters use pkt_pos as a variable available to user-supplied expressions, but there seems to be no established motivation for using them. - pkt_size was added for use in ffprobe, but that too is now handled without using this field. Additonally, the values of this field produced by libavcodec are flawed, as described in the previous ffprobe conversion commit. In summary - these fields are ill-defined and insufficiently motivated, so deprecate them.
* avdevice/lavfi: pass forward video framerateTimo Rothenpieler2022-07-181-0/+5
|
* avdevice/lavfi: output wrapped AVFramesTimo Rothenpieler2022-07-181-54/+35
| | | | | | | | | | | | | This avoids an extra copy of potentially quite big video frames. Instead of copying the entire frames data into a rawvideo packet it packs the frame into a wrapped avframe packet and passes it through as-is. Unfortunately, wrapped avframes are set up to be video frames, so the audio frames continue to be copied. Additionally, this enabled passing through video frames that previously were impossible to process, like hardware frames or other special formats that couldn't be packed into a rawvideo packet.
* avdevice/lavfi: remove call to deprecated function ↵James Almer2022-03-151-6/+4
| | | | | | av_buffersink_get_channel_layout() Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/lavfi: convert to new channel layout APIJames Almer2022-03-151-2/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/lavfi: Don't require AV_PIX_FMT_NONE == -1Andreas Rheinhardt2021-12-031-1/+1
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Simplify setting sample_fmtsAndreas Rheinhardt2021-12-031-2/+3
| | | | | | | | | The length of this list is a compile-time constant, so there is no need to calculate it again at runtime. (This also avoids an implicit requirement of -1 == AV_SAMPLE_FMT_NONE.) Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Make array static constAndreas Rheinhardt2021-12-031-5/+4
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Avoid calling av_buffersink_get_* multiple timesAndreas Rheinhardt2021-12-031-8/+8
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Use dedicated pointer to access st->codecparAndreas Rheinhardt2021-12-031-12/+13
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Don't unnecessarily write '\0' to AVBPrintAndreas Rheinhardt2021-12-031-3/+0
| | | | | | | | | An AVBPrint's internal string is always already zero-terminated; writing another '\0' is unnecessary as long as one treats the string only as a C-string. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Properly free an AVDictionaryAndreas Rheinhardt2021-12-031-1/+1
| | | | | | | | It is not documented that freeing the last (and only) entry of an AVDictionary frees the dictionary. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/lavfi: Cleanup generically on read_header failureAndreas Rheinhardt2021-12-031-2/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavd/lavfi.c: Set time_base for 608 cc to container time_base.Yun Zhang2021-08-021-0/+4
| | | | Suggested-By: ffmpeg@fb.com
* avdevice: Constify all devicesAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/packet: Also change av_packet_pack/unpack_dictionary to size_tAndreas Rheinhardt2021-03-191-1/+1
| | | | | | | | | These are auxiliary side-data functions, so they should have been switched to size_t in d79e0fe65c51491f9bf8a470bbe36fb09f3e1280, but this has been forgotten. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Remove double ';'Andreas Rheinhardt2021-03-011-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avdevice/lavfi: av_malloc -> av_malloc_arrayLimin Wang2020-09-211-1/+1
| | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avdevice/lavfi: unref the frame on failureLimin Wang2020-09-211-7/+12
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avdevice/lavfi: fix FIXME and check a/v type by codec_typeLimin Wang2020-09-211-2/+4
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avdevice/lavfi: Remove redundant av_packet_unref()Andreas Rheinhardt2020-09-061-1/+0
| | | | | | | | | Since bae8844e35147f92e612a9e0b44e939a293e5bc9, the AVPacket that is intended to be used to return the demuxed packet is automatically unreferenced when the demuxer returns an error. This makes an av_packet_unref() in the lavfi demuxer redundant. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avdevice/lavfi: Use av_packet_pack_dictionary() to pack dictionaryAndreas Rheinhardt2020-09-061-17/+8
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avdevice/lavfi: Don't set pkt->size to the value it already hasAndreas Rheinhardt2020-09-011-1/+0
| | | | | | | | | | av_new_packet() already sets the size. And if the packet is not allocated by av_new_packet() (which seems to be impossible atm), both pkt->size as well as size are 0, so setting it again is unnecessary in this scenario, too. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avdevice/lavfi: Don't reimplement av_frame_get_side_data()Andreas Rheinhardt2020-09-011-6/+2
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avdevice/lavfi: Use av_packet_move_ref() for packet ownership transferAndreas Rheinhardt2020-09-011-4/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavdevice/lavfi: check avfilter_graph_dump return valueZhao Zhili2019-11-291-3/+7
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lav*,tests: remove several register_all callsJosh de Kock2018-04-021-2/+0
| | | | | | | 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>
* avdevice: migrate to AVFormatContext->urlMarton Balint2018-01-281-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit 'f5950b8fd61ec85e0ad8790bea56b37ceea19436'James Almer2017-10-261-1/+0
| | | | | | | * commit 'f5950b8fd61ec85e0ad8790bea56b37ceea19436': lavfi: Drop unused and empty header file Merged-by: James Almer <jamrial@gmail.com>
* lavd/lavfi: Constify two variables.Carl Eugen Hoyos2017-10-211-1/+1
| | | | | | Fixes the following warnings: libavdevice/lavfi.c:136:16: warning: assignment discards 'const' qualifier from pointer target type libavdevice/lavfi.c:137:17: warning: assignment discards 'const' qualifier from pointer target type
* avdevice: do not use AVFrame accessorMuhammad Faiz2017-04-231-5/+5
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* lavd/lavfi: use buffersink accessors.Nicolas George2017-01-121-18/+19
|
* avdevice/lavfi: Do not set avg_frame_rate to the timebaseMichael Niedermayer2016-06-041-2/+0
| | | | | | | Fixes regression Fixes Ticket5422 (The timebase is 1/25k but the fps are not 25k) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-16/+16
| | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-021-1/+6
| | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avdevice/lavfi: replace deprecated avpicture_layoutPaul B Mahol2016-02-011-6/+2
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* remove all uses of the deprecated avpicture_get_size() functionEddie Hao2016-01-171-1/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avdevice/lavfi: fix self assignment warningGanesh Ajjanagadde2015-08-231-1/+1
| | | | | | | | | FAIL(ret) expands to statements including a silly ret=ret. This triggers a -Wself-assign on confirmed clang 3.6, and so we fix it. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace av_dlog with ff_dlog.Ronald S. Bultje2015-08-181-3/+4
| | | | | ff_dlog checks compilability, and is non-public. av_dlog is deprecated and no longer exists if FF_API_DLOG=0.
* use avfilter_pad_get_{type,name} accessor functionsAndreas Cadhalpun2015-08-081-1/+1
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>