avformat/avformat: Add AVStream parameter to check_bitstream() sig

For most check_bitstream() functions this just avoids having
to dereference s->streams[pkt->stream_index] themselves; but for
meta-muxers it will allow to forward the packet to stream with
a different stream_index (belonging to a different AVFormatContext)
without using a spare packet.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2021-11-18 21:48:49 +01:00
parent c90b3661fa
commit a5ee166327
10 changed files with 36 additions and 27 deletions

View File

@@ -322,6 +322,7 @@
#include "libavformat/version.h"
struct AVFormatContext;
struct AVStream;
struct AVDeviceInfoList;
struct AVDeviceCapabilitiesQuery;
@@ -623,9 +624,13 @@ typedef struct AVOutputFormat {
/**
* Set up any necessary bitstream filtering and extract any extra data needed
* for the global header.
*
* @note pkt might have been directly forwarded by a meta-muxer; therefore
* pkt->stream_index as well as the pkt's timebase might be invalid.
* Return 0 if more packets from this stream must be checked; 1 if not.
*/
int (*check_bitstream)(struct AVFormatContext *, const AVPacket *pkt);
int (*check_bitstream)(struct AVFormatContext *s, struct AVStream *st,
const AVPacket *pkt);
} AVOutputFormat;
/**
* @}