/*
* copyright (c) 2001 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
*/
#ifndef AVCODEC_AVCODEC_H
#define AVCODEC_AVCODEC_H
/**
* @file
* @ingroup libavc
* Libavcodec external API header
*/
#include <errno.h>
#include "libavutil/samplefmt.h"
#include "libavutil/attributes.h"
#include "libavutil/avutil.h"
#include "libavutil/buffer.h"
#include "libavutil/cpu.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/frame.h"
#include "libavutil/log.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
#include "version.h"
/**
* @defgroup libavc libavcodec
* Encoding/Decoding Library
*
* @{
*
* @defgroup lavc_decoding Decoding
* @{
* @}
*
* @defgroup lavc_encoding Encoding
* @{
* @}
*
* @defgroup lavc_codec Codecs
* @{
* @defgroup lavc_codec_native Native Codecs
* @{
* @}
* @defgroup lavc_codec_wrappers External library wrappers
* @{
* @}
* @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
* @{
* @}
* @}
* @defgroup lavc_internal Internal
* @{
* @}
* @}
*/
/**
* @ingroup libavc
* @defgroup lavc_encdec send/receive encoding and decoding API overview
* @{
*
* The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/
* avcodec_receive_packet() functions provide an encode/decode API, which
* decouples input and output.
*
* The API is very similar for encoding/decoding and audio/video, and works as
* follows:
* - Set up and open the AVCodecContext as usual.
* - Send valid input:
* - For decoding, call avcodec_send_packet() to give the decoder raw
* compressed data in an AVPacket.
* - For encoding, call avcodec_send_frame() to give the decoder an AVFrame
* containing uncompressed audio or video.
* In both cases, it is recommended that AVPackets and AVFrames are
* refcounted, or libavcodec might have to copy the input data. (libavformat
* always returns refcounted AVPackets, and av_frame_get_buffer() allocates
* refcounted AVFrames.)
* - Receive output in a loop. Periodically call one of the avcodec_receive_*()
* functions and process their output:
* - For decoding, call avcodec_receive_frame(). On success, it will return
* an AVFrame containing uncompressed audio or video data.
* - For encoding, call avcodec_receive_packet(). On success, it will return
* an AVPacket with a compressed frame.
* Repeat this call until it returns AVERROR(EAGAIN) or an error. The
* AVERROR(EAGAIN) return value means that new input data is required to
* return new output. In this case, continue with sending input. For each
* input frame/packet, the codec will typically return 1 output frame/packet,
* but it can also be 0 or more than 1.
*
* At the beginning of decoding or encoding, the codec might accept multiple
* input frames/packets without returning a frame, until its internal buffers
* are filled. This situation is handled transparently if you follow the steps
* outlined above.
*
* End of stream situations. These require "flushing" (aka draining) the codec,
* as the codec might buffer multiple frames or packets internally for
* performance or out of necessity (consider B-frames).
* This is handled as follows:
* - Instead of valid input, send NULL to the avcodec_send_packet() (decoding)
* or avcodec_send_frame() (encoding) functions. This will enter draining
* mode.
* - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet()
* (encoding) in a loop until AVERROR_EOF is returned. The functions will
* not return AVERROR(EAGAIN), unless you forgot to enter draining mode.
* - Before decoding can be resumed again, the codec has to be reset with
* avcodec_flush_buffers().
*
* Using the API as outlined above is highly recommended. But it is also
* possible to call functions outside of this rigid schema. For example, you can
* call avcodec_send_packet() repeatedly without calling
* avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed
* until the codec's internal buffer has been filled up (which is typically of
* size 1 per output frame, after initial input), and then reject input with
* AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to
* read at least some output.
*
* Not all codecs will follow a rigid and predictable dataflow; the only
* guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on
* one end implies that a receive/send call on the other end will succeed. In
* general, no codec will permit unlimited buffering of input or output.
*
* This API replaces the following legacy functions:
* - avcodec_decode_video2() and avcodec_decode_audio4():
* Use avcodec_send_packet() to feed input to the decoder, then use
* avcodec_receive_frame() to receive decoded frames after each packet.
* Unlike with the old video decoding API, multiple frames might result from
* a packet. For audio, splitting the input packet into frames by partially
* decoding packets becomes transparent to the API user. You never need to
* feed an AVPacket to the API twice.
* Additionally, sending a flush/draining packet is required only once.
* - avcodec_encode_video2()/avcodec_encode_audio2():
* Use avcodec_send_frame() to feed input to the encoder, then use
* avcodec_receive_packet() to receive encoded packets.
* Providing user-allocated buffers for avcodec_receive_packet() is not
* possible.
* - The new API does not handle subtitles yet.
*
* Mixing new and old function calls on the same AVCodecContext is not allowed,
* and will result in undefined behavior.
*
* Some codecs might require using the new API; using the old API will return
* an error when calling it.
* @}
*/
/**
* @defgroup lavc_core Core functions/structures.
* @ingroup libavc
*
* Basic definitions, functions for querying libavcodec capabilities,
* allocating core structures, etc.
* @{
*/
/**
* Identify the syntax and semantics of the bitstream.
* The principle is roughly:
* Two decoders with the same ID can decode the same streams.
* Two encoders with the same ID can encode compatible streams.
* There may be slight deviations from the principle due to implementation
* details.
*
* If you add a codec ID to this list, add it so that
* 1. no value of an existing codec ID changes (that would break ABI),
* 2. it is as close as possible to similar codecs
*
* After adding new codec IDs, do not forget to add an entry to the codec
* descriptor list and bump libavcodec minor version.
*/
enum AVCodecID {
AV_CODEC_ID_NONE,
/* video codecs */
AV_CODEC_ID_MPEG1VIDEO,
AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
#if FF_API_XVMC
AV_CODEC_ID_MPEG2VIDEO_XVMC,
#endif /* FF_API_XVMC */
AV_CODEC_ID_H261,
AV_CODEC_ID_H263,
AV_CODEC_ID_RV10,
AV_CODEC_ID_RV20,
AV_CODEC_ID_MJPEG,
AV_CODEC_ID_MJPEGB,
AV_CODEC_ID_LJPEG,
AV_CODEC_ID_SP5X,
AV_CODEC_ID_JPEGLS,
AV_CODEC_ID_MPEG4,
AV_CODEC_ID_RAWVIDEO,
AV_CODEC_ID_MSMPEG4V1,
AV_CODEC_ID_MSMPEG4V2,
AV_CODEC_ID_MSMPEG4V3,
AV_CODEC_ID_WMV1,
AV_CODEC_ID_WMV2,
AV_CODEC_ID_H263P,
AV_CODEC_ID_H263I,
AV_CODEC_ID_FLV1,
AV_CODEC_ID_SVQ1,
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
SGPlayer 是一款基于 AVPlayer、FFmpeg 的媒体资源播放器框架。支持360°全景视频,VR视频,RTMP、RTSP 等直播流;同时支持 iOS、macOS、tvOS 三个平台。支持播放360°全景视频。支持手势、传感器操控360°全景视频。支持双眼模式,具有畸变校正、色散校正。支持 iOS、macOS、tvOS。支持 H.264 硬件解码(VideoToolBox)。支持 RTMP、RTSP 等直播流。支持后台播放。支持选择音频轨道。支持控制音频输出音量。支持无损视频截图。支持近所有常用媒体格式。支持 Bitcode。极简的事件通知机制
资源推荐
资源详情
资源评论
收起资源包目录
基于 AVPlayer、FFmpeg 的媒体资源播放器框架 支持360°全景视频,VR视频,RTMP、RTSP 等直播流 (250个子文件)
.gitattributes 33B
.gitignore 360B
.gitmodules 106B
avcodec.h 206KB
avformat.h 113KB
avfilter.h 40KB
opt.h 35KB
pixfmt.h 31KB
avio.h 29KB
frame.h 24KB
mem.h 23KB
swresample.h 21KB
intreadwrite.h 18KB
hwcontext.h 16KB
common.h 15KB
pixdesc.h 14KB
avstring.h 14KB
swscale.h 12KB
log.h 11KB
buffer.h 10KB
samplefmt.h 10KB
channel_layout.h 9KB
avutil.h 9KB
imgutils.h 9KB
hash.h 8KB
dict.h 8KB
mathematics.h 8KB
vdpau.h 8KB
version.h 8KB
bprint.h 8KB
parseutils.h 7KB
buffersrc.h 6KB
xvmc.h 6KB
vda.h 6KB
audio_fifo.h 6KB
fifo.h 6KB
rational.h 6KB
error.h 5KB
tree.h 5KB
timecode.h 5KB
buffersink.h 5KB
eval.h 5KB
cpu.h 5KB
version.h 5KB
attributes.h 4KB
SGFFDecoder.h 4KB
vaapi.h 4KB
SGPlayerImp.h 4KB
stereo3d.h 4KB
dirac.h 4KB
videotoolbox.h 4KB
SGPlayerAction.h 4KB
qsv.h 4KB
dv_profile.h 4KB
threadmessage.h 4KB
murmur3.h 3KB
version.h 3KB
downmix_info.h 3KB
display.h 3KB
crc.h 3KB
avfft.h 3KB
hmac.h 3KB
bswap.h 3KB
d3d11va.h 3KB
xtea.h 3KB
mediacodec.h 3KB
mastering_display_metadata.h 3KB
timestamp.h 3KB
version.h 3KB
avdct.h 3KB
file.h 3KB
cast5.h 3KB
hwcontext_vaapi.h 2KB
sha512.h 2KB
SGFFTools.h 2KB
blowfish.h 2KB
sha.h 2KB
dxva2.h 2KB
vorbis_parser.h 2KB
avassert.h 2KB
des.h 2KB
hwcontext_dxva2.h 2KB
SGFFVideoDecoder.h 2KB
base64.h 2KB
SGPlayerDecoder.h 2KB
twofish.h 2KB
ripemd.h 2KB
SGFFFormatContext.h 2KB
camellia.h 2KB
aes_ctr.h 2KB
md5.h 2KB
pixelutils.h 2KB
SGFFPlayer.h 2KB
lzo.h 2KB
tea.h 2KB
SGAudioManager.h 2KB
lfg.h 2KB
SGAVPlayer.h 2KB
version.h 2KB
rc4.h 2KB
共 250 条
- 1
- 2
- 3
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 7361
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功