/*
* 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/hwcontext.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 encoder 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.
*
* In theory, sending input can result in EAGAIN - this should happen only if
* not all output was received. You can use this to structure alternative decode
* or encode loops other than the one suggested above. For example, you could
* try sending new input on each iteration, and try to receive output if that
* returns EAGAIN.
*
* 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, or
* at least will not fail with AVERROR(EAGAIN). 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 (unless it is rejected with AVERROR(EAGAIN) - then
* no data was read from the packet).
* 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. All codecs support the new API.
*
* A codec is not allowed to return AVERROR(EAGAIN) for both sending and receiving. This
* would be an invalid state, which could put the codec user into an endless
* loop. The API has no concept of time either: it cannot happen that trying to
* do avcodec_send_packet() results in AVERROR(EAGAIN), but a repeated call 1 second
* later accepts the packet (with no other receive/flush API calls involved).
* The API is a strict state machine, and the passage of time is not supposed
* to influence it. Some timing-dependent behavior might still be deemed
* acceptable in certain cases. But it must never result in both send/receive
* returning EAGAIN at the same time at any point. It must also absolutely be
* avoided that the current state is "unstable" and can "flip-flop" between
* the send/receive APIs allowing progress. For example, it's not allowed that
* the codec randomly decides that it actually wants to consume a packet now
* instead of returning a frame, a
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
C++音视频开发从放弃到入门(基于FFmpeg+OpenCV)开发对应的SDK (1148个子文件)
libavutil.dll.a 357KB
libavformat.dll.a 176KB
libavcodec.dll.a 160KB
libavfilter.dll.a 47KB
libswscale.dll.a 23KB
libswresample.dll.a 16KB
libavdevice.dll.a 13KB
libpostproc.dll.a 7KB
run.bat 200B
run - 副本.bat 59B
OpenCVModules-release.cmake 25KB
OpenCVModules-debug.cmake 24KB
OpenCVModules.cmake 14KB
OpenCVConfig.cmake 14KB
OpenCVConfig.cmake 13KB
OpenCVModules-release.cmake 10KB
OpenCVModules-debug.cmake 10KB
OpenCVModules.cmake 7KB
OpenCVConfig-version.cmake 433B
OpenCVConfig-version.cmake 433B
avutil-56.def 13KB
avcodec-58.def 6KB
avformat-58.def 4KB
avfilter-7.def 2KB
swscale-5.def 756B
avdevice-58.def 544B
swresample-3.def 473B
postproc-55.def 223B
avcodec-58.dll 68.64MB
opencv_imgproc340d.dll 54.4MB
opencv_imgproc340.dll 40.9MB
avcodec-58.dll 32.01MB
opencv_imgproc340d.dll 26.14MB
opencv_imgproc340.dll 19.45MB
opencv_core340d.dll 18.69MB
opencv_ffmpeg340_64.dll 16.99MB
opencv_ffmpeg340.dll 16.08MB
opencv_core340.dll 12.7MB
avformat-58.dll 11.75MB
opencv_core340d.dll 11.68MB
avfilter-7.dll 11.61MB
opencv_dnn340d.dll 11.25MB
avformat-58.dll 9.33MB
opencv_dnn340d.dll 8.27MB
opencv_core340.dll 8.09MB
avfilter-7.dll 6.93MB
opencv_imgcodecs340d.dll 5.88MB
opencv_dnn340.dll 4.84MB
opencv_imgcodecs340d.dll 4.62MB
opencv_dnn340.dll 4.11MB
opencv_calib3d340d.dll 4.05MB
opencv_xfeatures2d340d.dll 3.8MB
opencv_tracking340d.dll 3.23MB
opencv_imgcodecs340.dll 3MB
opencv_xfeatures2d340.dll 2.79MB
opencv_calib3d340d.dll 2.79MB
opencv_imgcodecs340.dll 2.69MB
opencv_stitching340d.dll 2.4MB
opencv_features2d340d.dll 2.39MB
opencv_ximgproc340d.dll 2.27MB
opencv_tracking340.dll 2.16MB
opencv_photo340d.dll 1.94MB
opencv_calib3d340.dll 1.89MB
opencv_stitching340d.dll 1.8MB
opencv_features2d340d.dll 1.79MB
opencv_ml340d.dll 1.74MB
avdevice-58.dll 1.74MB
opencv_objdetect340d.dll 1.57MB
opencv_flann340d.dll 1.52MB
opencv_calib3d340.dll 1.51MB
opencv_face340d.dll 1.44MB
opencv_text340d.dll 1.34MB
avdevice-58.dll 1.33MB
opencv_videostab340d.dll 1.33MB
opencv_photo340d.dll 1.31MB
opencv_rgbd340d.dll 1.29MB
opencv_ml340d.dll 1.26MB
opencv_ximgproc340.dll 1.26MB
opencv_objdetect340d.dll 1.17MB
opencv_datasets340d.dll 1.15MB
opencv_ccalib340d.dll 1.15MB
opencv_xphoto340d.dll 1.14MB
opencv_stitching340.dll 1.12MB
opencv_flann340d.dll 1.1MB
opencv_photo340.dll 1.05MB
opencv_video340d.dll 1.03MB
opencv_stitching340.dll 1.01MB
opencv_videostab340d.dll 1019KB
opencv_aruco340d.dll 1000KB
opencv_features2d340.dll 1000KB
opencv_surface_matching340d.dll 989KB
opencv_optflow340d.dll 972KB
opencv_ml340.dll 891KB
opencv_photo340.dll 863KB
opencv_features2d340.dll 859KB
avutil-56.dll 821KB
opencv_line_descriptor340d.dll 812KB
opencv_face340.dll 800KB
opencv_shape340d.dll 795KB
opencv_video340d.dll 768KB
共 1148 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
西部秋虫
- 粉丝: 929
- 资源: 36
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功