|
FFmpeg
|
#include <stdint.h>#include "config_components.h"#include "libavutil/avassert.h"#include "libavutil/avstring.h"#include "libavutil/dict.h"#include "libavutil/internal.h"#include "libavutil/intreadwrite.h"#include "libavutil/mathematics.h"#include "libavutil/mem.h"#include "libavutil/opt.h"#include "libavutil/pixfmt.h"#include "libavutil/time.h"#include "libavutil/timestamp.h"#include "libavcodec/avcodec.h"#include "libavcodec/bsf.h"#include "libavcodec/codec_desc.h"#include "libavcodec/internal.h"#include "packet_internal.h"#include "libavcodec/raw.h"#include "avformat.h"#include "avformat_internal.h"#include "avio_internal.h"#include "demux.h"#include "id3v2.h"#include "internal.h"#include "url.h"Go to the source code of this file.
Macros | |
| #define | ABSDIFF(a, b) |
| #define | DURATION_DEFAULT_MAX_READ_SIZE 250000LL |
| #define | DURATION_DEFAULT_MAX_RETRY 6 |
| #define | DURATION_MAX_RETRY 1 |
| #define | FAIL(errmsg) |
Functions | |
| static int64_t | wrap_timestamp (const AVStream *st, int64_t timestamp) |
| int64_t | ff_wrap_timestamp (const AVStream *st, int64_t timestamp) |
| Wrap a given time stamp, if there is an indication for an overflow. | |
| static const AVCodec * | find_probe_decoder (AVFormatContext *s, const AVStream *st, enum AVCodecID codec_id) |
| static int | set_codec_from_probe_data (AVFormatContext *s, AVStream *st, AVProbeData *pd) |
| static int | init_input (AVFormatContext *s, const char *filename, AVDictionary **options) |
| static int | codec_close (FFStream *sti) |
| static int | update_stream_avctx (AVFormatContext *s) |
| static av_always_inline int | is_id3v2_format (const AVInputFormat *fmt) |
| int | avformat_open_input (AVFormatContext **ps, const char *filename, const AVInputFormat *fmt, AVDictionary **options) |
| Open an input stream and read the header. | |
| void | avformat_close_input (AVFormatContext **ps) |
| Close an opened input AVFormatContext. | |
| static void | force_codec_ids (AVFormatContext *s, AVStream *st) |
| static int | probe_codec (AVFormatContext *s, AVStream *st, const AVPacket *pkt) |
| static int | update_wrap_reference (AVFormatContext *s, AVStream *st, int stream_index, AVPacket *pkt) |
| static void | update_timestamps (AVFormatContext *s, AVStream *st, AVPacket *pkt) |
| static int | handle_new_packet (AVFormatContext *s, AVPacket *pkt, int allow_passthrough) |
| Handle a new packet and either return it directly if possible and allow_passthrough is true or queue the packet (or drop the packet if corrupt). | |
| int | ff_buffer_packet (AVFormatContext *s, AVPacket *pkt) |
| int | ff_read_packet (AVFormatContext *s, AVPacket *pkt) |
| Read a transport packet from a media file. | |
| static void | compute_frame_duration (AVFormatContext *s, int *pnum, int *pden, AVStream *st, AVCodecParserContext *pc, AVPacket *pkt) |
| Return the frame duration in seconds. | |
| static int | has_decode_delay_been_guessed (AVStream *st) |
| static PacketListEntry * | get_next_pkt (AVFormatContext *s, AVStream *st, PacketListEntry *pktl) |
| static int64_t | select_from_pts_buffer (AVStream *st, int64_t *pts_buffer, int64_t dts) |
| static void | update_dts_from_pts (AVFormatContext *s, int stream_index, PacketListEntry *pkt_buffer) |
| Updates the dts of packets of a stream in pkt_buffer, by re-ordering the pts of the packets in a window. | |
| static void | update_initial_timestamps (AVFormatContext *s, int stream_index, int64_t dts, int64_t pts, AVPacket *pkt) |
| static void | update_initial_durations (AVFormatContext *s, AVStream *st, int stream_index, int64_t duration) |
| static void | compute_pkt_fields (AVFormatContext *s, AVStream *st, AVCodecParserContext *pc, AVPacket *pkt, int64_t next_dts, int64_t next_pts) |
| static int | parse_packet (AVFormatContext *s, AVPacket *pkt, int stream_index, int flush) |
| Parse a packet, add all split parts to parse_queue. | |
| static int64_t | ts_to_samples (AVStream *st, int64_t ts) |
| static int | extract_extradata (FFFormatContext *si, AVStream *st, const AVPacket *pkt) |
| static int | read_frame_internal (AVFormatContext *s, AVPacket *pkt) |
| int | av_read_frame (AVFormatContext *s, AVPacket *pkt) |
| Return the next frame of a stream. | |
| static int | has_duration (AVFormatContext *ic) |
| Return TRUE if the stream has accurate duration in any stream. | |
| static void | update_stream_timings (AVFormatContext *ic) |
| Estimate the stream timings from the one of each components. | |
| static void | fill_all_stream_timings (AVFormatContext *ic) |
| static void | estimate_timings_from_bit_rate (AVFormatContext *ic) |
| static void | estimate_timings_from_pts (AVFormatContext *ic, int64_t old_offset) |
| static const char * | duration_estimate_name (enum AVDurationEstimationMethod method) |
| static void | estimate_timings (AVFormatContext *ic, int64_t old_offset) |
| static int | determinable_frame_size (const AVCodecContext *avctx) |
| static int | has_codec_parameters (const AVStream *st, const char **errmsg_ptr) |
| static int | try_decode_frame (AVFormatContext *s, AVStream *st, const AVPacket *pkt, AVDictionary **options) |
| static int | chapter_start_cmp (const void *p1, const void *p2) |
| static int | compute_chapters_end (AVFormatContext *s) |
| static int | get_std_framerate (int i) |
| static int | tb_unreliable (AVFormatContext *ic, AVStream *st) |
| int | ff_rfps_add_frame (AVFormatContext *ic, AVStream *st, int64_t ts) |
| add frame for rfps calculation. | |
| void | ff_rfps_calculate (AVFormatContext *ic) |
| static int | extract_extradata_check (AVStream *st) |
| static int | extract_extradata_init (AVStream *st) |
| static int | parameters_from_context (AVFormatContext *ic, AVCodecParameters *par, const AVCodecContext *avctx) |
| int | avformat_find_stream_info (AVFormatContext *ic, AVDictionary **options) |
| Read packets of a media file to get stream information. | |
Variables | |
| static const char *const | duration_name [] |
Referenced by select_from_pts_buffer().
| #define DURATION_DEFAULT_MAX_READ_SIZE 250000LL |
Definition at line 1869 of file demux.c.
Referenced by estimate_timings_from_pts().
| #define DURATION_DEFAULT_MAX_RETRY 6 |
Definition at line 1870 of file demux.c.
Referenced by estimate_timings_from_pts().
| #define DURATION_MAX_RETRY 1 |
Definition at line 1871 of file demux.c.
Referenced by estimate_timings_from_pts().
| #define FAIL | ( | errmsg | ) |
Referenced by has_codec_parameters().
Definition at line 53 of file demux.c.
Referenced by ff_wrap_timestamp(), and update_timestamps().
Wrap a given time stamp, if there is an indication for an overflow.
| st | stream |
| timestamp | the time stamp to wrap |
Definition at line 68 of file demux.c.
Referenced by av_add_index_entry(), and read_timestamp().
|
static |
Definition at line 73 of file demux.c.
Referenced by avformat_find_stream_info(), and try_decode_frame().
|
static |
Definition at line 103 of file demux.c.
Referenced by probe_codec().
|
static |
Definition at line 158 of file demux.c.
Referenced by avformat_open_input().
|
static |
Definition at line 1339 of file demux.c.
Referenced by avformat_find_stream_info(), read_frame_internal(), and update_stream_avctx().
|
static |
Definition at line 191 of file demux.c.
Referenced by avformat_find_stream_info(), and avformat_open_input().
|
static |
Definition at line 227 of file demux.c.
Referenced by avformat_open_input().
|
static |
Definition at line 402 of file demux.c.
Referenced by probe_codec(), and update_timestamps().
|
static |
Definition at line 424 of file demux.c.
Referenced by ff_read_packet(), find_probe_decoder(), and handle_new_packet().
|
static |
Definition at line 477 of file demux.c.
Referenced by update_timestamps().
|
static |
Definition at line 545 of file demux.c.
Referenced by handle_new_packet().
|
static |
Handle a new packet and either return it directly if possible and allow_passthrough is true or queue the packet (or drop the packet if corrupt).
Definition at line 577 of file demux.c.
Referenced by ff_buffer_packet(), and ff_read_packet().
| int ff_buffer_packet | ( | AVFormatContext * | s, |
| AVPacket * | pkt ) |
Definition at line 622 of file demux.c.
Referenced by flv_read_packet(), and mov_read_packet().
| int ff_read_packet | ( | AVFormatContext * | s, |
| AVPacket * | pkt ) |
Read a transport packet from a media file.
| s | media file handle |
| pkt | is filled |
Definition at line 629 of file demux.c.
Referenced by asfrtp_parse_packet(), estimate_timings_from_pts(), get_subtitle_pkt(), read_frame_internal(), read_gab2_sub(), and seek_subtitle().
|
static |
Return the frame duration in seconds.
Return 0 if not available.
Definition at line 696 of file demux.c.
Referenced by compute_pkt_fields(), and estimate_timings_from_pts().
|
static |
Definition at line 759 of file demux.c.
Referenced by avformat_find_stream_info(), compute_pkt_fields(), try_decode_frame(), and update_initial_timestamps().
|
static |
Definition at line 779 of file demux.c.
Referenced by update_dts_from_pts(), update_initial_durations(), and update_initial_timestamps().
Definition at line 791 of file demux.c.
Referenced by compute_pkt_fields(), and update_dts_from_pts().
|
static |
Updates the dts of packets of a stream in pkt_buffer, by re-ordering the pts of the packets in a window.
Definition at line 844 of file demux.c.
Referenced by avformat_find_stream_info(), and update_initial_timestamps().
|
static |
Definition at line 869 of file demux.c.
Referenced by compute_pkt_fields().
|
static |
Definition at line 923 of file demux.c.
Referenced by compute_pkt_fields().
|
static |
Definition at line 983 of file demux.c.
Referenced by parse_packet(), and read_frame_internal().
|
static |
Parse a packet, add all split parts to parse_queue.
| pkt | Packet to parse; must not be NULL. |
| flush | Indicates whether to flush. If set, pkt must be blank. |
Definition at line 1178 of file demux.c.
Referenced by read_frame_internal().
Definition at line 1334 of file demux.c.
Referenced by read_frame_internal().
|
static |
Definition at line 2517 of file demux.c.
Referenced by avformat_find_stream_info(), and read_frame_internal().
|
static |
Definition at line 1388 of file demux.c.
Referenced by av_read_frame(), and avformat_find_stream_info().
|
static |
Return TRUE if the stream has accurate duration in any stream.
Definition at line 1688 of file demux.c.
Referenced by estimate_timings().
|
static |
Estimate the stream timings from the one of each components.
Also computes the global bitrate if possible.
Definition at line 1705 of file demux.c.
Referenced by estimate_timings(), and fill_all_stream_timings().
|
static |
Definition at line 1799 of file demux.c.
Referenced by estimate_timings(), and estimate_timings_from_pts().
|
static |
Definition at line 1816 of file demux.c.
Referenced by estimate_timings().
|
static |
Definition at line 1874 of file demux.c.
Referenced by estimate_timings().
|
static |
Definition at line 2022 of file demux.c.
Referenced by estimate_timings().
|
static |
Definition at line 2027 of file demux.c.
Referenced by avformat_find_stream_info().
|
static |
Definition at line 2076 of file demux.c.
Referenced by has_codec_parameters().
|
static |
Definition at line 2089 of file demux.c.
Referenced by avformat_find_stream_info(), and try_decode_frame().
|
static |
Definition at line 2138 of file demux.c.
Referenced by avformat_find_stream_info().
|
static |
Definition at line 2240 of file demux.c.
Referenced by compute_chapters_end().
|
static |
Definition at line 2250 of file demux.c.
Referenced by avformat_find_stream_info().
|
static |
Definition at line 2287 of file demux.c.
Referenced by avformat_find_stream_info(), ff_rfps_add_frame(), and ff_rfps_calculate().
|
static |
Definition at line 2311 of file demux.c.
Referenced by avformat_find_stream_info(), and ff_rfps_calculate().
| int ff_rfps_add_frame | ( | AVFormatContext * | ic, |
| AVStream * | st, | ||
| int64_t | dts ) |
add frame for rfps calculation.
| dts | timestamp of the i-th frame |
Definition at line 2336 of file demux.c.
Referenced by avformat_find_stream_info(), and mov_build_index().
| void ff_rfps_calculate | ( | AVFormatContext * | ic | ) |
Definition at line 2397 of file demux.c.
Referenced by avformat_find_stream_info(), and mov_read_header().
|
static |
Definition at line 2461 of file demux.c.
Referenced by avformat_find_stream_info(), and extract_extradata_init().
|
static |
Definition at line 2477 of file demux.c.
Referenced by extract_extradata().
|
static |
Definition at line 2566 of file demux.c.
Referenced by avformat_find_stream_info().
|
static |
Definition at line 2016 of file demux.c.
Referenced by duration_estimate_name().