FFmpeg
Data Structures | Macros | Functions | Variables
mediacodec_wrapper.c File Reference
#include <dlfcn.h>
#include <jni.h>
#include <stdbool.h>
#include <media/NdkMediaFormat.h>
#include <media/NdkMediaCodec.h>
#include <android/native_window_jni.h>
#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "libavutil/avstring.h"
#include "avcodec.h"
#include "ffjni.h"
#include "mediacodec_wrapper.h"

Go to the source code of this file.

Data Structures

struct  JNIAMediaCodecListFields
 
struct  JNIAMediaFormatFields
 
struct  FFAMediaFormatJni
 
struct  JNIAMediaCodecFields
 
struct  FFAMediaCodecJni
 
struct  FFAMediaFormatNdk
 
struct  FFAMediaCodecNdk
 

Macros

#define OFFSET(x)   offsetof(struct JNIAMediaCodecListFields, x)
 
#define OFFSET(x)   offsetof(struct JNIAMediaFormatFields, x)
 
#define OFFSET(x)   offsetof(struct JNIAMediaCodecFields, x)
 
#define JNI_GET_ENV_OR_RETURN(env, log_ctx, ret)
 
#define JNI_GET_ENV_OR_RETURN_VOID(env, log_ctx)
 
#define CREATE_CODEC_BY_NAME   0
 
#define CREATE_DECODER_BY_TYPE   1
 
#define CREATE_ENCODER_BY_TYPE   2
 
#define DECLARE_FF_AMEDIACODEC_CREATE_FUNC(name, method)
 
#define GET_OPTIONAL_SYMBOL(sym)   format->sym = dlsym(format->libmedia, "AMediaFormat_" #sym);
 
#define GET_SYMBOL(sym)
 
#define GET_SYMBOL(sym, required)
 
#define DECLARE_NDK_AMEDIACODEC_CREATE_FUNC(name, method)
 
#define MEDIACODEC_NDK_WRAPPER(method)
 

Functions

int ff_AMediaCodecProfile_getProfileFromAVCodecContext (AVCodecContext *avctx)
 The following API around MediaCodec and MediaFormat is based on the NDK one provided by Google since Android 5.0. More...
 
char * ff_AMediaCodecList_getCodecNameByType (const char *mime, int profile, int encoder, void *log_ctx)
 
static FFAMediaFormatmediaformat_jni_new (void)
 
static FFAMediaFormatmediaformat_jni_newFromObject (void *object)
 
static int mediaformat_jni_delete (FFAMediaFormat *ctx)
 
static char * mediaformat_jni_toString (FFAMediaFormat *ctx)
 
static int mediaformat_jni_getInt32 (FFAMediaFormat *ctx, const char *name, int32_t *out)
 
static int mediaformat_jni_getInt64 (FFAMediaFormat *ctx, const char *name, int64_t *out)
 
static int mediaformat_jni_getFloat (FFAMediaFormat *ctx, const char *name, float *out)
 
static int mediaformat_jni_getBuffer (FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
 
static int mediaformat_jni_getString (FFAMediaFormat *ctx, const char *name, const char **out)
 
static void mediaformat_jni_setInt32 (FFAMediaFormat *ctx, const char *name, int32_t value)
 
static void mediaformat_jni_setInt64 (FFAMediaFormat *ctx, const char *name, int64_t value)
 
static void mediaformat_jni_setFloat (FFAMediaFormat *ctx, const char *name, float value)
 
static void mediaformat_jni_setString (FFAMediaFormat *ctx, const char *name, const char *value)
 
static void mediaformat_jni_setBuffer (FFAMediaFormat *ctx, const char *name, void *data, size_t size)
 
static int codec_init_static_fields (FFAMediaCodecJni *codec)
 
static FFAMediaCodeccodec_create (int method, const char *arg)
 
static int mediacodec_jni_delete (FFAMediaCodec *ctx)
 
static char * mediacodec_jni_getName (FFAMediaCodec *ctx)
 
static int mediacodec_jni_configure (FFAMediaCodec *ctx, const FFAMediaFormat *format_ctx, FFANativeWindow *window, void *crypto, uint32_t flags)
 
static int mediacodec_jni_start (FFAMediaCodec *ctx)
 
static int mediacodec_jni_stop (FFAMediaCodec *ctx)
 
static int mediacodec_jni_flush (FFAMediaCodec *ctx)
 
static int mediacodec_jni_releaseOutputBuffer (FFAMediaCodec *ctx, size_t idx, int render)
 
static int mediacodec_jni_releaseOutputBufferAtTime (FFAMediaCodec *ctx, size_t idx, int64_t timestampNs)
 
static ssize_t mediacodec_jni_dequeueInputBuffer (FFAMediaCodec *ctx, int64_t timeoutUs)
 
static int mediacodec_jni_queueInputBuffer (FFAMediaCodec *ctx, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags)
 
static ssize_t mediacodec_jni_dequeueOutputBuffer (FFAMediaCodec *ctx, FFAMediaCodecBufferInfo *info, int64_t timeoutUs)
 
static uint8_t * mediacodec_jni_getInputBuffer (FFAMediaCodec *ctx, size_t idx, size_t *out_size)
 
static uint8_t * mediacodec_jni_getOutputBuffer (FFAMediaCodec *ctx, size_t idx, size_t *out_size)
 
static FFAMediaFormatmediacodec_jni_getOutputFormat (FFAMediaCodec *ctx)
 
static int mediacodec_jni_infoTryAgainLater (FFAMediaCodec *ctx, ssize_t idx)
 
static int mediacodec_jni_infoOutputBuffersChanged (FFAMediaCodec *ctx, ssize_t idx)
 
static int mediacodec_jni_infoOutputFormatChanged (FFAMediaCodec *ctx, ssize_t idx)
 
static int mediacodec_jni_getBufferFlagCodecConfig (FFAMediaCodec *ctx)
 
static int mediacodec_jni_getBufferFlagEndOfStream (FFAMediaCodec *ctx)
 
static int mediacodec_jni_getBufferFlagKeyFrame (FFAMediaCodec *ctx)
 
static int mediacodec_jni_getConfigureFlagEncode (FFAMediaCodec *ctx)
 
static int mediacodec_jni_cleanOutputBuffers (FFAMediaCodec *ctx)
 
static int mediacodec_jni_signalEndOfInputStream (FFAMediaCodec *ctx)
 
static FFAMediaFormatmediaformat_ndk_create (AMediaFormat *impl)
 
static FFAMediaFormatmediaformat_ndk_new (void)
 
static int mediaformat_ndk_delete (FFAMediaFormat *ctx)
 
static char * mediaformat_ndk_toString (FFAMediaFormat *ctx)
 
static int mediaformat_ndk_getInt32 (FFAMediaFormat *ctx, const char *name, int32_t *out)
 
static int mediaformat_ndk_getInt64 (FFAMediaFormat *ctx, const char *name, int64_t *out)
 
static int mediaformat_ndk_getFloat (FFAMediaFormat *ctx, const char *name, float *out)
 
static int mediaformat_ndk_getBuffer (FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
 
static int mediaformat_ndk_getString (FFAMediaFormat *ctx, const char *name, const char **out)
 
static int mediaformat_ndk_getRect (FFAMediaFormat *ctx, const char *name, int32_t *left, int32_t *top, int32_t *right, int32_t *bottom)
 
static void mediaformat_ndk_setInt32 (FFAMediaFormat *ctx, const char *name, int32_t value)
 
static void mediaformat_ndk_setInt64 (FFAMediaFormat *ctx, const char *name, int64_t value)
 
static void mediaformat_ndk_setFloat (FFAMediaFormat *ctx, const char *name, float value)
 
static void mediaformat_ndk_setString (FFAMediaFormat *ctx, const char *name, const char *value)
 
static void mediaformat_ndk_setBuffer (FFAMediaFormat *ctx, const char *name, void *data, size_t size)
 
static void mediaformat_ndk_setRect (FFAMediaFormat *ctx, const char *name, int32_t left, int32_t top, int32_t right, int32_t bottom)
 
static char * mediacodec_ndk_getName (FFAMediaCodec *ctx)
 
static FFAMediaCodecndk_codec_create (int method, const char *arg)
 
static int mediacodec_ndk_delete (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_configure (FFAMediaCodec *ctx, const FFAMediaFormat *format_ctx, FFANativeWindow *window, void *crypto, uint32_t flags)
 
static uint8_t * mediacodec_ndk_getInputBuffer (FFAMediaCodec *ctx, size_t idx, size_t *out_size)
 
static uint8_t * mediacodec_ndk_getOutputBuffer (FFAMediaCodec *ctx, size_t idx, size_t *out_size)
 
static ssize_t mediacodec_ndk_dequeueInputBuffer (FFAMediaCodec *ctx, int64_t timeoutUs)
 
static int mediacodec_ndk_queueInputBuffer (FFAMediaCodec *ctx, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags)
 
static ssize_t mediacodec_ndk_dequeueOutputBuffer (FFAMediaCodec *ctx, FFAMediaCodecBufferInfo *info, int64_t timeoutUs)
 
static FFAMediaFormatmediacodec_ndk_getOutputFormat (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_releaseOutputBuffer (FFAMediaCodec *ctx, size_t idx, int render)
 
static int mediacodec_ndk_releaseOutputBufferAtTime (FFAMediaCodec *ctx, size_t idx, int64_t timestampNs)
 
static int mediacodec_ndk_infoTryAgainLater (FFAMediaCodec *ctx, ssize_t idx)
 
static int mediacodec_ndk_infoOutputBuffersChanged (FFAMediaCodec *ctx, ssize_t idx)
 
static int mediacodec_ndk_infoOutputFormatChanged (FFAMediaCodec *ctx, ssize_t idx)
 
static int mediacodec_ndk_getBufferFlagCodecConfig (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_getBufferFlagEndOfStream (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_getBufferFlagKeyFrame (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_getConfigureFlagEncode (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_cleanOutputBuffers (FFAMediaCodec *ctx)
 
static int mediacodec_ndk_signalEndOfInputStream (FFAMediaCodec *ctx)
 
FFAMediaFormatff_AMediaFormat_new (int ndk)
 
FFAMediaCodecff_AMediaCodec_createCodecByName (const char *name, int ndk)
 
FFAMediaCodecff_AMediaCodec_createDecoderByType (const char *mime_type, int ndk)
 
FFAMediaCodecff_AMediaCodec_createEncoderByType (const char *mime_type, int ndk)
 
int ff_Build_SDK_INT (AVCodecContext *avctx)
 
enum AVColorRange ff_AMediaFormatColorRange_to_AVColorRange (int color_range)
 Map MediaFormat color range to AVColorRange. More...
 
int ff_AMediaFormatColorRange_from_AVColorRange (enum AVColorRange color_range)
 Map AVColorRange to MediaFormat color range. More...
 
enum AVColorSpace ff_AMediaFormatColorStandard_to_AVColorSpace (int color_standard)
 Map MediaFormat color standard to AVColorSpace. More...
 
int ff_AMediaFormatColorStandard_from_AVColorSpace (enum AVColorSpace color_space)
 Map AVColorSpace to MediaFormat color standard. More...
 
enum AVColorPrimaries ff_AMediaFormatColorStandard_to_AVColorPrimaries (int color_standard)
 Map MediaFormat color standard to AVColorPrimaries. More...
 
enum AVColorTransferCharacteristic ff_AMediaFormatColorTransfer_to_AVColorTransfer (int color_transfer)
 Map MediaFormat color transfer to AVColorTransferCharacteristic. More...
 
int ff_AMediaFormatColorTransfer_from_AVColorTransfer (enum AVColorTransferCharacteristic color_transfer)
 Map AVColorTransferCharacteristic to MediaFormat color transfer. More...
 

Variables

static const struct FFJniField jni_amediacodeclist_mapping []
 
static const struct FFJniField jni_amediaformat_mapping []
 
static const AVClass amediaformat_class
 
static const FFAMediaFormat media_format_jni
 
static const struct FFJniField jni_amediacodec_mapping []
 
static const AVClass amediacodec_class
 
static const FFAMediaCodec media_codec_jni
 
static const FFAMediaFormat media_format_ndk
 
static const FFAMediaCodec media_codec_ndk
 
static const AVClass amediaformat_ndk_class
 
static const AVClass amediacodec_ndk_class
 
struct {
   enum FFAMediaFormatColorRange   mf_range
 
   enum AVColorRange   range
 
color_range_map []
 
struct {
   enum FFAMediaFormatColorStandard   mf_standard
 
   enum AVColorSpace   space
 
color_space_map []
 
struct {
   enum FFAMediaFormatColorStandard   mf_standard
 
   enum AVColorPrimaries   primaries
 
color_primaries_map []
 
struct {
   enum FFAMediaFormatColorTransfer   mf_transfer
 
   enum AVColorTransferCharacteristic   transfer
 
color_transfer_map []
 

Macro Definition Documentation

◆ OFFSET [1/3]

#define OFFSET (   x)    offsetof(struct JNIAMediaCodecListFields, x)

Definition at line 209 of file mediacodec_wrapper.c.

◆ OFFSET [2/3]

#define OFFSET (   x)    offsetof(struct JNIAMediaFormatFields, x)

Definition at line 209 of file mediacodec_wrapper.c.

◆ OFFSET [3/3]

#define OFFSET (   x)    offsetof(struct JNIAMediaCodecFields, x)

Definition at line 209 of file mediacodec_wrapper.c.

◆ JNI_GET_ENV_OR_RETURN

#define JNI_GET_ENV_OR_RETURN (   env,
  log_ctx,
  ret 
)
Value:
do { \
(env) = ff_jni_get_env(log_ctx); \
if (!(env)) { \
return ret; \
} \
} while (0)

Definition at line 295 of file mediacodec_wrapper.c.

◆ JNI_GET_ENV_OR_RETURN_VOID

#define JNI_GET_ENV_OR_RETURN_VOID (   env,
  log_ctx 
)
Value:
do { \
(env) = ff_jni_get_env(log_ctx); \
if (!(env)) { \
return; \
} \
} while (0)

Definition at line 302 of file mediacodec_wrapper.c.

◆ CREATE_CODEC_BY_NAME

#define CREATE_CODEC_BY_NAME   0

Definition at line 1209 of file mediacodec_wrapper.c.

◆ CREATE_DECODER_BY_TYPE

#define CREATE_DECODER_BY_TYPE   1

Definition at line 1210 of file mediacodec_wrapper.c.

◆ CREATE_ENCODER_BY_TYPE

#define CREATE_ENCODER_BY_TYPE   2

Definition at line 1211 of file mediacodec_wrapper.c.

◆ DECLARE_FF_AMEDIACODEC_CREATE_FUNC

#define DECLARE_FF_AMEDIACODEC_CREATE_FUNC (   name,
  method 
)
Value:
static FFAMediaCodec *mediacodec_jni_##name(const char *arg) \
{ \
return codec_create(method, arg); \
} \

Definition at line 1300 of file mediacodec_wrapper.c.

◆ GET_OPTIONAL_SYMBOL

#define GET_OPTIONAL_SYMBOL (   sym)    format->sym = dlsym(format->libmedia, "AMediaFormat_" #sym);

◆ GET_SYMBOL [1/2]

#define GET_SYMBOL (   sym)
Value:
if (!format->sym) \
goto error;

◆ GET_SYMBOL [2/2]

#define GET_SYMBOL (   sym,
  required 
)
Value:
codec->sym = dlsym(codec->libmedia, "AMediaCodec_" #sym); \
if (!codec->sym) { \
av_log(codec, required ? AV_LOG_ERROR : AV_LOG_INFO, \
#sym "() unavailable from %s\n", lib_name); \
if (required) \
goto error; \
}

◆ DECLARE_NDK_AMEDIACODEC_CREATE_FUNC

#define DECLARE_NDK_AMEDIACODEC_CREATE_FUNC (   name,
  method 
)
Value:
static FFAMediaCodec *mediacodec_ndk_##name(const char *arg) \
{ \
return ndk_codec_create(method, arg); \
} \

Definition at line 2184 of file mediacodec_wrapper.c.

◆ MEDIACODEC_NDK_WRAPPER

#define MEDIACODEC_NDK_WRAPPER (   method)
Value:
static int mediacodec_ndk_ ## method(FFAMediaCodec* ctx) \
{ \
FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; \
media_status_t status = codec->method(codec->impl); \
if (status != AMEDIA_OK) { \
av_log(codec, AV_LOG_ERROR, #method " failed, %d\n", status); \
return AVERROR_EXTERNAL; \
} \
\
return 0; \
} \

Definition at line 2274 of file mediacodec_wrapper.c.

Function Documentation

◆ ff_AMediaCodecProfile_getProfileFromAVCodecContext()

int ff_AMediaCodecProfile_getProfileFromAVCodecContext ( AVCodecContext avctx)

The following API around MediaCodec and MediaFormat is based on the NDK one provided by Google since Android 5.0.

Differences from the NDK API:

Buffers returned by ff_AMediaFormat_toString and ff_AMediaFormat_getString are newly allocated buffer and must be freed by the user after use.

The MediaCrypto API is not implemented.

ff_AMediaCodec_infoTryAgainLater, ff_AMediaCodec_infoOutputBuffersChanged, ff_AMediaCodec_infoOutputFormatChanged, ff_AMediaCodec_cleanOutputBuffers ff_AMediaCodec_getName and ff_AMediaCodec_getBufferFlagEndOfStream are not part of the original NDK API and are convenience functions to hide JNI implementation.

The API around MediaCodecList is not part of the NDK (and is lacking as we still need to retrieve the codec name to work around faulty decoders and encoders).

For documentation, please refers to NdkMediaCodec.h NdkMediaFormat.h and http://developer.android.com/reference/android/media/MediaCodec.html.

Definition at line 309 of file mediacodec_wrapper.c.

Referenced by ff_mediacodec_dec_init(), and mediacodec_init().

◆ ff_AMediaCodecList_getCodecNameByType()

char* ff_AMediaCodecList_getCodecNameByType ( const char *  mime,
int  profile,
int  encoder,
void *  log_ctx 
)

Definition at line 469 of file mediacodec_wrapper.c.

Referenced by ff_mediacodec_dec_init().

◆ mediaformat_jni_new()

static FFAMediaFormat* mediaformat_jni_new ( void  )
static

Definition at line 677 of file mediacodec_wrapper.c.

◆ mediaformat_jni_newFromObject()

static FFAMediaFormat* mediaformat_jni_newFromObject ( void *  object)
static

Definition at line 720 of file mediacodec_wrapper.c.

Referenced by mediacodec_jni_getOutputFormat().

◆ mediaformat_jni_delete()

static int mediaformat_jni_delete ( FFAMediaFormat ctx)
static

Definition at line 755 of file mediacodec_wrapper.c.

◆ mediaformat_jni_toString()

static char* mediaformat_jni_toString ( FFAMediaFormat ctx)
static

Definition at line 777 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getInt32()

static int mediaformat_jni_getInt32 ( FFAMediaFormat ctx,
const char *  name,
int32_t out 
)
static

Definition at line 800 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getInt64()

static int mediaformat_jni_getInt64 ( FFAMediaFormat ctx,
const char *  name,
int64_t out 
)
static

Definition at line 837 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getFloat()

static int mediaformat_jni_getFloat ( FFAMediaFormat ctx,
const char *  name,
float out 
)
static

Definition at line 874 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getBuffer()

static int mediaformat_jni_getBuffer ( FFAMediaFormat ctx,
const char *  name,
void **  data,
size_t *  size 
)
static

Definition at line 911 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getString()

static int mediaformat_jni_getString ( FFAMediaFormat ctx,
const char *  name,
const char **  out 
)
static

Definition at line 964 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setInt32()

static void mediaformat_jni_setInt32 ( FFAMediaFormat ctx,
const char *  name,
int32_t  value 
)
static

Definition at line 1009 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setInt64()

static void mediaformat_jni_setInt64 ( FFAMediaFormat ctx,
const char *  name,
int64_t  value 
)
static

Definition at line 1033 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setFloat()

static void mediaformat_jni_setFloat ( FFAMediaFormat ctx,
const char *  name,
float  value 
)
static

Definition at line 1057 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setString()

static void mediaformat_jni_setString ( FFAMediaFormat ctx,
const char *  name,
const char *  value 
)
static

Definition at line 1081 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setBuffer()

static void mediaformat_jni_setBuffer ( FFAMediaFormat ctx,
const char *  name,
void *  data,
size_t  size 
)
static

Definition at line 1112 of file mediacodec_wrapper.c.

◆ codec_init_static_fields()

static int codec_init_static_fields ( FFAMediaCodecJni codec)
static

Definition at line 1155 of file mediacodec_wrapper.c.

Referenced by codec_create().

◆ codec_create()

static FFAMediaCodec* codec_create ( int  method,
const char *  arg 
)
inlinestatic

Definition at line 1213 of file mediacodec_wrapper.c.

◆ mediacodec_jni_delete()

static int mediacodec_jni_delete ( FFAMediaCodec ctx)
static

Definition at line 1310 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getName()

static char* mediacodec_jni_getName ( FFAMediaCodec ctx)
static

Definition at line 1346 of file mediacodec_wrapper.c.

◆ mediacodec_jni_configure()

static int mediacodec_jni_configure ( FFAMediaCodec ctx,
const FFAMediaFormat format_ctx,
FFANativeWindow window,
void *  crypto,
uint32_t  flags 
)
static

Definition at line 1370 of file mediacodec_wrapper.c.

◆ mediacodec_jni_start()

static int mediacodec_jni_start ( FFAMediaCodec ctx)
static

Definition at line 1413 of file mediacodec_wrapper.c.

◆ mediacodec_jni_stop()

static int mediacodec_jni_stop ( FFAMediaCodec ctx)
static

Definition at line 1431 of file mediacodec_wrapper.c.

◆ mediacodec_jni_flush()

static int mediacodec_jni_flush ( FFAMediaCodec ctx)
static

Definition at line 1449 of file mediacodec_wrapper.c.

◆ mediacodec_jni_releaseOutputBuffer()

static int mediacodec_jni_releaseOutputBuffer ( FFAMediaCodec ctx,
size_t  idx,
int  render 
)
static

Definition at line 1467 of file mediacodec_wrapper.c.

◆ mediacodec_jni_releaseOutputBufferAtTime()

static int mediacodec_jni_releaseOutputBufferAtTime ( FFAMediaCodec ctx,
size_t  idx,
int64_t  timestampNs 
)
static

Definition at line 1485 of file mediacodec_wrapper.c.

◆ mediacodec_jni_dequeueInputBuffer()

static ssize_t mediacodec_jni_dequeueInputBuffer ( FFAMediaCodec ctx,
int64_t  timeoutUs 
)
static

Definition at line 1503 of file mediacodec_wrapper.c.

◆ mediacodec_jni_queueInputBuffer()

static int mediacodec_jni_queueInputBuffer ( FFAMediaCodec ctx,
size_t  idx,
off_t  offset,
size_t  size,
uint64_t  time,
uint32_t  flags 
)
static

Definition at line 1521 of file mediacodec_wrapper.c.

◆ mediacodec_jni_dequeueOutputBuffer()

static ssize_t mediacodec_jni_dequeueOutputBuffer ( FFAMediaCodec ctx,
FFAMediaCodecBufferInfo info,
int64_t  timeoutUs 
)
static

Definition at line 1539 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getInputBuffer()

static uint8_t* mediacodec_jni_getInputBuffer ( FFAMediaCodec ctx,
size_t  idx,
size_t *  out_size 
)
static

Definition at line 1575 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getOutputBuffer()

static uint8_t* mediacodec_jni_getOutputBuffer ( FFAMediaCodec ctx,
size_t  idx,
size_t *  out_size 
)
static

Definition at line 1618 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getOutputFormat()

static FFAMediaFormat* mediacodec_jni_getOutputFormat ( FFAMediaCodec ctx)
static

Definition at line 1661 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoTryAgainLater()

static int mediacodec_jni_infoTryAgainLater ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1683 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoOutputBuffersChanged()

static int mediacodec_jni_infoOutputBuffersChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1689 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoOutputFormatChanged()

static int mediacodec_jni_infoOutputFormatChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1695 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagCodecConfig()

static int mediacodec_jni_getBufferFlagCodecConfig ( FFAMediaCodec ctx)
static

Definition at line 1701 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagEndOfStream()

static int mediacodec_jni_getBufferFlagEndOfStream ( FFAMediaCodec ctx)
static

Definition at line 1707 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagKeyFrame()

static int mediacodec_jni_getBufferFlagKeyFrame ( FFAMediaCodec ctx)
static

Definition at line 1713 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getConfigureFlagEncode()

static int mediacodec_jni_getConfigureFlagEncode ( FFAMediaCodec ctx)
static

Definition at line 1719 of file mediacodec_wrapper.c.

◆ mediacodec_jni_cleanOutputBuffers()

static int mediacodec_jni_cleanOutputBuffers ( FFAMediaCodec ctx)
static

Definition at line 1725 of file mediacodec_wrapper.c.

◆ mediacodec_jni_signalEndOfInputStream()

static int mediacodec_jni_signalEndOfInputStream ( FFAMediaCodec ctx)
static

Definition at line 1749 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_create()

static FFAMediaFormat* mediaformat_ndk_create ( AMediaFormat *  impl)
static

Definition at line 1913 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_getOutputFormat(), and mediaformat_ndk_new().

◆ mediaformat_ndk_new()

static FFAMediaFormat* mediaformat_ndk_new ( void  )
static

Definition at line 1973 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_delete()

static int mediaformat_ndk_delete ( FFAMediaFormat ctx)
static

Definition at line 1978 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_toString()

static char* mediaformat_ndk_toString ( FFAMediaFormat ctx)
static

Definition at line 1996 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getInt32()

static int mediaformat_ndk_getInt32 ( FFAMediaFormat ctx,
const char *  name,
int32_t out 
)
static

Definition at line 2003 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getInt64()

static int mediaformat_ndk_getInt64 ( FFAMediaFormat ctx,
const char *  name,
int64_t out 
)
static

Definition at line 2009 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getFloat()

static int mediaformat_ndk_getFloat ( FFAMediaFormat ctx,
const char *  name,
float out 
)
static

Definition at line 2015 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getBuffer()

static int mediaformat_ndk_getBuffer ( FFAMediaFormat ctx,
const char *  name,
void **  data,
size_t *  size 
)
static

Definition at line 2021 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getString()

static int mediaformat_ndk_getString ( FFAMediaFormat ctx,
const char *  name,
const char **  out 
)
static

Definition at line 2027 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getRect()

static int mediaformat_ndk_getRect ( FFAMediaFormat ctx,
const char *  name,
int32_t left,
int32_t top,
int32_t right,
int32_t bottom 
)
static

Definition at line 2038 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setInt32()

static void mediaformat_ndk_setInt32 ( FFAMediaFormat ctx,
const char *  name,
int32_t  value 
)
static

Definition at line 2047 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setInt64()

static void mediaformat_ndk_setInt64 ( FFAMediaFormat ctx,
const char *  name,
int64_t  value 
)
static

Definition at line 2053 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setFloat()

static void mediaformat_ndk_setFloat ( FFAMediaFormat ctx,
const char *  name,
float  value 
)
static

Definition at line 2059 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setString()

static void mediaformat_ndk_setString ( FFAMediaFormat ctx,
const char *  name,
const char *  value 
)
static

Definition at line 2065 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setBuffer()

static void mediaformat_ndk_setBuffer ( FFAMediaFormat ctx,
const char *  name,
void *  data,
size_t  size 
)
static

Definition at line 2071 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setRect()

static void mediaformat_ndk_setRect ( FFAMediaFormat ctx,
const char *  name,
int32_t  left,
int32_t  top,
int32_t  right,
int32_t  bottom 
)
static

Definition at line 2077 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getName()

static char* mediacodec_ndk_getName ( FFAMediaCodec ctx)
static

Definition at line 2088 of file mediacodec_wrapper.c.

◆ ndk_codec_create()

static FFAMediaCodec* ndk_codec_create ( int  method,
const char *  arg 
)
inlinestatic

Definition at line 2108 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_delete()

static int mediacodec_ndk_delete ( FFAMediaCodec ctx)
static

Definition at line 2194 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_configure()

static int mediacodec_ndk_configure ( FFAMediaCodec ctx,
const FFAMediaFormat format_ctx,
FFANativeWindow window,
void *  crypto,
uint32_t  flags 
)
static

Definition at line 2215 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getInputBuffer()

static uint8_t* mediacodec_ndk_getInputBuffer ( FFAMediaCodec ctx,
size_t  idx,
size_t *  out_size 
)
static

Definition at line 2292 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getOutputBuffer()

static uint8_t* mediacodec_ndk_getOutputBuffer ( FFAMediaCodec ctx,
size_t  idx,
size_t *  out_size 
)
static

Definition at line 2298 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_dequeueInputBuffer()

static ssize_t mediacodec_ndk_dequeueInputBuffer ( FFAMediaCodec ctx,
int64_t  timeoutUs 
)
static

Definition at line 2304 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_queueInputBuffer()

static int mediacodec_ndk_queueInputBuffer ( FFAMediaCodec ctx,
size_t  idx,
off_t  offset,
size_t  size,
uint64_t  time,
uint32_t  flags 
)
static

Definition at line 2310 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_dequeueOutputBuffer()

static ssize_t mediacodec_ndk_dequeueOutputBuffer ( FFAMediaCodec ctx,
FFAMediaCodecBufferInfo info,
int64_t  timeoutUs 
)
static

Definition at line 2318 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getOutputFormat()

static FFAMediaFormat* mediacodec_ndk_getOutputFormat ( FFAMediaCodec ctx)
static

Definition at line 2333 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_releaseOutputBuffer()

static int mediacodec_ndk_releaseOutputBuffer ( FFAMediaCodec ctx,
size_t  idx,
int  render 
)
static

Definition at line 2343 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_releaseOutputBufferAtTime()

static int mediacodec_ndk_releaseOutputBufferAtTime ( FFAMediaCodec ctx,
size_t  idx,
int64_t  timestampNs 
)
static

Definition at line 2357 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoTryAgainLater()

static int mediacodec_ndk_infoTryAgainLater ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2371 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoOutputBuffersChanged()

static int mediacodec_ndk_infoOutputBuffersChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2376 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoOutputFormatChanged()

static int mediacodec_ndk_infoOutputFormatChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2381 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagCodecConfig()

static int mediacodec_ndk_getBufferFlagCodecConfig ( FFAMediaCodec ctx)
static

Definition at line 2386 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagEndOfStream()

static int mediacodec_ndk_getBufferFlagEndOfStream ( FFAMediaCodec ctx)
static

Definition at line 2391 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagKeyFrame()

static int mediacodec_ndk_getBufferFlagKeyFrame ( FFAMediaCodec ctx)
static

Definition at line 2396 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getConfigureFlagEncode()

static int mediacodec_ndk_getConfigureFlagEncode ( FFAMediaCodec ctx)
static

Definition at line 2401 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_cleanOutputBuffers()

static int mediacodec_ndk_cleanOutputBuffers ( FFAMediaCodec ctx)
static

Definition at line 2406 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_signalEndOfInputStream()

static int mediacodec_ndk_signalEndOfInputStream ( FFAMediaCodec ctx)
static

Definition at line 2411 of file mediacodec_wrapper.c.

◆ ff_AMediaFormat_new()

FFAMediaFormat* ff_AMediaFormat_new ( int  ndk)

Definition at line 2494 of file mediacodec_wrapper.c.

Referenced by mediacodec_decode_init(), and mediacodec_init().

◆ ff_AMediaCodec_createCodecByName()

FFAMediaCodec* ff_AMediaCodec_createCodecByName ( const char *  name,
int  ndk 
)

Definition at line 2501 of file mediacodec_wrapper.c.

Referenced by ff_mediacodec_dec_init(), and mediacodec_init().

◆ ff_AMediaCodec_createDecoderByType()

FFAMediaCodec* ff_AMediaCodec_createDecoderByType ( const char *  mime_type,
int  ndk 
)

Definition at line 2508 of file mediacodec_wrapper.c.

Referenced by ff_mediacodec_dec_init().

◆ ff_AMediaCodec_createEncoderByType()

FFAMediaCodec* ff_AMediaCodec_createEncoderByType ( const char *  mime_type,
int  ndk 
)

Definition at line 2515 of file mediacodec_wrapper.c.

Referenced by mediacodec_init().

◆ ff_Build_SDK_INT()

int ff_Build_SDK_INT ( AVCodecContext avctx)

Definition at line 2522 of file mediacodec_wrapper.c.

Referenced by mediacodec_decode_init().

◆ ff_AMediaFormatColorRange_to_AVColorRange()

enum AVColorRange ff_AMediaFormatColorRange_to_AVColorRange ( int  color_range)

Map MediaFormat color range to AVColorRange.

return AVCOL_RANGE_UNSPECIFIED when failed.

Definition at line 2593 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_format().

◆ ff_AMediaFormatColorRange_from_AVColorRange()

int ff_AMediaFormatColorRange_from_AVColorRange ( enum AVColorRange  color_range)

Map AVColorRange to MediaFormat color range.

return COLOR_RANGE_UNSPECIFIED when failed.

Definition at line 2602 of file mediacodec_wrapper.c.

Referenced by mediacodec_init().

◆ ff_AMediaFormatColorStandard_to_AVColorSpace()

enum AVColorSpace ff_AMediaFormatColorStandard_to_AVColorSpace ( int  color_standard)

Map MediaFormat color standard to AVColorSpace.

return AVCOL_SPC_UNSPECIFIED when failed.

Definition at line 2610 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_format().

◆ ff_AMediaFormatColorStandard_from_AVColorSpace()

int ff_AMediaFormatColorStandard_from_AVColorSpace ( enum AVColorSpace  color_space)

Map AVColorSpace to MediaFormat color standard.

return COLOR_STANDARD_UNSPECIFIED when failed.

Definition at line 2619 of file mediacodec_wrapper.c.

Referenced by mediacodec_init().

◆ ff_AMediaFormatColorStandard_to_AVColorPrimaries()

enum AVColorPrimaries ff_AMediaFormatColorStandard_to_AVColorPrimaries ( int  color_standard)

Map MediaFormat color standard to AVColorPrimaries.

return AVCOL_PRI_UNSPECIFIED when failed.

Definition at line 2628 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_format().

◆ ff_AMediaFormatColorTransfer_to_AVColorTransfer()

enum AVColorTransferCharacteristic ff_AMediaFormatColorTransfer_to_AVColorTransfer ( int  color_transfer)

Map MediaFormat color transfer to AVColorTransferCharacteristic.

return AVCOL_TRC_UNSPECIFIED when failed.

Definition at line 2638 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_format().

◆ ff_AMediaFormatColorTransfer_from_AVColorTransfer()

int ff_AMediaFormatColorTransfer_from_AVColorTransfer ( enum AVColorTransferCharacteristic  color_transfer)

Map AVColorTransferCharacteristic to MediaFormat color transfer.

return COLOR_TRANSFER_UNSPECIFIED when failed.

Definition at line 2647 of file mediacodec_wrapper.c.

Referenced by mediacodec_init().

Variable Documentation

◆ jni_amediacodeclist_mapping

const struct FFJniField jni_amediacodeclist_mapping[]
static
Initial value:
= {
{ "android/media/MediaCodecList", NULL, NULL, FF_JNI_CLASS, OFFSET(mediacodec_list_class), 1 },
{ "android/media/MediaCodecList", "<init>", "(I)V", FF_JNI_METHOD, OFFSET(init_id), 0 },
{ "android/media/MediaCodecList", "findDecoderForFormat", "(Landroid/media/MediaFormat;)Ljava/lang/String;", FF_JNI_METHOD, OFFSET(find_decoder_for_format_id), 0 },
{ "android/media/MediaCodecList", "getCodecCount", "()I", FF_JNI_STATIC_METHOD, OFFSET(get_codec_count_id), 1 },
{ "android/media/MediaCodecList", "getCodecInfoAt", "(I)Landroid/media/MediaCodecInfo;", FF_JNI_STATIC_METHOD, OFFSET(get_codec_info_at_id), 1 },
{ "android/media/MediaCodecInfo", NULL, NULL, FF_JNI_CLASS, OFFSET(mediacodec_info_class), 1 },
{ "android/media/MediaCodecInfo", "getName", "()Ljava/lang/String;", FF_JNI_METHOD, OFFSET(get_name_id), 1 },
{ "android/media/MediaCodecInfo", "getCapabilitiesForType", "(Ljava/lang/String;)Landroid/media/MediaCodecInfo$CodecCapabilities;", FF_JNI_METHOD, OFFSET(get_codec_capabilities_id), 1 },
{ "android/media/MediaCodecInfo", "getSupportedTypes", "()[Ljava/lang/String;", FF_JNI_METHOD, OFFSET(get_supported_types_id), 1 },
{ "android/media/MediaCodecInfo", "isEncoder", "()Z", FF_JNI_METHOD, OFFSET(is_encoder_id), 1 },
{ "android/media/MediaCodecInfo", "isSoftwareOnly", "()Z", FF_JNI_METHOD, OFFSET(is_software_only_id), 0 },
{ "android/media/MediaCodecInfo$CodecCapabilities", NULL, NULL, FF_JNI_CLASS, OFFSET(codec_capabilities_class), 1 },
{ "android/media/MediaCodecInfo$CodecCapabilities", "colorFormats", "[I", FF_JNI_FIELD, OFFSET(color_formats_id), 1 },
{ "android/media/MediaCodecInfo$CodecCapabilities", "profileLevels", "[Landroid/media/MediaCodecInfo$CodecProfileLevel;", FF_JNI_FIELD, OFFSET(profile_levels_id), 1 },
{ "android/media/MediaCodecInfo$CodecProfileLevel", NULL, NULL, FF_JNI_CLASS, OFFSET(codec_profile_level_class), 1 },
{ "android/media/MediaCodecInfo$CodecProfileLevel", "profile", "I", FF_JNI_FIELD, OFFSET(profile_id), 1 },
{ "android/media/MediaCodecInfo$CodecProfileLevel", "level", "I", FF_JNI_FIELD, OFFSET(level_id), 1 },
{ NULL }
}

Definition at line 64 of file mediacodec_wrapper.c.

Referenced by ff_AMediaCodecList_getCodecNameByType().

◆ jni_amediaformat_mapping

const struct FFJniField jni_amediaformat_mapping[]
static
Initial value:
= {
{ "android/media/MediaFormat", NULL, NULL, FF_JNI_CLASS, OFFSET(mediaformat_class), 1 },
{ "android/media/MediaFormat", "<init>", "()V", FF_JNI_METHOD, OFFSET(init_id), 1 },
{ "android/media/MediaFormat", "containsKey", "(Ljava/lang/String;)Z", FF_JNI_METHOD, OFFSET(contains_key_id), 1 },
{ "android/media/MediaFormat", "getInteger", "(Ljava/lang/String;)I", FF_JNI_METHOD, OFFSET(get_integer_id), 1 },
{ "android/media/MediaFormat", "getLong", "(Ljava/lang/String;)J", FF_JNI_METHOD, OFFSET(get_long_id), 1 },
{ "android/media/MediaFormat", "getFloat", "(Ljava/lang/String;)F", FF_JNI_METHOD, OFFSET(get_float_id), 1 },
{ "android/media/MediaFormat", "getByteBuffer", "(Ljava/lang/String;)Ljava/nio/ByteBuffer;", FF_JNI_METHOD, OFFSET(get_bytebuffer_id), 1 },
{ "android/media/MediaFormat", "getString", "(Ljava/lang/String;)Ljava/lang/String;", FF_JNI_METHOD, OFFSET(get_string_id), 1 },
{ "android/media/MediaFormat", "setInteger", "(Ljava/lang/String;I)V", FF_JNI_METHOD, OFFSET(set_integer_id), 1 },
{ "android/media/MediaFormat", "setLong", "(Ljava/lang/String;J)V", FF_JNI_METHOD, OFFSET(set_long_id), 1 },
{ "android/media/MediaFormat", "setFloat", "(Ljava/lang/String;F)V", FF_JNI_METHOD, OFFSET(set_float_id), 1 },
{ "android/media/MediaFormat", "setByteBuffer", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)V", FF_JNI_METHOD, OFFSET(set_bytebuffer_id), 1 },
{ "android/media/MediaFormat", "setString", "(Ljava/lang/String;Ljava/lang/String;)V", FF_JNI_METHOD, OFFSET(set_string_id), 1 },
{ "android/media/MediaFormat", "toString", "()Ljava/lang/String;", FF_JNI_METHOD, OFFSET(to_string_id), 1 },
{ NULL }
}

Definition at line 116 of file mediacodec_wrapper.c.

Referenced by ff_AMediaCodecList_getCodecNameByType(), mediaformat_jni_delete(), mediaformat_jni_new(), and mediaformat_jni_newFromObject().

◆ amediaformat_class

const AVClass amediaformat_class
static
Initial value:
= {
.class_name = "amediaformat",
.item_name = av_default_item_name,
}

Definition at line 141 of file mediacodec_wrapper.c.

◆ media_format_jni

static const FFAMediaFormat media_format_jni
static

◆ jni_amediacodec_mapping

const struct FFJniField jni_amediacodec_mapping[]
static

Definition at line 210 of file mediacodec_wrapper.c.

Referenced by codec_create(), and mediacodec_jni_delete().

◆ amediacodec_class

const AVClass amediacodec_class
static
Initial value:
= {
.class_name = "amediacodec",
.item_name = av_default_item_name,
}

Definition at line 263 of file mediacodec_wrapper.c.

◆ media_codec_jni

static const FFAMediaCodec media_codec_jni
static

◆ media_format_ndk

static const FFAMediaFormat media_format_ndk
static

◆ media_codec_ndk

static const FFAMediaCodec media_codec_ndk
static

◆ amediaformat_ndk_class

const AVClass amediaformat_ndk_class
static
Initial value:
= {
.class_name = "amediaformat_ndk",
.item_name = av_default_item_name,
}

Definition at line 1901 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_configure(), and mediaformat_ndk_delete().

◆ amediacodec_ndk_class

const AVClass amediacodec_ndk_class
static
Initial value:
= {
.class_name = "amediacodec_ndk",
.item_name = av_default_item_name,
}

Definition at line 1907 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_delete().

◆ mf_range

enum FFAMediaFormatColorRange mf_range

Definition at line 2556 of file mediacodec_wrapper.c.

Referenced by ff_AMediaFormatColorRange_to_AVColorRange().

◆ range

enum AVColorRange range

Definition at line 2557 of file mediacodec_wrapper.c.

Referenced by ac_normalize(), adpcm_compress_trellis(), aptx_process_subband(), arith2_get_number(), arith2_get_prob(), arith2_get_scaled_value(), arith2_rescale_interval(), arith_get_bits(), arith_get_number(), arith_get_prob(), av_color_range_name(), av_image_fill_black(), av_opt_freep_ranges(), av_opt_query_ranges_default(), aw_pulse_set2(), block_matching_multi(), calc_input_response(), calculate_mask_curve(), check_image_fill_black(), compute_kernel(), config_input(), configure_video_device(), decode_audio_block(), decode_channel(), dirac_get_arith_bit(), draw_legend(), dshow_cycle_formats(), encode_q_branch(), extend_code(), fade_gain(), ff_all_color_ranges(), ff_AMediaFormatColorRange_from_AVColorRange(), ff_bgmc_decode(), ff_draw_init2(), ff_fix_long_mvs(), ff_fix_long_p_mvs(), ff_get_best_fcode(), ff_h263_encode_motion(), ffat_init_encoder(), filter_channels(), find_image_range(), floor_encode(), floor_fit(), format_init(), g722_encode_trellis(), generate_scaling(), get_cabac_bypass(), get_cabac_bypass_sign(), get_cv_pixel_format(), get_Fragment(), get_limits(), get_te0_golomb(), get_te_golomb(), mclms_update(), msmpeg4v2_encode_motion(), opus_rc_tell_frac(), output_gain(), parse_fmtp(), plot_channel_log(), process_callback(), put_rac(), range_map(), set_te_golomb(), step_collect_psy_metrics(), sws_printVec2(), update_input_arguments(), vorbis_floor1_decode(), vt_format_from_pixfmt(), x8_setup_spatial_compensation(), and x8_setup_spatial_predictor().

◆ color_range_map

struct { ... } color_range_map[]

◆ mf_standard

enum FFAMediaFormatColorStandard mf_standard

◆ space

enum AVColorSpace space

◆ color_space_map

struct { ... } color_space_map[]

◆ primaries

enum AVColorPrimaries primaries

◆ color_primaries_map

struct { ... } color_primaries_map[]

◆ mf_transfer

enum FFAMediaFormatColorTransfer mf_transfer

◆ transfer

◆ color_transfer_map

struct { ... } color_transfer_map[]
error
static void error(const char *err)
Definition: target_bsf_fuzzer.c:31
mediaformat_ndk_setRect
static void mediaformat_ndk_setRect(FFAMediaFormat *ctx, const char *name, int32_t left, int32_t top, int32_t right, int32_t bottom)
Definition: mediacodec_wrapper.c:2077
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
mediaformat_ndk_getString
static int mediaformat_ndk_getString(FFAMediaFormat *ctx, const char *name, const char **out)
Definition: mediacodec_wrapper.c:2027
mediaformat_jni_setInt32
static void mediaformat_jni_setInt32(FFAMediaFormat *ctx, const char *name, int32_t value)
Definition: mediacodec_wrapper.c:1009
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:589
mediaformat_jni_delete
static int mediaformat_jni_delete(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:755
mediaformat_jni_new
static FFAMediaFormat * mediaformat_jni_new(void)
Definition: mediacodec_wrapper.c:677
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:683
mediaformat_jni_setBuffer
static void mediaformat_jni_setBuffer(FFAMediaFormat *ctx, const char *name, void *data, size_t size)
Definition: mediacodec_wrapper.c:1112
COLOR_TRANSFER_LINEAR
@ COLOR_TRANSFER_LINEAR
Definition: mediacodec_wrapper.h:364
mediaformat_jni_getString
static int mediaformat_jni_getString(FFAMediaFormat *ctx, const char *name, const char **out)
Definition: mediacodec_wrapper.c:964
mediaformat_jni_getInt64
static int mediaformat_jni_getInt64(FFAMediaFormat *ctx, const char *name, int64_t *out)
Definition: mediacodec_wrapper.c:837
FFAMediaCodecNdk
Definition: mediacodec_wrapper.c:1854
mediaformat_jni_getInt32
static int mediaformat_jni_getInt32(FFAMediaFormat *ctx, const char *name, int32_t *out)
Definition: mediacodec_wrapper.c:800
AVCOL_SPC_BT470BG
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
Definition: pixfmt.h:615
mediaformat_ndk_getInt32
static int mediaformat_ndk_getInt32(FFAMediaFormat *ctx, const char *name, int32_t *out)
Definition: mediacodec_wrapper.c:2003
mediaformat_jni_setString
static void mediaformat_jni_setString(FFAMediaFormat *ctx, const char *name, const char *value)
Definition: mediacodec_wrapper.c:1081
FF_JNI_CLASS
@ FF_JNI_CLASS
Definition: ffjni.h:91
COLOR_TRANSFER_HLG
@ COLOR_TRANSFER_HLG
Definition: mediacodec_wrapper.h:367
FFAMediaFormat::delete
int(* delete)(FFAMediaFormat *)
Definition: mediacodec_wrapper.h:67
mediaformat_ndk_getInt64
static int mediaformat_ndk_getInt64(FFAMediaFormat *ctx, const char *name, int64_t *out)
Definition: mediacodec_wrapper.c:2009
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
mediaformat_jni_setInt64
static void mediaformat_jni_setInt64(FFAMediaFormat *ctx, const char *name, int64_t value)
Definition: mediacodec_wrapper.c:1033
format
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
AVCOL_SPC_SMPTE170M
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
Definition: pixfmt.h:616
ctx
AVFormatContext * ctx
Definition: movenc.c:48
mediaformat_ndk_getFloat
static int mediaformat_ndk_getFloat(FFAMediaFormat *ctx, const char *name, float *out)
Definition: mediacodec_wrapper.c:2015
AVCOL_PRI_BT470BG
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:562
arg
const char * arg
Definition: jacosubdec.c:67
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:563
COLOR_RANGE_LIMITED
@ COLOR_RANGE_LIMITED
Definition: mediacodec_wrapper.h:351
mediaformat_ndk_setBuffer
static void mediaformat_ndk_setBuffer(FFAMediaFormat *ctx, const char *name, void *data, size_t size)
Definition: mediacodec_wrapper.c:2071
if
if(ret)
Definition: filter_design.txt:179
mediaformat_ndk_setInt32
static void mediaformat_ndk_setInt32(FFAMediaFormat *ctx, const char *name, int32_t value)
Definition: mediacodec_wrapper.c:2047
mediaformat_ndk_getRect
static int mediaformat_ndk_getRect(FFAMediaFormat *ctx, const char *name, int32_t *left, int32_t *top, int32_t *right, int32_t *bottom)
Definition: mediacodec_wrapper.c:2038
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
FF_JNI_METHOD
@ FF_JNI_METHOD
Definition: ffjni.h:94
NULL
#define NULL
Definition: coverity.c:32
GET_OPTIONAL_SYMBOL
#define GET_OPTIONAL_SYMBOL(sym)
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:557
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
COLOR_STANDARD_BT709
@ COLOR_STANDARD_BT709
Definition: mediacodec_wrapper.h:356
mediaformat_ndk_getBuffer
static int mediaformat_ndk_getBuffer(FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
Definition: mediacodec_wrapper.c:2021
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:566
mediaformat_jni_getFloat
static int mediaformat_jni_getFloat(FFAMediaFormat *ctx, const char *name, float *out)
Definition: mediacodec_wrapper.c:874
AVCOL_TRC_SMPTEST2084
@ AVCOL_TRC_SMPTEST2084
Definition: pixfmt.h:598
COLOR_TRANSFER_SDR_VIDEO
@ COLOR_TRANSFER_SDR_VIDEO
Definition: mediacodec_wrapper.h:365
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
COLOR_RANGE_FULL
@ COLOR_RANGE_FULL
Definition: mediacodec_wrapper.h:350
amediaformat_ndk_class
static const AVClass amediaformat_ndk_class
Definition: mediacodec_wrapper.c:1901
COLOR_TRANSFER_ST2084
@ COLOR_TRANSFER_ST2084
Definition: mediacodec_wrapper.h:366
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:191
mediaformat_ndk_new
static FFAMediaFormat * mediaformat_ndk_new(void)
Definition: mediacodec_wrapper.c:1973
FF_JNI_FIELD
@ FF_JNI_FIELD
Definition: ffjni.h:92
OFFSET
#define OFFSET(x)
Definition: mediacodec_wrapper.c:209
COLOR_STANDARD_BT2020
@ COLOR_STANDARD_BT2020
Definition: mediacodec_wrapper.h:359
AVCOL_SPC_BT2020_NCL
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:620
FFAMediaCodec
Definition: mediacodec_wrapper.h:181
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:666
COLOR_STANDARD_BT601_PAL
@ COLOR_STANDARD_BT601_PAL
Definition: mediacodec_wrapper.h:357
mediaformat_ndk_setFloat
static void mediaformat_ndk_setFloat(FFAMediaFormat *ctx, const char *name, float value)
Definition: mediacodec_wrapper.c:2059
ret
ret
Definition: filter_design.txt:187
AVCOL_TRC_ARIB_STD_B67
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: pixfmt.h:601
status
ov_status_e status
Definition: dnn_backend_openvino.c:120
AVCOL_TRC_SMPTE170M
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition: pixfmt.h:587
ff_jni_get_env
JNIEnv * ff_jni_get_env(void *log_ctx)
Definition: ffjni.c:53
amediaformat_class
static const AVClass amediaformat_class
Definition: mediacodec_wrapper.c:141
mediaformat_ndk_toString
static char * mediaformat_ndk_toString(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:1996
COLOR_STANDARD_BT601_NTSC
@ COLOR_STANDARD_BT601_NTSC
Definition: mediacodec_wrapper.h:358
mediaformat_jni_getBuffer
static int mediaformat_jni_getBuffer(FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
Definition: mediacodec_wrapper.c:911
mediaformat_ndk_setInt64
static void mediaformat_ndk_setInt64(FFAMediaFormat *ctx, const char *name, int64_t value)
Definition: mediacodec_wrapper.c:2053
FF_JNI_STATIC_METHOD
@ FF_JNI_STATIC_METHOD
Definition: ffjni.h:95
ndk_codec_create
static FFAMediaCodec * ndk_codec_create(int method, const char *arg)
Definition: mediacodec_wrapper.c:2108
AVCOL_SPC_BT709
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
Definition: pixfmt.h:611
mediaformat_jni_toString
static char * mediaformat_jni_toString(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:777
mediaformat_ndk_setString
static void mediaformat_ndk_setString(FFAMediaFormat *ctx, const char *name, const char *value)
Definition: mediacodec_wrapper.c:2065
mediaformat_ndk_delete
static int mediaformat_ndk_delete(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:1978
codec_create
static FFAMediaCodec * codec_create(int method, const char *arg)
Definition: mediacodec_wrapper.c:1213
mediaformat_jni_setFloat
static void mediaformat_jni_setFloat(FFAMediaFormat *ctx, const char *name, float value)
Definition: mediacodec_wrapper.c:1057