summaryrefslogtreecommitdiff
path: root/libavdevice
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/ccfifo: remove unnecessary context allocationsJames Almer2023-05-122-8/+8
| | | | | | | This is not public API, no it has no need for an alloc() and free() functions. The struct can reside on stack. Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/decklink: move AVPacketQueue into decklink_common and rename it to ↵Devin Heitmueller2023-05-113-125/+133
| | | | | | | | | | | | | | | | | | | | DecklinkPacketQueue Move the AVPacketQueue functionality that is currently only used for the decklink decode module into decklink_common, so it can be shared by the decklink encoder (i.e. for VANC insertion when we receive data packets separate from video). The threadsafe queue used within the decklink module was named "AVPacketQueue" which implies that it is part of the public API, which it is not. Rename the functions and the name of the queue struct to make clear it is used exclusively by decklink, per Marton Balint's suggestion. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_enc: add support for playout of 608 captions in MOV filesDevin Heitmueller2023-05-115-1/+94
| | | | | | | | | | | | | | | | | Unlike other cases where the closed captions are embedded in the video stream as MPEG-2 userdata or H.264 SEI data, with MOV files the captions are often found on a separate "e608" subtitle track. Add support for playout of such files, leveraging the new ccfifo mechanism to ensure that they are embedded into VANC at the correct rate (since e608 packets often contain batches of multiple 608 pairs). Note this patch includes a new file named libavdevice/ccfifo.c, which allows the ccfifo functionality in libavfilter to be reused even if doing shared builds. This is the same approach used for log2_tab.c. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avdevice/lavfi: check that pointer is setPaul B Mahol2023-05-101-0/+4
| | | | Fixes NULL pointer dereference later.
* avdevice/decklink_enc: fix operator precedence in create_s337_payloadMarton Balint2023-04-241-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_enc: Add support for compressed AC-3 output over SDIDevin Heitmueller2023-04-081-15/+85
| | | | | | | | | | | | | | | | | | | Extend the decklink output to include support for compressed AC-3, encapsulated using the SMPTE ST 377:2015 standard. This functionality can be exercised by using the "copy" codec when the input audio stream is AC-3. For example: ./ffmpeg -i ~/foo.ts -codec:a copy -f decklink 'UltraStudio Mini Monitor' Note that the default behavior continues to be to do PCM output, which means without specifying the copy codec a stream containing AC-3 will be decoded and downmixed to stereo audio before output. Thanks to Marton Balint for providing feedback. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_enc: Add support for output of Active Format Description (AFD)Devin Heitmueller2023-04-061-2/+88
| | | | | | | | | | | | | | Implement support for including AFD in decklink output when putting out 10-bit VANC data. Updated to reflect feedback in 2018 from Marton Balint <cus@passwd.hu>, Carl Eugen Hoyos <ceffmpeg@gmail.com> and Aaron Levinson <alevinsn_dev@levland.net>. Also includes fixes to set the AR field based on the SAR, as well as now sending the AFD info in both fields for interlaced formats. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* 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/decklink_enc: fix unused variable compiler warningsDevin Heitmueller2023-03-081-2/+0
| | | | | | | | Due to refactoring, the ctx/cctx variables are never actually used in ff_decklink_write_packet(), so just remove them. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_enc: fix setting of last_pts to only be set for videoDevin Heitmueller2023-03-081-2/+2
| | | | | | | | | | | | | | The ff_decklink_write_packet() was always caching the last pts received, to be used when calling StopScheduledPlayback(). However because audio and video are on different timebases and the call to StopScheduledPlayback() expects the video timebase, we'll end up sending a weird value to the stop routine if the last packet received contained audio. Move the setting of last_pts to just be for the video stream. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/decklink_enc: don't take for granted that first frame to decklink ↵Devin Heitmueller2023-03-082-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | output will be PTS 0 The existing code assumed that the first frame received by the decklink output would always be PTS zero. However if running in other timing modes than the default of CBR, items such as frame dropping at the beginning may result in starting at a non-zero PTS. For example, in our setup because we discard probing data and run with "-vsync 2" the first video frame scheduled to the decklink output will have a PTS around 170. Scheduling frames too far into the future will either fail or cause a backlog of frames scheduled far enough into the future that the entire pipeline will stall. Issue can be reproduced with the following command-line: ./ffmpeg -copyts -i foo.ts -f decklink -vcodec v210 -ac 2 'DeckLink Duo (4)' Keep track of the PTS of the first frame received, so that when we enable start playback we can provide that value to the decklink driver. Thanks to Marton Balint for review and suggestion to use AV_NOPTS_VALUE rather than zero for the initial value. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* version.h: Bump minor post 6.0 branchn6.1-devMichael Niedermayer2023-02-191-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* version.h: Bump minor for 6.0 branchMichael Niedermayer2023-02-191-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump major versions of all librariesJames Almer2023-02-092-3/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice: remove FF_API_DEVICE_CAPABILITIESJames Almer2023-02-093-150/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Move AVOutputFormat internals out of public headerAndreas Rheinhardt2023-02-0914-104/+114
| | | | | | | | | | | | | | This commit does for AVOutputFormat what commit 20f972701806be20a77f808db332d9489343bb78 did for AVCodec: It adds a new type FFOutputFormat, moves all the internals of AVOutputFormat to it and adds a now reduced AVOutputFormat as first member. This does not affect/improve extensibility of both public or private fields for muxers (it is still a mess due to lavd). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avdevice/avfoundation: convert to new channel layout-APIJames Almer2022-11-081-2/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/audiotoolbox: convert to new channel layout-APIJames Almer2022-11-081-3/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/avdevice: Fix mismatching argument nameMarvin Scholz2022-10-171-1/+1
|
* avformat/internal: Don't include avcodec.hAndreas Rheinhardt2022-09-262-1/+1
| | | | | | | | | | | | | | | The general demuxing API uses parsers and decoders. Therefore FFStream contains pointers to AVCodecContexts and AVCodecParserContext and lavf/internal.h includes lavc/avcodec.h. Yet actually only a few files files really use these; and it is best when this number stays small. Therefore this commit uses opaque structs in lavf/internal.h for these contexts and stops including avcodec.h. This also avoids including lavc/codec_desc.h implicitly. All other headers are implicitly included as now (mostly through codec.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/internal: Move avpriv-file API to a header of its ownAndreas Rheinhardt2022-09-035-0/+5
| | | | | | | It is not used by the large majority of files that include lavu/internal.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: always enable gnu_windres if availableTimo Rothenpieler2022-08-131-1/+1
| | | | | Use the appropiate Makefile variable to ensure the resource file is only built into shared libraries instead.
* avdevice/v4l2: fix leak of timefilterZhao Zhili2022-08-031-0/+1
| | | | | | Fixes ticket #9844. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavd: use AVFrame.duration instead of AVFrame.pkt_durationAnton Khirnov2022-07-192-2/+16
|
* avdevice/lavfi: pass forward video framerateTimo Rothenpieler2022-07-181-0/+5
|
* avdevice/lavfi: output wrapped AVFramesTimo Rothenpieler2022-07-182-55/+36
| | | | | | | | | | | | | 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/avdevice: fix return value of avdevice_list_devices()Marton Balint2022-07-171-2/+4
| | | | | | | | | | | | | | According to API docs avdevice_list_devices(), avdevice_list_input_sources() and avdevice_list_input_sinks() should return the number of autodetected devices on success. This is redundant with AVDeviceInfoList->nb_devices so it was not noticed earlier that none of the underlying device list functions work like that. Let's fix it in generic code to make it in line with the API docs. Fixes ticket #9820. Signed-off-by: Marton Balint <cus@passwd.hu>
* Bump versions after 5.1 branchn5.2-devMichael Niedermayer2022-07-131-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump Versions for 5.1 branchMichael Niedermayer2022-07-131-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* av(format|device): Add const to muxer packet data pointersAndreas Rheinhardt2022-07-094-4/+5
| | | | | | | The packets given to muxers need not be writable, so it is best to access them via const uint8_t*. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/oss_dec: account for sample size when computing timestampMatt Jacobson2022-06-193-2/+5
| | | | | | | | | Don't assume each sample is one byte in size. Doing so results in wrong and occasionally non-monotonically-increasing timestamps. Fix nearby cosmetic typo. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/pulse_audio_dec: deprecate frame_size optionMarton Balint2022-06-161-1/+2
| | | | | | It does not do anything. Frame sizes can be controlled by using fragment_size. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/pulse_audio_dec: reduce default fragment sizeMarton Balint2022-06-161-1/+6
| | | | | | | | | | | | | Reduces default fragment size from the pulse audio default of 2 sec to 50 ms. This also has an effect on the size of the returned frames, which will be around 50 ms as well, making timestamps more accurate. This should fix the regression in ticket #9776. Pulseaudio timestamps for monitor sources are still pretty inaccurate for me, but I don't see how else should we query latencies from the library. Signed-off-by: Marton Balint <cus@passwd.hu>
* Revert "avdevice/pulse_audio_dec: only set adjust latency flag if ↵Marton Balint2022-06-161-1/+1
| | | | | | | | | | fragment_size is not set" This reverts commit 7f059a250bb7bcbf7bba537c1a059a5934413035. Apparently adjusting latency makes a difference even if fragment size is specifed. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/dshow: reuse unused variables.Diederick Niehorster2022-05-121-3/+3
| | | | | | | | Fix for f125c504d8fece6420bb97767f9e72414c26312a, requested_sample_rate and such should be used. Signed-off-by: Diederick Niehorster <dcnieho@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/v4l2*: Improve included headersAndreas Rheinhardt2022-05-103-11/+14
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move parser functions to a new file, demux_utils.cAndreas Rheinhardt2022-05-101-0/+1
| | | | | | | This file is both for the various public APIs that are demuxer-only as well as for the demuxer-only internal functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Add new demux.h headerAndreas Rheinhardt2022-05-101-0/+1
| | | | | | And move those stuff already in demuxer-only files to it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/internal: Move muxing-only functions to new mux.h headerAndreas Rheinhardt2022-05-104-2/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lib*/version: Move library version functions into files of their ownAndreas Rheinhardt2022-05-103-24/+46
| | | | | | | This avoids having to rebuild big files every time FFMPEG_VERSION changes (which it does with every commit). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avdevice/dshow: Fix dshow device name/descriptionRomain Beauxis2022-04-091-2/+2
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/dshow: fix regressionDiederick Niehorster2022-03-291-17/+6
| | | | | | | | | a1c4929f accidentally undid part of d9a9b4c8, so the bug in ticket #9420 resurfaced. Fixing again. Signed-off-by: Diederick Niehorster <dcnieho@gmail.com> Reviewed-by: Roger Pack <rogerdpack2@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Keep including the full version.h when headers are included externallyMartin Storsjö2022-03-191-0/+6
| | | | | | | | | This avoids unnecessary churn and build breakage for users, by making sure the whole version.h is included like it has been so far, while keeping the benefit of not needing to rebuild most files in the ffmpeg tree on minor/micro bumps. Signed-off-by: Martin Storsjö <martin@martin.st>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-162-0/+4
| | | | | | | | 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>
* doc: Add an entry to APIchanges about changes to version.h and version_major.hMartin Storsjö2022-03-161-1/+1
| | | | | | | | Also bump the minor versions of all libraries, to signify the API change of splitting the version.h headers and adding the new version_major.h header. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavdevice: Split version.hMartin Storsjö2022-03-165-9/+42
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Split version.hMartin Storsjö2022-03-162-0/+2
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>
* sndio: convert to new channel layout APIJames Almer2022-03-152-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* pulseaudio: convert to new channel layout APIJames Almer2022-03-152-34/+34
| | | | Signed-off-by: James Almer <jamrial@gmail.com>