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 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

◆ 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 289 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 296 of file mediacodec_wrapper.c.

◆ CREATE_CODEC_BY_NAME

#define CREATE_CODEC_BY_NAME   0

Definition at line 1273 of file mediacodec_wrapper.c.

◆ CREATE_DECODER_BY_TYPE

#define CREATE_DECODER_BY_TYPE   1

Definition at line 1274 of file mediacodec_wrapper.c.

◆ CREATE_ENCODER_BY_TYPE

#define CREATE_ENCODER_BY_TYPE   2

Definition at line 1275 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 1377 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 2273 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 2363 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 303 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 463 of file mediacodec_wrapper.c.

Referenced by ff_mediacodec_dec_init().

◆ mediaformat_jni_new()

static FFAMediaFormat* mediaformat_jni_new ( void  )
static

Definition at line 705 of file mediacodec_wrapper.c.

◆ mediaformat_jni_newFromObject()

static FFAMediaFormat* mediaformat_jni_newFromObject ( void *  object)
static

Definition at line 750 of file mediacodec_wrapper.c.

Referenced by mediacodec_jni_getOutputFormat().

◆ mediaformat_jni_delete()

static int mediaformat_jni_delete ( FFAMediaFormat ctx)
static

Definition at line 785 of file mediacodec_wrapper.c.

◆ mediaformat_jni_toString()

static char* mediaformat_jni_toString ( FFAMediaFormat ctx)
static

Definition at line 807 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 832 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 871 of file mediacodec_wrapper.c.

◆ mediaformat_jni_getFloat()

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

Definition at line 910 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 949 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 1007 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 1057 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 1083 of file mediacodec_wrapper.c.

◆ mediaformat_jni_setFloat()

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

Definition at line 1109 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 1135 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 1171 of file mediacodec_wrapper.c.

◆ codec_init_static_fields()

static int codec_init_static_fields ( FFAMediaCodecJni codec)
static

Definition at line 1219 of file mediacodec_wrapper.c.

Referenced by codec_create().

◆ codec_create()

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

Definition at line 1277 of file mediacodec_wrapper.c.

◆ mediacodec_jni_delete()

static int mediacodec_jni_delete ( FFAMediaCodec ctx)
static

Definition at line 1387 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getName()

static char* mediacodec_jni_getName ( FFAMediaCodec ctx)
static

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

◆ mediacodec_jni_start()

static int mediacodec_jni_start ( FFAMediaCodec ctx)
static

Definition at line 1490 of file mediacodec_wrapper.c.

◆ mediacodec_jni_stop()

static int mediacodec_jni_stop ( FFAMediaCodec ctx)
static

Definition at line 1508 of file mediacodec_wrapper.c.

◆ mediacodec_jni_flush()

static int mediacodec_jni_flush ( FFAMediaCodec ctx)
static

Definition at line 1526 of file mediacodec_wrapper.c.

◆ mediacodec_jni_releaseOutputBuffer()

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

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

◆ mediacodec_jni_dequeueInputBuffer()

static ssize_t mediacodec_jni_dequeueInputBuffer ( FFAMediaCodec ctx,
int64_t  timeoutUs 
)
static

Definition at line 1580 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 1598 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 1616 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 1652 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 1700 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getOutputFormat()

static FFAMediaFormat* mediacodec_jni_getOutputFormat ( FFAMediaCodec ctx)
static

Definition at line 1748 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoTryAgainLater()

static int mediacodec_jni_infoTryAgainLater ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1772 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoOutputBuffersChanged()

static int mediacodec_jni_infoOutputBuffersChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1778 of file mediacodec_wrapper.c.

◆ mediacodec_jni_infoOutputFormatChanged()

static int mediacodec_jni_infoOutputFormatChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 1784 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagCodecConfig()

static int mediacodec_jni_getBufferFlagCodecConfig ( FFAMediaCodec ctx)
static

Definition at line 1790 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagEndOfStream()

static int mediacodec_jni_getBufferFlagEndOfStream ( FFAMediaCodec ctx)
static

Definition at line 1796 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getBufferFlagKeyFrame()

static int mediacodec_jni_getBufferFlagKeyFrame ( FFAMediaCodec ctx)
static

Definition at line 1802 of file mediacodec_wrapper.c.

◆ mediacodec_jni_getConfigureFlagEncode()

static int mediacodec_jni_getConfigureFlagEncode ( FFAMediaCodec ctx)
static

Definition at line 1808 of file mediacodec_wrapper.c.

◆ mediacodec_jni_cleanOutputBuffers()

static int mediacodec_jni_cleanOutputBuffers ( FFAMediaCodec ctx)
static

Definition at line 1814 of file mediacodec_wrapper.c.

◆ mediacodec_jni_signalEndOfInputStream()

static int mediacodec_jni_signalEndOfInputStream ( FFAMediaCodec ctx)
static

Definition at line 1838 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_create()

static FFAMediaFormat* mediaformat_ndk_create ( AMediaFormat *  impl)
static

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

◆ mediaformat_ndk_delete()

static int mediaformat_ndk_delete ( FFAMediaFormat ctx)
static

Definition at line 2067 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_toString()

static char* mediaformat_ndk_toString ( FFAMediaFormat ctx)
static

Definition at line 2085 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 2092 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 2098 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_getFloat()

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

Definition at line 2104 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 2110 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 2116 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 2127 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 2136 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 2142 of file mediacodec_wrapper.c.

◆ mediaformat_ndk_setFloat()

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

Definition at line 2148 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 2154 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 2160 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 2166 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getName()

static char* mediacodec_ndk_getName ( FFAMediaCodec ctx)
static

Definition at line 2177 of file mediacodec_wrapper.c.

◆ ndk_codec_create()

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

Definition at line 2197 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_delete()

static int mediacodec_ndk_delete ( FFAMediaCodec ctx)
static

Definition at line 2283 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 2304 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 2381 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 2387 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_dequeueInputBuffer()

static ssize_t mediacodec_ndk_dequeueInputBuffer ( FFAMediaCodec ctx,
int64_t  timeoutUs 
)
static

Definition at line 2393 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 2399 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 2407 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getOutputFormat()

static FFAMediaFormat* mediacodec_ndk_getOutputFormat ( FFAMediaCodec ctx)
static

Definition at line 2422 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_releaseOutputBuffer()

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

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

◆ mediacodec_ndk_infoTryAgainLater()

static int mediacodec_ndk_infoTryAgainLater ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2460 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoOutputBuffersChanged()

static int mediacodec_ndk_infoOutputBuffersChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2465 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_infoOutputFormatChanged()

static int mediacodec_ndk_infoOutputFormatChanged ( FFAMediaCodec ctx,
ssize_t  idx 
)
static

Definition at line 2470 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagCodecConfig()

static int mediacodec_ndk_getBufferFlagCodecConfig ( FFAMediaCodec ctx)
static

Definition at line 2475 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagEndOfStream()

static int mediacodec_ndk_getBufferFlagEndOfStream ( FFAMediaCodec ctx)
static

Definition at line 2480 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getBufferFlagKeyFrame()

static int mediacodec_ndk_getBufferFlagKeyFrame ( FFAMediaCodec ctx)
static

Definition at line 2485 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_getConfigureFlagEncode()

static int mediacodec_ndk_getConfigureFlagEncode ( FFAMediaCodec ctx)
static

Definition at line 2490 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_cleanOutputBuffers()

static int mediacodec_ndk_cleanOutputBuffers ( FFAMediaCodec ctx)
static

Definition at line 2495 of file mediacodec_wrapper.c.

◆ mediacodec_ndk_signalEndOfInputStream()

static int mediacodec_ndk_signalEndOfInputStream ( FFAMediaCodec ctx)
static

Definition at line 2500 of file mediacodec_wrapper.c.

◆ ff_AMediaFormat_new()

FFAMediaFormat* ff_AMediaFormat_new ( int  ndk)

Definition at line 2583 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 2590 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 2597 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 2604 of file mediacodec_wrapper.c.

Referenced by mediacodec_init().

◆ ff_Build_SDK_INT()

int ff_Build_SDK_INT ( AVCodecContext avctx)

Definition at line 2611 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 2682 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 2691 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 2699 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 2708 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 2717 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 2727 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 2736 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, 0x42, 1 },
{ "android/media/MediaCodecList", "<init>", "(I)V", FF_JNI_METHOD, 0x42, 0 },
{ "android/media/MediaCodecList", "findDecoderForFormat", "(Landroid/media/MediaFormat;)Ljava/lang/String;", FF_JNI_METHOD, 0x42, 0 },
{ "android/media/MediaCodecList", "getCodecCount", "()I", FF_JNI_STATIC_METHOD, 0x42, 1 },
{ "android/media/MediaCodecList", "getCodecInfoAt", "(I)Landroid/media/MediaCodecInfo;", FF_JNI_STATIC_METHOD, 0x42, 1 },
{ "android/media/MediaCodecInfo", NULL, NULL, FF_JNI_CLASS, 0x42, 1 },
{ "android/media/MediaCodecInfo", "getName", "()Ljava/lang/String;", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaCodecInfo", "getCapabilitiesForType", "(Ljava/lang/String;)Landroid/media/MediaCodecInfo$CodecCapabilities;", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaCodecInfo", "getSupportedTypes", "()[Ljava/lang/String;", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaCodecInfo", "isEncoder", "()Z", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaCodecInfo", "isSoftwareOnly", "()Z", FF_JNI_METHOD, 0x42, 0 },
{ "android/media/MediaCodecInfo$CodecCapabilities", NULL, NULL, FF_JNI_CLASS, 0x42, 1 },
{ "android/media/MediaCodecInfo$CodecCapabilities", "colorFormats", "[I", FF_JNI_FIELD, 0x42, 1 },
{ "android/media/MediaCodecInfo$CodecCapabilities", "profileLevels", "[Landroid/media/MediaCodecInfo$CodecProfileLevel;", FF_JNI_FIELD, 0x42, 1 },
{ "android/media/MediaCodecInfo$CodecProfileLevel", NULL, NULL, FF_JNI_CLASS, 0x42, 1 },
{ "android/media/MediaCodecInfo$CodecProfileLevel", "profile", "I", FF_JNI_FIELD, 0x42, 1 },
{ "android/media/MediaCodecInfo$CodecProfileLevel", "level", "I", FF_JNI_FIELD, 0x42, 1 },
{ NULL }
}

Definition at line 63 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, 0x42, 1 },
{ "android/media/MediaFormat", "<init>", "()V", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "containsKey", "(Ljava/lang/String;)Z", FF_JNI_METHOD,0x42, 1 },
{ "android/media/MediaFormat", "getInteger", "(Ljava/lang/String;)I", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "getLong", "(Ljava/lang/String;)J", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "getFloat", "(Ljava/lang/String;)F", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "getByteBuffer", "(Ljava/lang/String;)Ljava/nio/ByteBuffer;", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "getString", "(Ljava/lang/String;)Ljava/lang/String;", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "setInteger", "(Ljava/lang/String;I)V", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "setLong", "(Ljava/lang/String;J)V", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "setFloat", "(Ljava/lang/String;F)V", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "setByteBuffer", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)V", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "setString", "(Ljava/lang/String;Ljava/lang/String;)V", FF_JNI_METHOD, 0x42, 1 },
{ "android/media/MediaFormat", "toString", "()Ljava/lang/String;", FF_JNI_METHOD, 0x42, 1 },
{ NULL }
}

Definition at line 113 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 137 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 205 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 257 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 1990 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 1996 of file mediacodec_wrapper.c.

Referenced by mediacodec_ndk_delete().

◆ mf_range

enum FFAMediaFormatColorRange mf_range

Definition at line 2645 of file mediacodec_wrapper.c.

Referenced by ff_AMediaFormatColorRange_to_AVColorRange().

◆ range

enum AVColorRange range

◆ 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:2166
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:2116
mediaformat_jni_setInt32
static void mediaformat_jni_setInt32(FFAMediaFormat *ctx, const char *name, int32_t value)
Definition: mediacodec_wrapper.c:1057
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:579
mediaformat_jni_delete
static int mediaformat_jni_delete(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:785
mediaformat_jni_new
static FFAMediaFormat * mediaformat_jni_new(void)
Definition: mediacodec_wrapper.c:705
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:673
mediaformat_jni_setBuffer
static void mediaformat_jni_setBuffer(FFAMediaFormat *ctx, const char *name, void *data, size_t size)
Definition: mediacodec_wrapper.c:1171
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:1007
mediaformat_jni_getInt64
static int mediaformat_jni_getInt64(FFAMediaFormat *ctx, const char *name, int64_t *out)
Definition: mediacodec_wrapper.c:871
FFAMediaCodecNdk
Definition: mediacodec_wrapper.c:1943
mediaformat_jni_getInt32
static int mediaformat_jni_getInt32(FFAMediaFormat *ctx, const char *name, int32_t *out)
Definition: mediacodec_wrapper.c:832
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:605
mediaformat_ndk_getInt32
static int mediaformat_ndk_getInt32(FFAMediaFormat *ctx, const char *name, int32_t *out)
Definition: mediacodec_wrapper.c:2092
mediaformat_jni_setString
static void mediaformat_jni_setString(FFAMediaFormat *ctx, const char *name, const char *value)
Definition: mediacodec_wrapper.c:1135
FF_JNI_CLASS
@ FF_JNI_CLASS
Definition: ffjni.h:90
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:2098
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:1083
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:606
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:2104
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:552
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:553
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:2160
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:2136
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:2127
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
FF_JNI_METHOD
@ FF_JNI_METHOD
Definition: ffjni.h:93
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:547
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
ff_jni_get_env
JNIEnv * ff_jni_get_env(void *log_ctx)
Definition: ffjni.c:53
mediaformat_ndk_getBuffer
static int mediaformat_ndk_getBuffer(FFAMediaFormat *ctx, const char *name, void **data, size_t *size)
Definition: mediacodec_wrapper.c:2110
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:556
mediaformat_jni_getFloat
static int mediaformat_jni_getFloat(FFAMediaFormat *ctx, const char *name, float *out)
Definition: mediacodec_wrapper.c:910
AVCOL_TRC_SMPTEST2084
@ AVCOL_TRC_SMPTEST2084
Definition: pixfmt.h:588
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:1990
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:2062
FF_JNI_FIELD
@ FF_JNI_FIELD
Definition: ffjni.h:91
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:610
FFAMediaCodec
Definition: mediacodec_wrapper.h:181
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:656
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:2148
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:591
status
ov_status_e status
Definition: dnn_backend_openvino.c:119
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:577
amediaformat_class
static const AVClass amediaformat_class
Definition: mediacodec_wrapper.c:137
mediaformat_ndk_toString
static char * mediaformat_ndk_toString(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:2085
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:949
mediaformat_ndk_setInt64
static void mediaformat_ndk_setInt64(FFAMediaFormat *ctx, const char *name, int64_t value)
Definition: mediacodec_wrapper.c:2142
FF_JNI_STATIC_METHOD
@ FF_JNI_STATIC_METHOD
Definition: ffjni.h:94
ndk_codec_create
static FFAMediaCodec * ndk_codec_create(int method, const char *arg)
Definition: mediacodec_wrapper.c:2197
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:601
mediaformat_jni_toString
static char * mediaformat_jni_toString(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:807
mediaformat_ndk_setString
static void mediaformat_ndk_setString(FFAMediaFormat *ctx, const char *name, const char *value)
Definition: mediacodec_wrapper.c:2154
mediaformat_ndk_delete
static int mediaformat_ndk_delete(FFAMediaFormat *ctx)
Definition: mediacodec_wrapper.c:2067
codec_create
static FFAMediaCodec * codec_create(int method, const char *arg)
Definition: mediacodec_wrapper.c:1277
mediaformat_jni_setFloat
static void mediaformat_jni_setFloat(FFAMediaFormat *ctx, const char *name, float value)
Definition: mediacodec_wrapper.c:1109