FFmpeg
|
#include <stdint.h>
#include <stdlib.h>
#include <oapv/oapv.h>
#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "apv.h"
#include "codec_internal.h"
#include "encode.h"
#include "packet_internal.h"
#include "profiles.h"
Go to the source code of this file.
Data Structures | |
struct | ApvEncContext |
The structure stores all the states associated with the instance of APV encoder. More... | |
Macros | |
#define | MAX_BS_BUF (128 * 1024 * 1024) |
#define | MAX_NUM_FRMS (1) |
#define | FRM_IDX (0) |
#define | MAX_NUM_CC (OAPV_MAX_CC) |
#define | OFFSET(x) offsetof(ApvEncContext, x) |
#define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Functions | |
static int | apv_imgb_release (oapv_imgb_t *imgb) |
static int | apv_imgb_addref (oapv_imgb_t *imgb) |
static int | apv_imgb_getref (oapv_imgb_t *imgb) |
static int | get_color_format (enum AVPixelFormat pix_fmt) |
Convert FFmpeg pixel format (AVPixelFormat) into APV pre-defined color format. More... | |
static oapv_imgb_t * | apv_imgb_create (AVCodecContext *avctx) |
static int | get_conf (AVCodecContext *avctx, oapve_cdesc_t *cdsc) |
The function returns a pointer to the object of the oapve_cdesc_t type. More... | |
static av_cold int | liboapve_init (AVCodecContext *avctx) |
Initialize APV codec Create an encoder instance and allocate all the needed resources. More... | |
static int | liboapve_encode (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet) |
Encode raw data frame into APV packet. More... | |
static av_cold int | liboapve_close (AVCodecContext *avctx) |
Destroy the encoder and release all the allocated resources. More... | |
Variables | |
static enum AVPixelFormat | supported_pixel_formats [] |
static const AVOption | liboapv_options [] |
static const AVClass | liboapve_class |
static const FFCodecDefault | liboapve_defaults [] |
const FFCodec | ff_liboapv_encoder |
#define MAX_BS_BUF (128 * 1024 * 1024) |
Definition at line 44 of file liboapvenc.c.
#define MAX_NUM_FRMS (1) |
Definition at line 45 of file liboapvenc.c.
#define FRM_IDX (0) |
Definition at line 46 of file liboapvenc.c.
#define MAX_NUM_CC (OAPV_MAX_CC) |
Definition at line 47 of file liboapvenc.c.
#define OFFSET | ( | x | ) | offsetof(ApvEncContext, x) |
Definition at line 429 of file liboapvenc.c.
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Definition at line 430 of file liboapvenc.c.
|
static |
Definition at line 72 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
static |
Definition at line 84 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
static |
Definition at line 90 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
inlinestatic |
Convert FFmpeg pixel format (AVPixelFormat) into APV pre-defined color format.
Definition at line 100 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
static |
Definition at line 115 of file liboapvenc.c.
Referenced by liboapve_init().
|
static |
The function returns a pointer to the object of the oapve_cdesc_t type.
oapve_cdesc_t contains all encoder parameters that should be initialized before the encoder is used.
The field values of the oapve_cdesc_t structure are populated based on:
The order of processing input data and populating the apve_cdsc structure 1) first, the fields of the AVCodecContext structure corresponding to the provided input options are processed, (i.e -pix_fmt yuv422p -s:v 1920x1080 -r 30 -profile:v 0) 2) then apve-specific options added as AVOption to the apv AVCodec implementation (i.e -preset 0)
Keep in mind that, there are options that can be set in different ways. In this case, please follow the above-mentioned order of processing. The most recent assignments overwrite the previous values.
[in] | avctx | codec context (AVCodecContext) |
[out] | cdsc | contains all APV encoder encoder parameters that should be initialized before the encoder is use |
Definition at line 188 of file liboapvenc.c.
Referenced by liboapve_init().
|
static |
Initialize APV codec Create an encoder instance and allocate all the needed resources.
avctx | codec context |
Definition at line 271 of file liboapvenc.c.
|
static |
Encode raw data frame into APV packet.
[in] | avctx | codec context |
[out] | avpkt | output AVPacket containing encoded data |
[in] | frame | AVFrame containing the raw data to be encoded |
[out] | got_packet | encoder sets to 0 or 1 to indicate that a non-empty packet was returned in pkt |
Definition at line 337 of file liboapvenc.c.
|
static |
Destroy the encoder and release all the allocated resources.
avctx | codec context |
Definition at line 400 of file liboapvenc.c.
|
static |
Definition at line 432 of file liboapvenc.c.
|
static |
Definition at line 437 of file liboapvenc.c.
|
static |
Definition at line 451 of file liboapvenc.c.
|
static |
Definition at line 458 of file liboapvenc.c.
const FFCodec ff_liboapv_encoder |
Definition at line 463 of file liboapvenc.c.