[FFmpeg-devel] [PATCH 5/7] avformat/mpegts: add s337m support
Scott Theisen
scott.the.elm at gmail.com
Tue Dec 10 22:54:23 EET 2024
On 12/8/24 22:55, Michael Niedermayer wrote:
> On Wed, Dec 04, 2024 at 03:14:07PM +0100, ffnicolasg at sfr.fr wrote:
>> From: Nicolas Gaullier <nicolas.gaullier at cji.paris>
>>
>> Move s302m decoder from avcodec to avformat.
>> Set AVSTREAM_PARSE_FULL for s337m support.
>>
>> Signed-off-by: Nicolas Gaullier <nicolas.gaullier at cji.paris>
>> ---
>> libavformat/mpegts.c | 138 +++++++++++++++++++++++++++++++++++++++++-
>> tests/fate/acodec.mak | 3 +-
>> 2 files changed, 139 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
>> index 177e610e53..fd649751fc 100644
>> --- a/libavformat/mpegts.c
>> +++ b/libavformat/mpegts.c
>> @@ -31,6 +31,7 @@
>> #include "libavutil/opt.h"
>> #include "libavutil/avassert.h"
>> #include "libavutil/dovi_meta.h"
>> +#include "libavutil/reverse.h"
>> #include "libavcodec/bytestream.h"
>> #include "libavcodec/defs.h"
>> #include "libavcodec/get_bits.h"
> [...]
>> +static int s302m_demux(AVCodecParameters *par, AVPacket *pkt)
>> +{
>> + int ret = av_packet_make_writable(pkt);
>> + if (ret < 0)
>> + return ret;
>> + pkt->data += AES3_HEADER_LEN;
>> + av_shrink_packet(pkt, pkt->size - AES3_HEADER_LEN);
>> +
>> + if (par->bits_per_raw_sample == 24) {
>> + uint8_t *buf = pkt->data;
>> + uint8_t *buf_out = buf;
>> + for (; buf + 6 < pkt->data + pkt->size; buf+=7, buf_out+=6)
>> + AV_WL48(buf_out,
>> + ((uint64_t)ff_reverse[buf[2]] << 16) |
>> + ((uint64_t)ff_reverse[buf[1]] << 8) |
>> + ((uint64_t)ff_reverse[buf[0]]) |
>> + ((uint64_t)ff_reverse[buf[6] & 0xf0] << 44) |
>> + ((uint64_t)ff_reverse[buf[5]] << 36) |
>> + ((uint64_t)ff_reverse[buf[4]] << 28) |
>> + ((uint64_t)ff_reverse[buf[3] & 0x0f] << 20));
>> + av_shrink_packet(pkt, buf_out - pkt->data);
> /usr/bin/ld: libavformat/libavformat.so: undefined reference to `ff_reverse'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [Makefile:142: ffprobe_g] Error 1
> make: *** Waiting for unfinished jobs....
> /usr/bin/ld: libavformat/libavformat.so: undefined reference to `ff_reverse'
> /usr/bin/ld: libavformat/libavformat.so: undefined reference to `ff_reverse'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [Makefile:142: ffplay_g] Error 1
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [Makefile:142: ffmpeg_g] Error 1
>
> thx
>
ff_* symbols are not exported and are internal to each library. Some of
the other libraries `#include "libavutil/reverse.c"` in a file. Should
ff_reverse be renamed avpriv_reverse so that is not necessary?
Regards,
Scott Theisen
More information about the ffmpeg-devel
mailing list