Several encoders (roqvideo, svq1, snow, and the mpegvideo family)
currently call ff_get_buffer(). However this function is written
assuming it is called by a decoder. Though nothing has been obviously
broken by this until now, that may change in the future.
To avoid potential future issues, introduce a simple encode-specific
wrapper around avcodec_default_get_buffer2() and enforce its use in
encoders.
av_get_pix_fmt_name() is used in an ff_tlog(), which is only
compiled if TRACE is defined. Fixes a regression caused by
f2b79c5b85.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Required to remux m2ts to mkv
Minor changes and porting to FFBitStreamFilter done by the committer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
An auxiliary function for AVFormatContexts (mainly muxers,
but potentially (e.g. rtsp) also demuxers).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is only used by demuxers (and it is generally demuxers
who have to translate format-specific IDs to stream indices).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
They are also needed by the MMSH and MMST protocols and therefore
the file they are in is pulled in when these protocols are enabled
and used. By moving them to a separate file, linking statically to
libavformat while only using AVIO no longer pulls in all the
muxers/demuxers (and also no longer any AVCodecs when linking
statically to libavcodec).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is not forbidden to call this with a muxer, so it is moved to
avformat.c and not demux_utils.c. ff_find_decoder(), which is used
by av_find_best_stream() is also moved as well, despite being even
more geared towards demuxers.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
While it is clearly written with demuxers in mind,
it is not forbidden to call it with muxers, hence avformat.c
and not demux_utils.c.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is not explicitly forbidden to call these functions with muxers
(although it is probably intended to be only called by demuxers;
av_guess_sample_aspect_ratio even says that "the stream aspect ratio
is set by the demuxer").
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is not to call this with a muxer, so move it to avformat.c
and not demux_utils.c.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This file will contain the AVFormatContext-specific parts
that are used by both demuxers and muxers.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is only used by demuxers (although it is hypothetically
possible that some day e.g. a protocol might need it, but
that is unlikely given that they don't deal with AVCodecParameters).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is demuxer-only: It potentially adds an AVStream and it sets
AVStream.attached_pic.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This function is only intended for demuxers (as calling it doesn't
have any observable effect for a muxer).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is demuxer-only: Muxers deal only with chapters given to them;
they don't create any of their own.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
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>
ff_get_packet_palette() and ff_reshuffle_raw_rgb() belong together:
E.g. the former takes the return value of the latter as argument.
So move ff_get_packet_palette() to rawutils.c (which consists solely
of ff_reshuffle_raw_rgb()).
Also add a separate header for these two functions.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is only used by muxers. Given that it is not part of
the core muxing code and given that mux.c is already big enough,
it is moved to a new file for utility functions for muxing.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This is the appropriate place given that AVStream is about to
become an AVOpt-enabled struct.
Also move av_disposition_(to|from)_string, as these are tied
to the disposition stream option.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>