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 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 int mediacodec_jni_setAsyncNotifyCallback (FFAMediaCodec *codec, const FFAMediaCodecOnAsyncNotifyCallback *callback, void *userdata)
 
static int media_status_to_error (media_status_t status)
 
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)
 
static void mediacodec_ndk_onInputAvailable (AMediaCodec *impl, void *userdata, int32_t index)
 
static void mediacodec_ndk_onOutputAvailable (AMediaCodec *impl, void *userdata, int32_t index, AMediaCodecBufferInfo *buffer_info)
 
static void mediacodec_ndk_onFormatChanged (AMediaCodec *impl, void *userdata, AMediaFormat *format)
 
static void mediacodec_ndk_onError (AMediaCodec *impl, void *userdata, media_status_t status, int32_t actionCode, const char *detail)
 
static int mediacodec_ndk_setAsyncNotifyCallback (FFAMediaCodec *ctx, const FFAMediaCodecOnAsyncNotifyCallback *callback, void *userdata)
 
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 1210 of file mediacodec_wrapper.c.

◆ CREATE_DECODER_BY_TYPE

#define CREATE_DECODER_BY_TYPE   1

Definition at line 1211 of file mediacodec_wrapper.c.

◆ CREATE_ENCODER_BY_TYPE

#define CREATE_ENCODER_BY_TYPE   2

Definition at line 1212 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 1301 of file mediacodec_wrapper.c.

◆ GET_OPTIONAL_SYMBOL

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

◆ GET_SYMBOL

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

◆ 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 2132 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 = AMediaCodec_ ## 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 2222 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 mediacodec_dec_get_video_codec(), and mediacodec_init().

◆ ff_AMediaCodecList_getCodecNameByType()

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

Definition at line 470 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_get_video_codec().

◆ mediaformat_jni_new()

static FFAMediaFormat* mediaformat_jni_new ( void  )
static

Definition at line 678 of file mediacodec_wrapper.c.

◆ mediaformat_jni_newFromObject()

static FFAMediaFormat* mediaformat_jni_newFromObject ( void *  object)
static

Definition at line 721 of file mediacodec_wrapper.c.

Referenced by mediacodec_jni_getOutputFormat().

◆ mediaformat_jni_delete()

static int mediaformat_jni_delete ( FFAMediaFormat ctx)
static

Definition at line 756 of file mediacodec_wrapper.c.

◆ mediaformat_jni_toString()

static char* mediaformat_jni_toString ( FFAMediaFormat ctx)
static

Definition at line 778 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 801 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 838 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getFloat()

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

Definition at line 875 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 912 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 965 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 1010 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 1034 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setFloat()

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

Definition at line 1058 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 1082 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 1113 of file mediacodec_wrapper.c.

◆ codec_init_static_fields()

static int codec_init_static_fields ( FFAMediaCodecJni codec)
static

Definition at line 1156 of file mediacodec_wrapper.c.

Referenced by codec_create().

◆ codec_create()

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

Definition at line 1214 of file mediacodec_wrapper.c.

◆ mediacodec_jni_delete()

static int mediacodec_jni_delete ( FFAMediaCodec ctx)
static

Definition at line 1311 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getName()

static char* mediacodec_jni_getName ( FFAMediaCodec ctx)
static

Definition at line 1347 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 1371 of file mediacodec_wrapper.c.

◆ mediacodec_jni_start()

static int mediacodec_jni_start ( FFAMediaCodec ctx)
static

Definition at line 1414 of file mediacodec_wrapper.c.

◆ mediacodec_jni_stop()

static int mediacodec_jni_stop ( FFAMediaCodec ctx)
static

Definition at line 1432 of file mediacodec_wrapper.c.

◆ mediacodec_jni_flush()

static int mediacodec_jni_flush ( FFAMediaCodec ctx)
static

Definition at line 1450 of file mediacodec_wrapper.c.

◆ mediacodec_jni_releaseOutputBuffer()

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

Definition at line 1468 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 1486 of file mediacodec_wrapper.c.

◆ mediacodec_jni_dequeueInputBuffer()

static ssize_t mediacodec_jni_dequeueInputBuffer ( FFAMediaCodec ctx,
int64_t  timeoutUs 
)
static

Definition at line 1504 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 1522 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 1540 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 1576 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 1619 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getOutputFormat()

static FFAMediaFormat* mediacodec_jni_getOutputFormat ( FFAMediaCodec ctx)
static

Definition at line 1662 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoTryAgainLater()

static int mediacodec_jni_infoTryAgainLater ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1684 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoOutputBuffersChanged()

static int mediacodec_jni_infoOutputBuffersChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1690 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoOutputFormatChanged()

static int mediacodec_jni_infoOutputFormatChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1696 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagCodecConfig()

static int mediacodec_jni_getBufferFlagCodecConfig ( FFAMediaCodec ctx)
static

Definition at line 1702 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagEndOfStream()

static int mediacodec_jni_getBufferFlagEndOfStream ( FFAMediaCodec ctx)
static

Definition at line 1708 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagKeyFrame()

static int mediacodec_jni_getBufferFlagKeyFrame ( FFAMediaCodec ctx)
static

Definition at line 1714 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getConfigureFlagEncode()

static int mediacodec_jni_getConfigureFlagEncode ( FFAMediaCodec ctx)
static

Definition at line 1720 of file mediacodec_wrapper.c.

◆ mediacodec_jni_cleanOutputBuffers()

static int mediacodec_jni_cleanOutputBuffers ( FFAMediaCodec ctx)
static

Definition at line 1726 of file mediacodec_wrapper.c.

◆ mediacodec_jni_signalEndOfInputStream()

static int mediacodec_jni_signalEndOfInputStream ( FFAMediaCodec ctx)
static

Definition at line 1750 of file mediacodec_wrapper.c.

◆ mediacodec_jni_setAsyncNotifyCallback()

static int mediacodec_jni_setAsyncNotifyCallback ( FFAMediaCodec codec,
const FFAMediaCodecOnAsyncNotifyCallback callback,
void *  userdata 
)
static

Definition at line 1765 of file mediacodec_wrapper.c.

◆ media_status_to_error()

static int media_status_to_error ( media_status_t  status)
static

Definition at line 1883 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_onError().

◆ mediaformat_ndk_create()

static FFAMediaFormat* mediaformat_ndk_create ( AMediaFormat *  impl)
static

◆ mediaformat_ndk_new()

static FFAMediaFormat* mediaformat_ndk_new ( void  )
static

Definition at line 1946 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_delete()

static int mediaformat_ndk_delete ( FFAMediaFormat ctx)
static

Definition at line 1951 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_toString()

static char* mediaformat_ndk_toString ( FFAMediaFormat ctx)
static

Definition at line 1969 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 1976 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 1982 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getFloat()

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

Definition at line 1988 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 1994 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 2000 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 2011 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 2020 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 2026 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setFloat()

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

Definition at line 2032 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 2038 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 2044 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 2050 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getName()

static char* mediacodec_ndk_getName ( FFAMediaCodec ctx)
static

Definition at line 2061 of file mediacodec_wrapper.c.

◆ ndk_codec_create()

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

Definition at line 2081 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_delete()

static int mediacodec_ndk_delete ( FFAMediaCodec ctx)
static

Definition at line 2142 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 2163 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 2240 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 2246 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_dequeueInputBuffer()

static ssize_t mediacodec_ndk_dequeueInputBuffer ( FFAMediaCodec ctx,
int64_t  timeoutUs 
)
static

Definition at line 2252 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 2258 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 2266 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getOutputFormat()

static FFAMediaFormat* mediacodec_ndk_getOutputFormat ( FFAMediaCodec ctx)
static

Definition at line 2281 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_releaseOutputBuffer()

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

Definition at line 2291 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 2305 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoTryAgainLater()

static int mediacodec_ndk_infoTryAgainLater ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2319 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoOutputBuffersChanged()

static int mediacodec_ndk_infoOutputBuffersChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2324 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoOutputFormatChanged()

static int mediacodec_ndk_infoOutputFormatChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2329 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagCodecConfig()

static int mediacodec_ndk_getBufferFlagCodecConfig ( FFAMediaCodec ctx)
static

Definition at line 2334 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagEndOfStream()

static int mediacodec_ndk_getBufferFlagEndOfStream ( FFAMediaCodec ctx)
static

Definition at line 2339 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagKeyFrame()

static int mediacodec_ndk_getBufferFlagKeyFrame ( FFAMediaCodec ctx)
static

Definition at line 2344 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getConfigureFlagEncode()

static int mediacodec_ndk_getConfigureFlagEncode ( FFAMediaCodec ctx)
static

Definition at line 2349 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_cleanOutputBuffers()

static int mediacodec_ndk_cleanOutputBuffers ( FFAMediaCodec ctx)
static

Definition at line 2354 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_signalEndOfInputStream()

static int mediacodec_ndk_signalEndOfInputStream ( FFAMediaCodec ctx)
static

Definition at line 2359 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_onInputAvailable()

static void mediacodec_ndk_onInputAvailable ( AMediaCodec *  impl,
void *  userdata,
int32_t  index 
)
static

Definition at line 2379 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_setAsyncNotifyCallback().

◆ mediacodec_ndk_onOutputAvailable()

static void mediacodec_ndk_onOutputAvailable ( AMediaCodec *  impl,
void *  userdata,
int32_t  index,
AMediaCodecBufferInfo *  buffer_info 
)
static

Definition at line 2387 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_setAsyncNotifyCallback().

◆ mediacodec_ndk_onFormatChanged()

static void mediacodec_ndk_onFormatChanged ( AMediaCodec *  impl,
void *  userdata,
AMediaFormat *  format 
)
static

Definition at line 2404 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_setAsyncNotifyCallback().

◆ mediacodec_ndk_onError()

static void mediacodec_ndk_onError ( AMediaCodec *  impl,
void *  userdata,
media_status_t  status,
int32_t  actionCode,
const char *  detail 
)
static

Definition at line 2417 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_setAsyncNotifyCallback().

◆ mediacodec_ndk_setAsyncNotifyCallback()

static int mediacodec_ndk_setAsyncNotifyCallback ( FFAMediaCodec ctx,
const FFAMediaCodecOnAsyncNotifyCallback callback,
void *  userdata 
)
static

Definition at line 2429 of file mediacodec_wrapper.c.

◆ ff_AMediaFormat_new()

FFAMediaFormat* ff_AMediaFormat_new ( int  ndk)

Definition at line 2531 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 2538 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_get_video_codec(), and mediacodec_init().

◆ ff_AMediaCodec_createDecoderByType()

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

◆ ff_AMediaCodec_createEncoderByType()

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

Definition at line 2552 of file mediacodec_wrapper.c.

Referenced by mediacodec_init().

◆ ff_Build_SDK_INT()

int ff_Build_SDK_INT ( AVCodecContext avctx)

Definition at line 2559 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 2630 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_video_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 2639 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 2647 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_video_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 2656 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 2665 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_video_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 2675 of file mediacodec_wrapper.c.

Referenced by mediacodec_dec_parse_video_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 2684 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 1871 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 1877 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_delete().

◆ mf_range

enum FFAMediaFormatColorRange mf_range

Definition at line 2593 of file mediacodec_wrapper.c.

Referenced by ff_AMediaFormatColorRange_to_AVColorRange().

◆ range

enum AVColorRange range

Definition at line 2594 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(), map_av_range(), map_range(), 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(), test_range(), 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[]
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:2050
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:2000
mediaformat_jni_setInt32
static void mediaformat_jni_setInt32(FFAMediaFormat *ctx, const char *name, int32_t value)
Definition: mediacodec_wrapper.c:1010
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:620
mediaformat_jni_delete
static int mediaformat_jni_delete(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:756
mediaformat_jni_new
static FFAMediaFormat * mediaformat_jni_new(void)
Definition: mediacodec_wrapper.c:678
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:717
mediaformat_jni_setBuffer
static void mediaformat_jni_setBuffer(FFAMediaFormat *ctx, const char *name, void *data, size_t size)
Definition: mediacodec_wrapper.c:1113
COLOR_TRANSFER_LINEAR
@ COLOR_TRANSFER_LINEAR
Definition: mediacodec_wrapper.h:392
mediaformat_jni_getString
static int mediaformat_jni_getString(FFAMediaFormat *ctx, const char *name, const char **out)
Definition: mediacodec_wrapper.c:965
mediaformat_jni_getInt64
static int mediaformat_jni_getInt64(FFAMediaFormat *ctx, const char *name, int64_t *out)
Definition: mediacodec_wrapper.c:838
FFAMediaCodecNdk
Definition: mediacodec_wrapper.c:1847
mediaformat_jni_getInt32
static int mediaformat_jni_getInt32(FFAMediaFormat *ctx, const char *name, int32_t *out)
Definition: mediacodec_wrapper.c:801
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:646
mediaformat_ndk_getInt32
static int mediaformat_ndk_getInt32(FFAMediaFormat *ctx, const char *name, int32_t *out)
Definition: mediacodec_wrapper.c:1976
mediaformat_jni_setString
static void mediaformat_jni_setString(FFAMediaFormat *ctx, const char *name, const char *value)
Definition: mediacodec_wrapper.c:1082
FF_JNI_CLASS
@ FF_JNI_CLASS
Definition: ffjni.h:91
COLOR_TRANSFER_HLG
@ COLOR_TRANSFER_HLG
Definition: mediacodec_wrapper.h:395
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:1982
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
mediaformat_jni_setInt64
static void mediaformat_jni_setInt64(FFAMediaFormat *ctx, const char *name, int64_t value)
Definition: mediacodec_wrapper.c:1034
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:647
ctx
AVFormatContext * ctx
Definition: movenc.c:49
mediaformat_ndk_getFloat
static int mediaformat_ndk_getFloat(FFAMediaFormat *ctx, const char *name, float *out)
Definition: mediacodec_wrapper.c:1988
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:593
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:594
COLOR_RANGE_LIMITED
@ COLOR_RANGE_LIMITED
Definition: mediacodec_wrapper.h:379
mediaformat_ndk_setBuffer
static void mediaformat_ndk_setBuffer(FFAMediaFormat *ctx, const char *name, void *data, size_t size)
Definition: mediacodec_wrapper.c:2044
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:2020
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:2011
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
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:588
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:384
mediaformat_ndk_getBuffer
static int mediaformat_ndk_getBuffer(FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
Definition: mediacodec_wrapper.c:1994
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:597
mediaformat_jni_getFloat
static int mediaformat_jni_getFloat(FFAMediaFormat *ctx, const char *name, float *out)
Definition: mediacodec_wrapper.c:875
AVCOL_TRC_SMPTEST2084
@ AVCOL_TRC_SMPTEST2084
Definition: pixfmt.h:629
COLOR_TRANSFER_SDR_VIDEO
@ COLOR_TRANSFER_SDR_VIDEO
Definition: mediacodec_wrapper.h:393
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:378
amediaformat_ndk_class
static const AVClass amediaformat_ndk_class
Definition: mediacodec_wrapper.c:1871
COLOR_TRANSFER_ST2084
@ COLOR_TRANSFER_ST2084
Definition: mediacodec_wrapper.h:394
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:220
mediaformat_ndk_new
static FFAMediaFormat * mediaformat_ndk_new(void)
Definition: mediacodec_wrapper.c:1946
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:387
AVCOL_SPC_BT2020_NCL
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:651
FFAMediaCodec
Definition: mediacodec_wrapper.h:197
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:700
COLOR_STANDARD_BT601_PAL
@ COLOR_STANDARD_BT601_PAL
Definition: mediacodec_wrapper.h:385
mediaformat_ndk_setFloat
static void mediaformat_ndk_setFloat(FFAMediaFormat *ctx, const char *name, float value)
Definition: mediacodec_wrapper.c:2032
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:632
status
ov_status_e status
Definition: dnn_backend_openvino.c:100
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:618
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:1969
COLOR_STANDARD_BT601_NTSC
@ COLOR_STANDARD_BT601_NTSC
Definition: mediacodec_wrapper.h:386
mediaformat_jni_getBuffer
static int mediaformat_jni_getBuffer(FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
Definition: mediacodec_wrapper.c:912
mediaformat_ndk_setInt64
static void mediaformat_ndk_setInt64(FFAMediaFormat *ctx, const char *name, int64_t value)
Definition: mediacodec_wrapper.c:2026
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:2081
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:642
mediaformat_jni_toString
static char * mediaformat_jni_toString(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:778
mediaformat_ndk_setString
static void mediaformat_ndk_setString(FFAMediaFormat *ctx, const char *name, const char *value)
Definition: mediacodec_wrapper.c:2038
mediaformat_ndk_delete
static int mediaformat_ndk_delete(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:1951
codec_create
static FFAMediaCodec * codec_create(int method, const char *arg)
Definition: mediacodec_wrapper.c:1214
mediaformat_jni_setFloat
static void mediaformat_jni_setFloat(FFAMediaFormat *ctx, const char *name, float value)
Definition: mediacodec_wrapper.c:1058