* New public fields should be added right above.
*****************************************************************
*/
- struct AVOutputFormat *next;
+#if FF_API_AVIOFORMAT
+#define ff_const59
+#else
+#define ff_const59 const
+#endif
+ ff_const59 struct AVOutputFormat *next;
/**
* size of private data so that it can be allocated in the wrapper
*/
*
* Muxing only, must be set by the caller before avformat_write_header().
*/
- struct AVOutputFormat *oformat;
+ ff_const59 struct AVOutputFormat *oformat;
/**
* Format private data. This is an AVOptions-enabled struct
* @return >= 0 in case of success, a negative AVERROR code in case of
* failure
*/
-int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat,
+int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFormat *oformat,
const char *format_name, const char *filename);
/**
* @param mime_type if non-NULL checks if mime_type matches with the
* MIME type of the registered formats
*/
-AVOutputFormat *av_guess_format(const char *short_name,
+ff_const59 AVOutputFormat *av_guess_format(const char *short_name,
const char *filename,
const char *mime_type);
/**
* Guess the codec ID based upon muxer and filename.
*/
-enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type,
enum AVMediaType type);
return NULL;
}
-static int fifo_mux_init(AVFormatContext *avf, AVOutputFormat *oformat,
+static int fifo_mux_init(AVFormatContext *avf, ff_const59 AVOutputFormat *oformat,
const char *filename)
{
FifoContext *fifo = avf->priv_data;
static int fifo_init(AVFormatContext *avf)
{
FifoContext *fifo = avf->priv_data;
- AVOutputFormat *oformat;
+ ff_const59 AVOutputFormat *oformat;
int ret = 0;
if (fifo->recovery_wait_streamtime && !fifo->drop_pkts_on_overflow) {
return 0;
}
-AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
+ff_const59 AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
const char *mime_type)
{
const AVOutputFormat *fmt = NULL;
return fmt_found;
}
-enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type,
enum AVMediaType type)
{
if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) {
- AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
+ ff_const59 AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
if (fmt2)
fmt = fmt2;
}
{
HDSContext *c = s->priv_data;
int ret = 0, i;
- AVOutputFormat *oformat;
+ ff_const59 AVOutputFormat *oformat;
if (mkdir(s->url, 0777) == -1 && errno != EEXIST) {
ret = AVERROR(errno);
unsigned var_stream_idx;
unsigned number;
int64_t sequence;
- AVOutputFormat *oformat;
- AVOutputFormat *vtt_oformat;
+ ff_const59 AVOutputFormat *oformat;
+ ff_const59 AVOutputFormat *vtt_oformat;
AVIOContext *out;
int packets_written;
int init_range_length;
}
-int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *oformat,
+int avformat_alloc_output_context2(AVFormatContext **avctx, ff_const59 AVOutputFormat *oformat,
const char *format, const char *filename)
{
AVFormatContext *s = avformat_alloc_context();
AVStream *st;
AVDictionary *tmp = NULL;
AVCodecParameters *par = NULL;
- AVOutputFormat *of = s->oformat;
+ const AVOutputFormat *of = s->oformat;
const AVCodecDescriptor *desc;
AVDictionaryEntry *e;
AVCodecParameters *par, int idx)
{
int i;
- AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
+ const AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
/* Was the payload type already specified for the RTP muxer? */
if (ofmt && ofmt->priv_class && fmt->priv_data) {
{
AVFormatContext *rtpctx = NULL;
int ret;
- AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
+ ff_const59 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
uint8_t *rtpflags;
AVDictionary *opts = NULL;
{
struct MuxChain *chain = s->priv_data;
AVFormatContext *mpegts_ctx = NULL, *rtp_ctx = NULL;
- AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL);
- AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
+ ff_const59 AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL);
+ ff_const59 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
int i, ret = AVERROR(ENOMEM);
AVStream *st;
int segment_idx_wrap; ///< number after which the index wraps
int segment_idx_wrap_nb; ///< number of time the index has wraped
int segment_count; ///< number of segment files already written
- AVOutputFormat *oformat;
+ ff_const59 AVOutputFormat *oformat;
AVFormatContext *avf;
char *format; ///< format to use for output segment files
char *format_options_str; ///< format options to use for output segment files
{
SmoothStreamingContext *c = s->priv_data;
int ret = 0, i;
- AVOutputFormat *oformat;
+ ff_const59 AVOutputFormat *oformat;
if (mkdir(s->url, 0777) == -1 && errno != EEXIST) {
ret = AVERROR(errno);
#ifndef FF_API_LAVF_MP4A_LATM
#define FF_API_LAVF_MP4A_LATM (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
+#ifndef FF_API_AVIOFORMAT
+#define FF_API_AVIOFORMAT (LIBAVFORMAT_VERSION_MAJOR < 59)
+#endif
#ifndef FF_API_R_FRAME_RATE
char *http_method;
uint64_t duration_written;
int prev_pts;
- AVOutputFormat *oformat;
+ ff_const59 AVOutputFormat *oformat;
AVFormatContext *avf;
} WebMChunkContext;