Commit Graph

24 Commits

Author SHA1 Message Date
Andreas Rheinhardt 790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt b800327f4c avformat/avformat: Add FFInputFormat, hide internals of AVInputFormat
This commit does for AVInputFormat what commit
59c9dc82f4 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 50f34172e0
(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>
2024-03-07 08:53:31 -03:00
Anton Khirnov 08bebeb1be Revert "all: Don't set AVClass.item_name to its default value"
Some callers assume that item_name is always set, so this may be
considered an API break.

This reverts commit 0c6203c97a.
2024-01-20 10:34:48 +01:00
Andreas Rheinhardt 0c6203c97a all: Don't set AVClass.item_name to its default value
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-22 15:12:33 +01:00
Andreas Rheinhardt 2b41463b87 avformat/internal: Don't include avcodec.h
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>
2022-09-26 03:02:50 +02:00
Anton Khirnov 368f50404d jack: port to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton Khirnov d46fd9640f lavd/jack: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 007819a5bc lavd/jack: increase buffer size for snprintf()
Maximum output size with a 32-bit int is 17 bytes, or 26 with a 64-bit
int.

Silences the following gcc 10 warning:
src/libavdevice/jack.c: In function ‘audio_read_header’:
src/libavdevice/jack.c:171:45: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
  171 |         snprintf(str, sizeof(str), "input_%d", i + 1);
      |                                             ^
src/libavdevice/jack.c:171:9: note: ‘snprintf’ output between 8 and 17 bytes into a destination of size 16
  171 |         snprintf(str, sizeof(str), "input_%d", i + 1);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-12-07 11:16:14 +01:00
Andreas Rheinhardt d92f38c179 avdevice: Constify all devices
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>
2021-04-27 11:48:05 -03:00
Marton Balint 4bb0409820 avdevice: migrate to AVFormatContext->url
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 23:06:43 +01:00
James Almer 6821b693ec Merge commit '5a969f64b9cf40bad923c73b66c3031b0018e848'
* commit '5a969f64b9cf40bad923c73b66c3031b0018e848':
  jack: Drop support for old (2012) JACK versions

Merged-by: James Almer <jamrial@gmail.com>
2017-10-24 19:17:02 -03:00
Diego Biurrun 5a969f64b9 jack: Drop support for old (2012) JACK versions 2017-03-28 09:11:00 +02:00
Josh de Kock c2fcf4fa0b avdev/jack: remove duplicated dispatch macros
The macros were moved to compat/dispatch_semaphore/semaphore.h after a libav merge, and were never removed from jack.c
2016-07-26 23:10:47 +01:00
Derek Buitenhuis 6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* 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>
2016-04-10 20:59:55 +01:00
Anton Khirnov 9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.

In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.

There are multiple important problems with this approach:
    - the fields in AVCodecContext are in general one of
        * stream parameters
        * codec options
        * codec state
      However, it's not clear which ones are which. It is consequently
      unclear which fields are a demuxer allowed to set or a muxer allowed to
      read. This leads to erratic behaviour depending on whether decoding or
      encoding is being performed or not (and whether it uses the AVStream
      embedded codec context).
    - various synchronization issues arising from the fact that the same
      context is used by several different APIs (muxers/demuxers,
      parsers, bitstream filters and encoders/decoders) simultaneously, with
      there being no clear rules for who can modify what and the different
      processes being typically delayed with respect to each other.
    - avformat_find_stream_info() making it necessary to support opening
      and closing a single codec context multiple times, thus
      complicating the semantics of freeing various allocated objects in the
      codec context.

Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
2016-02-23 17:01:58 +01:00
Josh de Kock 67f8a0be54 configure&avdevice/jack: Fixed issue #43 JACK indev support on OSX
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-22 00:46:49 +01:00
Hendrik Leppkes 7f5af80ba4 Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
  avpacket: Replace av_free_packet with av_packet_unref

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Luca Barbato ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Michael Niedermayer 77510a9698 Merge commit 'bc1eace1b3654c490cb2c226b3c80854244dbb9a'
* commit 'bc1eace1b3654c490cb2c226b3c80854244dbb9a':
  jack: Check memory allocation

Conflicts:
	libavdevice/jack.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-08 22:48:14 +02:00
Vittorio Giovara bc1eace1b3 jack: Check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1292520
2015-06-08 13:03:27 +01:00
Michael Niedermayer 1c667626bb Merge commit '386e2755aab73ae7075f78d92786cb5c5419597a'
* commit '386e2755aab73ae7075f78d92786cb5c5419597a':
  jack: Check memory allocation

Conflicts:
	libavdevice/jack.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 12:46:29 +02:00
Federico Tomassetti 386e2755aa jack: Check memory allocation
Bug-Id: CID 1265785
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-04-19 23:50:48 +01:00
Michael Niedermayer b1b58310d0 Merge commit '8d26c193fb42d08602ac93ece039d4718d029adc'
* commit '8d26c193fb42d08602ac93ece039d4718d029adc':
  avdevice: Apply a more consistent file naming scheme

Conflicts:
	libavdevice/Makefile
	libavdevice/alsa.h
	libavdevice/alsa_dec.c
	libavdevice/alsa_enc.c
	libavdevice/sndio_enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 21:36:42 +02:00
Diego Biurrun 8d26c193fb avdevice: Apply a more consistent file naming scheme 2015-04-09 16:40:12 +02:00