赞
踩
- typedef struct URLProtocol {
- const char *name;
- int (*url_open)( URLContext *h, const char *url, int flags);
- /**
- * This callback is to be used by protocols which open further nested
- * protocols. options are then to be passed to ffurl_open_whitelist()
- * or ffurl_connect() for those nested protocols.
- */
- int (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options);
- int (*url_accept)(URLContext *s, URLContext **c);
- int (*url_handshake)(URLContext *c);
-
- /**
- * Read data from the protocol.
- * If data is immediately available (even less than size), EOF is
- * reached or an error occurs (including EINTR), return immediately.
- * Otherwise:
- * In non-blocking mode, return AVERROR(EAGAIN) immediately.
- * In blocking mode, wait for data/EOF/error with a short timeout (0.1s),
- * and return AVERROR(EAGAIN) on timeout.
- * Checking interrupt_callback, looping on EINTR and EAGAIN and until
- * enough data has been read is left to the calling function; see
- * retry_transfer_wrapper in avio.c.
- */
- int (*url_read)( URLContext *h, unsigned char *buf, int size);
- int (*url_write)(URLContext *h, const unsigned char *buf, int size);
- int64_t (*url_seek)( URLContext *h, int64_t pos, int whence);
- int (*url_close)(URLContext *h);
- int (*url_read_pause)(URLContext *h, int pause);
- int64_t (*url_read_seek)(URLContext *h, int stream_index,
- int64_t timestamp, int flags);
- int (*url_get_file_handle)(URLContext *h);
- int (*url_get_multi_file_handle)(URLContext *h, int **handles,
- int *numhandles);
- int (*url_get_short_seek)(URLContext *h);
- int (*url_shutdown)(URLContext *h, int flags);
- const AVClass *priv_data_class;
- int priv_data_size;
- int flags;
- int (*url_check)(URLContext *h, int mask);
- int (*url_open_dir)(URLContext *h);
- int (*url_read_dir)(URLContext *h, AVIODirEntry **next);
- int (*url_close_dir)(URLContext *h);
- int (*url_delete)(URLContext *h);
- int (*url_move)(URLContext *h_src, URLContext *h_dst);
- const char *default_whitelist;
- } URLProtocol;
- const URLProtocol ff_file_protocol = {
- .name = "file",
- .url_open = file_open,
- .url_read = file_read,
- .url_write = file_write,
- .url_seek = file_seek,
- .url_close = file_close,
- .url_get_file_handle = file_get_handle,
- .url_check = file_check,
- .url_delete = file_delete,
- .url_move = file_move,
- .priv_data_size = sizeof(FileContext),
- .priv_data_class = &file_class,
- .url_open_dir = file_open_dir,
- .url_read_dir = file_read_dir,
- .url_close_dir = file_close_dir,
- .default_whitelist = "file,crypto,data"
- };
- RTMP_CLASS(rtmp)
- const URLProtocol ff_librtmp_protocol = {
- .name = "rtmp",
- .url_open = rtmp_open,
- .url_read = rtmp_read,
- .url_write = rtmp_write,
- .url_close = rtmp_close,
- .url_read_pause = rtmp_read_pause,
- .url_read_seek = rtmp_read_seek,
- .url_get_file_handle = rtmp_get_file_handle,
- .priv_data_size = sizeof(LibRTMPContext),
- .priv_data_class = &librtmp_class,
- .flags = URL_PROTOCOL_FLAG_NETWORK,
- };
- const URLProtocol ff_udp_protocol = {
- .name = "udp",
- .url_open = udp_open,
- .url_read = udp_read,
- .url_write = udp_write,
- .url_close = udp_close,
- .url_get_file_handle = udp_get_file_handle,
- .priv_data_size = sizeof(UDPContext),
- .priv_data_class = &udp_class,
- .flags = URL_PROTOCOL_FLAG_NETWORK,
- };
- = {
- .name = "flv",
- .long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
- .priv_data_size = sizeof(FLVContext),
- .read_probe = flv_probe,
- .read_header = flv_read_header,
- .read_packet = flv_read_packet,
- .read_seek = flv_read_seek,
- .read_close = flv_read_close,
- .extensions = "flv",
- .priv_class = &flv_class,
- }
- = {
- .name = "matroska,webm",
- .long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"),
- .extensions = "mkv,mk3d,mka,mks",
- .priv_data_size = sizeof(MatroskaDemuxContext),
- .read_probe = matroska_probe,
- .read_header = matroska_read_header,
- .read_packet = matroska_read_packet,
- .read_close = matroska_read_close,
- .read_seek = matroska_read_seek,
- .mime_type = "audio/webm,audio/x-matroska,video/webm,video/x-matroska"
- }
- = {
- .name = "mpegts",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
- .priv_data_size = sizeof(MpegTSContext),
- .read_probe = mpegts_probe,
- .read_header = mpegts_read_header,
- .read_packet = mpegts_read_packet,
- .read_close = mpegts_read_close,
- .read_timestamp = mpegts_get_dts,
- .flags = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
- .priv_class = &mpegts_class,
- }
- = {
- .name = "avi",
- .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
- .priv_data_size = sizeof(AVIContext),
- .extensions = "avi",
- .read_probe = avi_probe,
- .read_header = avi_read_header,
- .read_packet = avi_read_packet,
- .read_close = avi_read_close,
- .read_seek = avi_read_seek,
- .priv_class = &demuxer_class,
- }
- typedef struct AVCodec {
- /**
- * Name of the codec implementation.
- * The name is globally unique among encoders and among decoders (but an
- * encoder and a decoder can share the same name).
- * This is the primary way to find a codec from the user perspective.
- */
- const char *name;
- /**
- * Descriptive name for the codec, meant to be more human readable than name.
- * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
- */
- const char *long_name;
- enum AVMediaType type;
- enum AVCodecID id;
- /**
- * Codec capabilities.
- * see AV_CODEC_CAP_*
- */
- int capabilities;
- uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
- const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
- const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
- const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
- const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
- #if FF_API_OLD_CHANNEL_LAYOUT
- /**
- * @deprecated use ch_layouts instead
- */
- attribute_deprecated
- const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
- #endif
- const AVClass *priv_class; ///< AVClass for the private context
- const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
-
- /**
- * Group name of the codec implementation.
- * This is a short symbolic name of the wrapper backing this codec. A
- * wrapper uses some kind of external implementation for the codec, such
- * as an external library, or a codec implementation provided by the OS or
- * the hardware.
- * If this field is NULL, this is a builtin, libavcodec native codec.
- * If non-NULL, this will be the suffix in AVCodec.name in most cases
- * (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>").
- */
- const char *wrapper_name;
-
- /**
- * Array of supported channel layouts, terminated with a zeroed layout.
- */
- const AVChannelLayout *ch_layouts;
- } AVCodec;
- = {
- .name = "hevc",
- .long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_HEVC,
- .priv_data_size = sizeof(HEVCContext),
- .priv_class = &hevc_decoder_class,
- .init = hevc_decode_init,
- .close = hevc_decode_free,
- .decode = ,
- .flush = hevc_decode_flush,
- .update_thread_context = hevc_update_thread_context,
- .init_thread_copy = hevc_init_thread_copy,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
- AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
- }
- = {
- .name = "h264",
- .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_H264,
- .priv_data_size = sizeof(H264Context),
- .init = ff_h264_decode_init,
- .close = h264_decode_end,
- .decode = h264_decode_frame,
- .capabilities = AV_CODEC_CAP_DR1 |
- AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
- AV_CODEC_CAP_FRAME_THREADS,
- .flush = flush_dpb,
- .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
- .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
- .priv_class = &h264_class,
- }
- AVCodec ff_libvpx_vp8_decoder = {
- .name = "libvpx",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_VP8,
- .priv_data_size = sizeof(VP8Context),
- .init = vp8_init,
- .close = vp8_free,
- .decode = vp8_decode,
- .capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
- };
- = {
- .name = "mpeg2video",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_MPEG2VIDEO,
- .priv_data_size = sizeof(Mpeg1Context),
- .init = mpeg_decode_init,
- .close = mpeg_decode_end,
- .decode = mpeg_decode_frame,
- .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
- AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY |
- AV_CODEC_CAP_SLICE_THREADS,
- .flush = flush,
- .max_lowres = 3,
- .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。