FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
mediacodecdec.c File Reference
#include <stdint.h>
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/pixfmt.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "decode.h"
#include "h264_parse.h"
#include "hevc_parse.h"
#include "hwaccel.h"
#include "internal.h"
#include "mediacodec_wrapper.h"
#include "mediacodecdec_common.h"

Go to the source code of this file.

Data Structures

struct  MediaCodecH264DecContext
 

Macros

#define OFFSET(x)   offsetof(MediaCodecH264DecContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 
#define DECLARE_MEDIACODEC_VCLASS(short_name)
 
#define DECLARE_MEDIACODEC_VDEC(short_name, full_name, codec_id, bsf)
 

Functions

static av_cold int mediacodec_decode_close (AVCodecContext *avctx)
 
static av_cold int mediacodec_decode_init (AVCodecContext *avctx)
 
static int mediacodec_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 
static void mediacodec_decode_flush (AVCodecContext *avctx)
 

Variables

static const
AVCodecHWConfigInternal
mediacodec_hw_configs []
 
static const AVOption ff_mediacodec_vdec_options []
 

Macro Definition Documentation

#define OFFSET (   x)    offsetof(MediaCodecH264DecContext, x)

Definition at line 496 of file mediacodecdec.c.

Definition at line 497 of file mediacodecdec.c.

#define DECLARE_MEDIACODEC_VCLASS (   short_name)
Value:
static const AVClass ff_##short_name##_mediacodec_dec_class = { \
.class_name = #short_name "_mediacodec", \
.item_name = av_default_item_name, \
.version = LIBAVUTIL_VERSION_INT, \
};
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
Describe the class of an AVClass context structure.
Definition: log.h:67
static const AVOption ff_mediacodec_vdec_options[]

Definition at line 504 of file mediacodecdec.c.

#define DECLARE_MEDIACODEC_VDEC (   short_name,
  full_name,
  codec_id,
  bsf 
)
Value:
AVCodec ff_##short_name##_mediacodec_decoder = { \
.name = #short_name "_mediacodec", \
.long_name = NULL_IF_CONFIG_SMALL(full_name " Android MediaCodec decoder"), \
.type = AVMEDIA_TYPE_VIDEO, \
.id = codec_id, \
.priv_class = &ff_##short_name##_mediacodec_dec_class, \
.priv_data_size = sizeof(MediaCodecH264DecContext), \
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \
.bsfs = bsf, \
.hw_configs = mediacodec_hw_configs, \
.wrapper_name = "mediacodec", \
}; \
static const AVCodecHWConfigInternal * mediacodec_hw_configs[]
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: avcodec.h:1064
static av_cold int mediacodec_decode_close(AVCodecContext *avctx)
Definition: mediacodecdec.c:55
static CopyRet receive_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
Definition: crystalhd.c:560
static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:992
static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
enum AVCodecID codec_id
Definition: vaapi_decode.c:364
#define DECLARE_MEDIACODEC_VCLASS(short_name)
static void mediacodec_decode_flush(AVCodecContext *avctx)
#define FF_CODEC_CAP_SETS_PKT_DTS
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
Definition: internal.h:55
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
Definition: avcodec.h:1049

Definition at line 512 of file mediacodecdec.c.

Function Documentation

static av_cold int mediacodec_decode_close ( AVCodecContext avctx)
static

Definition at line 55 of file mediacodecdec.c.

Referenced by mediacodec_decode_init().

static av_cold int mediacodec_decode_init ( AVCodecContext avctx)
static

Definition at line 288 of file mediacodecdec.c.

static int mediacodec_receive_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 406 of file mediacodecdec.c.

static void mediacodec_decode_flush ( AVCodecContext avctx)
static

Definition at line 474 of file mediacodecdec.c.

Variable Documentation

const AVCodecHWConfigInternal* mediacodec_hw_configs[]
static
Initial value:
= {
.public = {
},
.hwaccel = NULL,
},
}
#define NULL
Definition: coverity.c:32
The codec supports this format via the hw_device_ctx interface.
Definition: avcodec.h:3369
hardware decoding through MediaCodec
Definition: pixfmt.h:293
The codec supports this format by some ad-hoc method.
Definition: avcodec.h:3394

Definition at line 483 of file mediacodecdec.c.

const AVOption ff_mediacodec_vdec_options[]
static
Initial value:
= {
{ "delay_flush", "Delay flush until hw output buffers are returned to the decoder",
OFFSET(delay_flush), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, VD },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
#define VD

Definition at line 498 of file mediacodecdec.c.