MobileFFmpeg Android API  2.2
Data Structures | Macros | Functions | Variables
mobileffmpeg_config.c File Reference

Go to the source code of this file.

Data Structures

struct  CallbackData
 

Macros

#define LOG_LINE_SIZE   1024
 

Functions

static const char * avutil_log_get_level_str (int level)
 
static void avutil_log_format_line (void *avcl, int level, const char *fmt, va_list vl, AVBPrint part[4], int *print_prefix)
 
static void avutil_log_sanitize (uint8_t *line)
 
void mutexInit ()
 
void monitorInit ()
 
void mutexUnInit ()
 
void monitorUnInit ()
 
void mutexLock ()
 
void mutexUnlock ()
 
void monitorWait (int milliSeconds)
 
void monitorNotify ()
 
void logCallbackDataAdd (int level, const char *data)
 
void statisticsCallbackDataAdd (int frameNumber, float fps, float quality, int64_t size, int time, double bitrate, double speed)
 
struct CallbackDatacallbackDataRemove ()
 
void mobileffmpeg_log_callback_function (void *ptr, int level, const char *format, va_list vargs)
 
void mobileffmpeg_statistics_callback_function (int frameNumber, float fps, float quality, int64_t size, int time, double bitrate, double speed)
 
void * callbackThreadFunction ()
 
jint JNI_OnLoad (JavaVM *vm, void *reserved)
 
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel (JNIEnv *env, jclass object, jint level)
 
JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel (JNIEnv *env, jclass object)
 
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_enableNativeRedirection (JNIEnv *env, jclass object)
 
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_disableNativeRedirection (JNIEnv *env, jclass object)
 

Variables

pthread_mutex_t lockMutex
 
pthread_mutex_t monitorMutex
 
pthread_cond_t monitorCondition
 
pthread_t callbackThread
 
int redirectionEnabled
 
struct CallbackDatacallbackDataHead
 
struct CallbackDatacallbackDataTail
 
static JavaVM * globalVm
 
static jclass configClass
 
static jmethodID logMethod
 
static jmethodID statisticsMethod
 
const char * configClassName = "com/arthenica/mobileffmpeg/Config"
 
JNINativeMethod configMethods []
 

Macro Definition Documentation

◆ LOG_LINE_SIZE

#define LOG_LINE_SIZE   1024

DEFINES LINE SIZE USED FOR LOGGING

Definition at line 85 of file mobileffmpeg_config.c.

Function Documentation

◆ avutil_log_format_line()

static void avutil_log_format_line ( void *  avcl,
int  level,
const char *  fmt,
va_list  vl,
AVBPrint  part[4],
int print_prefix 
)
static

Definition at line 110 of file mobileffmpeg_config.c.

◆ avutil_log_get_level_str()

static const char* avutil_log_get_level_str ( int  level)
static

Definition at line 87 of file mobileffmpeg_config.c.

◆ avutil_log_sanitize()

static void avutil_log_sanitize ( uint8_t *  line)
static

Definition at line 142 of file mobileffmpeg_config.c.

◆ callbackDataRemove()

struct CallbackData* callbackDataRemove ( )

Removes head of callback data list.

Definition at line 299 of file mobileffmpeg_config.c.

◆ callbackThreadFunction()

void* callbackThreadFunction ( )

Forwards callback messages to Java classes.

Definition at line 378 of file mobileffmpeg_config.c.

◆ Java_com_arthenica_mobileffmpeg_Config_disableNativeRedirection()

JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_disableNativeRedirection ( JNIEnv *  env,
jclass  object 
)

Disables log and statistics redirection.

Parameters
envpointer to native method interface
referenceto the class on which this method is invoked

Definition at line 549 of file mobileffmpeg_config.c.

◆ Java_com_arthenica_mobileffmpeg_Config_enableNativeRedirection()

JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_enableNativeRedirection ( JNIEnv *  env,
jclass  object 
)

Enables log and statistics redirection.

Parameters
envpointer to native method interface
referenceto the class on which this method is invoked

Definition at line 522 of file mobileffmpeg_config.c.

◆ Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel()

JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel ( JNIEnv *  env,
jclass  object 
)

Returns current log level.

Parameters
envpointer to native method interface
referenceto the class on which this method is invoked

Definition at line 512 of file mobileffmpeg_config.c.

◆ Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel()

JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel ( JNIEnv *  env,
jclass  object,
jint  level 
)

Sets log level.

Parameters
envpointer to native method interface
referenceto the class on which this method is invoked
loglevel

Definition at line 502 of file mobileffmpeg_config.c.

◆ JNI_OnLoad()

jint JNI_OnLoad ( JavaVM *  vm,
void *  reserved 
)

Called when 'mobileffmpeg-config' native library is loaded.

Parameters
vmpointer to the running virtual machine
reservedreserved
Returns
JNI version needed by 'mobileffmpeg' library

Definition at line 448 of file mobileffmpeg_config.c.

◆ logCallbackDataAdd()

void logCallbackDataAdd ( int  level,
const char *  data 
)

Adds log data to the end of callback data list.

Definition at line 221 of file mobileffmpeg_config.c.

◆ mobileffmpeg_log_callback_function()

void mobileffmpeg_log_callback_function ( void *  ptr,
int  level,
const char *  format,
va_list  vargs 
)

Callback function for FFmpeg logs.

Parameters
pointerto AVClass struct
level
format
arguments

Definition at line 336 of file mobileffmpeg_config.c.

◆ mobileffmpeg_statistics_callback_function()

void mobileffmpeg_statistics_callback_function ( int  frameNumber,
float  fps,
float  quality,
int64_t  size,
int  time,
double  bitrate,
double  speed 
)

Callback function for FFmpeg statistics.

Parameters
frameNumberlast processed frame number
fpsframes processed per second
qualityquality of the output stream (video only)
sizesize in bytes
timeprocessed output duration
bitrateoutput bit rate in kbits/s
speedprocessing speed = processed duration / operation duration

Definition at line 371 of file mobileffmpeg_config.c.

◆ monitorInit()

void monitorInit ( )

Definition at line 159 of file mobileffmpeg_config.c.

◆ monitorNotify()

void monitorNotify ( )

Definition at line 212 of file mobileffmpeg_config.c.

◆ monitorUnInit()

void monitorUnInit ( )

Definition at line 179 of file mobileffmpeg_config.c.

◆ monitorWait()

void monitorWait ( int  milliSeconds)

Definition at line 192 of file mobileffmpeg_config.c.

◆ mutexInit()

void mutexInit ( )

Definition at line 150 of file mobileffmpeg_config.c.

◆ mutexLock()

void mutexLock ( )

Definition at line 184 of file mobileffmpeg_config.c.

◆ mutexUnInit()

void mutexUnInit ( )

Definition at line 175 of file mobileffmpeg_config.c.

◆ mutexUnlock()

void mutexUnlock ( )

Definition at line 188 of file mobileffmpeg_config.c.

◆ statisticsCallbackDataAdd()

void statisticsCallbackDataAdd ( int  frameNumber,
float  fps,
float  quality,
int64_t  size,
int  time,
double  bitrate,
double  speed 
)

Adds statistics data to the end of callback data list.

Definition at line 258 of file mobileffmpeg_config.c.

Variable Documentation

◆ callbackDataHead

struct CallbackData* callbackDataHead

Definition at line 58 of file mobileffmpeg_config.c.

◆ callbackDataTail

struct CallbackData* callbackDataTail

Definition at line 59 of file mobileffmpeg_config.c.

◆ callbackThread

pthread_t callbackThread

Definition at line 55 of file mobileffmpeg_config.c.

◆ configClass

jclass configClass
static

Global reference of Config class in Java

Definition at line 65 of file mobileffmpeg_config.c.

◆ configClassName

const char* configClassName = "com/arthenica/mobileffmpeg/Config"

Full name of the Config class

Definition at line 74 of file mobileffmpeg_config.c.

◆ configMethods

JNINativeMethod configMethods[]
Initial value:
= {
{"enableNativeRedirection", "()V", (void*) Java_com_arthenica_mobileffmpeg_Config_enableNativeRedirection},
{"disableNativeRedirection", "()V", (void*) Java_com_arthenica_mobileffmpeg_Config_disableNativeRedirection},
{"setNativeLogLevel", "(I)V", (void*) Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel},
{"getNativeLogLevel", "()I", (void*) Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel}
}
JNIEXPORT jint JNICALL Java_com_arthenica_mobileffmpeg_Config_getNativeLogLevel(JNIEnv *env, jclass object)
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_enableNativeRedirection(JNIEnv *env, jclass object)
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_setNativeLogLevel(JNIEnv *env, jclass object, jint level)
JNIEXPORT void JNICALL Java_com_arthenica_mobileffmpeg_Config_disableNativeRedirection(JNIEnv *env, jclass object)

Prototypes of native functions defined by Config class.

Definition at line 77 of file mobileffmpeg_config.c.

◆ globalVm

JavaVM* globalVm
static

Global reference to the virtual machine running

Definition at line 62 of file mobileffmpeg_config.c.

◆ lockMutex

pthread_mutex_t lockMutex

Redirection control variables

Definition at line 51 of file mobileffmpeg_config.c.

◆ logMethod

jmethodID logMethod
static

Global reference of log redirection method in Java

Definition at line 68 of file mobileffmpeg_config.c.

◆ monitorCondition

pthread_cond_t monitorCondition

Definition at line 53 of file mobileffmpeg_config.c.

◆ monitorMutex

pthread_mutex_t monitorMutex

Definition at line 52 of file mobileffmpeg_config.c.

◆ redirectionEnabled

int redirectionEnabled

Definition at line 56 of file mobileffmpeg_config.c.

◆ statisticsMethod

jmethodID statisticsMethod
static

Global reference of statistics redirection method in Java

Definition at line 71 of file mobileffmpeg_config.c.