chromium/third_party/ffmpeg/libavformat/mux.c

/*
 * muxing functions for use within FFmpeg
 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include "avformat.h"
#include "internal.h"
#include "mux.h"
#include "version.h"
#include "libavcodec/bsf.h"
#include "libavcodec/codec_desc.h"
#include "libavcodec/internal.h"
#include "libavcodec/packet_internal.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/timestamp.h"
#include "libavutil/avassert.h"
#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"

/**
 * @file
 * muxing functions for use within libavformat
 */

/* fraction handling */

/**
 * f = val + (num / den) + 0.5.
 *
 * 'num' is normalized so that it is such as 0 <= num < den.
 *
 * @param f fractional number
 * @param val integer value
 * @param num must be >= 0
 * @param den must be >= 1
 */
static void frac_init(FFFrac *f, int64_t val, int64_t num, int64_t den)
{}

/**
 * Fractional addition to f: f = f + (incr / f->den).
 *
 * @param f fractional number
 * @param incr increment, can be positive or negative
 */
static void frac_add(FFFrac *f, int64_t incr)
{}

int avformat_alloc_output_context2(AVFormatContext **avctx, const AVOutputFormat *oformat,
                                   const char *format, const char *filename)
{}

static int validate_codec_tag(const AVFormatContext *s, const AVStream *st)
{}


static int init_muxer(AVFormatContext *s, AVDictionary **options)
{}

static int init_pts(AVFormatContext *s)
{}

static void flush_if_needed(AVFormatContext *s)
{}

static void deinit_muxer(AVFormatContext *s)
{}

int avformat_init_output(AVFormatContext *s, AVDictionary **options)
{}

int avformat_write_header(AVFormatContext *s, AVDictionary **options)
{}

#define AV_PKT_FLAG_UNCODED_FRAME


#if FF_API_COMPUTE_PKT_FIELDS2
FF_DISABLE_DEPRECATION_WARNINGS
//FIXME merge with compute_pkt_fields
static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{}
FF_ENABLE_DEPRECATION_WARNINGS
#endif

static void guess_pkt_duration(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{}

static void handle_avoid_negative_ts(FFFormatContext *si, FFStream *sti,
                                     AVPacket *pkt)
{}

/**
 * Shift timestamps and call muxer; the original pts/dts are not kept.
 *
 * FIXME: this function should NEVER get undefined pts/dts beside when the
 * AVFMT_NOTIMESTAMPS is set.
 * Those additional safety checks should be dropped once the correct checks
 * are set in the callers.
 */
static int write_packet(AVFormatContext *s, AVPacket *pkt)
{}

static int check_packet(AVFormatContext *s, AVPacket *pkt)
{}

static int prepare_input_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{}

#define CHUNK_START

int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
                             int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *))
{}

static int interleave_compare_dts(AVFormatContext *s, const AVPacket *next,
                                                      const AVPacket *pkt)
{}

int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *pkt,
                                 int flush, int has_packet)
{}

int ff_interleave_packet_passthrough(AVFormatContext *s, AVPacket *pkt,
                                     int flush, int has_packet)
{}

int ff_get_muxer_ts_offset(AVFormatContext *s, int stream_index, int64_t *offset)
{}

const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)
{}

static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
{}

static int interleaved_write_packet(AVFormatContext *s, AVPacket *pkt,
                                    int flush, int has_packet)
{}

static int write_packet_common(AVFormatContext *s, AVStream *st, AVPacket *pkt, int interleaved)
{}

static int write_packets_from_bsfs(AVFormatContext *s, AVStream *st, AVPacket *pkt, int interleaved)
{}

static int write_packets_common(AVFormatContext *s, AVPacket *pkt, int interleaved)
{}

int av_write_frame(AVFormatContext *s, AVPacket *in)
{}

int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
{}

int av_write_trailer(AVFormatContext *s)
{}

int av_get_output_timestamp(struct AVFormatContext *s, int stream,
                            int64_t *dts, int64_t *wall)
{}

int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *args)
{}

int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
                     AVFormatContext *src, int interleave)
{}

static void uncoded_frame_free(void *unused, uint8_t *data)
{}

static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
                                        AVFrame *frame, int interleaved)
{}

int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
                           AVFrame *frame)
{}

int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
                                       AVFrame *frame)
{}

int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index)
{}