Commit Graph

17 Commits

Author SHA1 Message Date
Andreas Rheinhardt 4a4dcde339 avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.h
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>
2024-03-26 06:36: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 abc6a4a6bc avformat/evcdec: Remove unused headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-05 09:40:06 +02:00
Andreas Rheinhardt e5ab2dab2c avformat/evcdec: Check that enough data has been read
Fixes potential use of uninitialized values
in evc_read_nal_unit_length().

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-09 02:40:14 +02:00
Andreas Rheinhardt 83c0f7b046 avformat/evcdec: Avoid nonsense casts
For uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE], &buf still points
to the beginning of buf, but it is of type "pointer to array of
EVC_NALU_LENGTH_PREFIX_SIZE uint8_t" (i.e. pointer arithmetic
would operate on blocks of size EVC_NALU_LENGTH_PREFIX_SIZE).
This is of course a different type than uint8_t*, which is why
there have been casts in evc_read_packet(). But these are unnecessary
if one justs removes the unnecessary address-of operator.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-07 03:47:29 +02:00
James Almer c7183a22db avformat/evc: move NALU length and type parsing functions to a header
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer d0d20f16ce avformat/evcdec: use an unsigned type for nalu_size
But ensure the value returned by evc_read_nal_unit_length() fits in an int.
Should prevent integer overflows later in the code.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer a6a5e53595 avformat/evcdec: flush the bsf on EOF
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer 43ace56c7e avformat/evcdec: remove unnecessary av_packet_unref() calls
And return proper error codes.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer 2276bcc52a avformat/evcdec: ensure there are enough bytes to seekback
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer 3f48815501 avformat/evcdec: don't set AVCodecParameters.framerate
It's not necessary. Setting AVStream.avg_frame_rate is enough.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer 5a2ff43384 avformat/evcdec: simplify au_end_found check
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer ca8a660176 avformat/evcdec: simplify probe function
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer a734fa92c8 avformat/evcdec: set the demuxer as AVFMT_NOTIMESTAMPS
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-16 09:57:35 -03:00
Dawid Kozinski ab2671c5f2 avformat/evc_demuxer: Added demuxer to handle reading EVC video files
- Provided AVInputFormat struct describing EVC input format (ff_evc_demuxer)

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2023-06-15 09:57:35 -03:00