gpac/tools.h File Reference

Base definitions and functions of GPAC. More...

#include <gpac/setup.h>
#include <gpac/version.h>

Classes

struct  GF_SystemRTInfo
 run-time system info object More...

Defines

#define GPAC_VERSION
 GPAC Version.
#define GPAC_VERSION_MAJOR   2
#define GPAC_VERSION_MINOR   0
#define GPAC_VERSION_MICRO   0
#define GPAC_FULL_VERSION   GPAC_VERSION"-rev"GPAC_SVN_REVISION
#define GPAC_VERSION_INT
 GPAC Version.
#define gf_stringizer(x)
 Stringizer.
#define GF_SAFEALLOC(__ptr, __struct)
 Memory allocation.
#define GF_LOG(_log_level, _log_tools, __args)
 Message logging.

Typedefs

typedef void(* gf_log_cbk )(void *cbck, u32 log_level, u32 log_tool, const char *fmt, va_list vlist)
 Log Message Callback.
typedef Bool(* gf_enum_dir_item )(void *cbck, char *item_name, char *item_path)
 Directory Enumeration Callback.
typedef void(* gf_on_progress_cbk )(const void *cbck, const char *title, u64 done, u64 total)
 Progress Callback.
typedef struct
_GF_GlobalLock_opaque 
GF_GlobalLock
typedef struct __sha1_context GF_SHA1Context

Enumerations

enum  GF_Err {
  GF_SCRIPT_INFO = 3, GF_PACKED_FRAMES = 2, GF_EOS = 1, GF_OK = 0,
  GF_BAD_PARAM = -1, GF_OUT_OF_MEM = -2, GF_IO_ERR = -3, GF_NOT_SUPPORTED = -4,
  GF_CORRUPTED_DATA = -5, GF_SG_UNKNOWN_NODE = -6, GF_SG_INVALID_PROTO = -7, GF_SCRIPT_ERROR = -8,
  GF_BUFFER_TOO_SMALL = -9, GF_NON_COMPLIANT_BITSTREAM = -10, GF_CODEC_NOT_FOUND = -11, GF_URL_ERROR = -12,
  GF_SERVICE_ERROR = -13, GF_REMOTE_SERVICE_ERROR = -14, GF_STREAM_NOT_FOUND = -15, GF_ISOM_INVALID_FILE = -20,
  GF_ISOM_INCOMPLETE_FILE = -21, GF_ISOM_INVALID_MEDIA = -22, GF_ISOM_INVALID_MODE = -23, GF_ISOM_UNKNOWN_DATA_REF = -24,
  GF_ODF_INVALID_DESCRIPTOR = -30, GF_ODF_FORBIDDEN_DESCRIPTOR = -31, GF_ODF_INVALID_COMMAND = -32, GF_BIFS_UNKNOWN_VERSION = -33,
  GF_IP_ADDRESS_NOT_FOUND = -40, GF_IP_CONNECTION_FAILURE = -41, GF_IP_NETWORK_FAILURE = -42, GF_IP_CONNECTION_CLOSED = -43,
  GF_IP_NETWORK_EMPTY = -44, GF_IP_SOCK_WOULD_BLOCK = -45, GF_IP_UDP_TIMEOUT = -46, GF_AUTHENTICATION_FAILURE = -50,
  GF_SCRIPT_NOT_READY = -51
}
enum  {
  GF_LOG_QUIET = 0, GF_LOG_ERROR, GF_LOG_WARNING, GF_LOG_INFO,
  GF_LOG_DEBUG
}
enum  {
  GF_LOG_CORE = 0, GF_LOG_CODING, GF_LOG_CONTAINER, GF_LOG_NETWORK,
  GF_LOG_RTP, GF_LOG_AUTHOR, GF_LOG_SYNC, GF_LOG_CODEC,
  GF_LOG_PARSER, GF_LOG_MEDIA, GF_LOG_SCENE, GF_LOG_SCRIPT,
  GF_LOG_INTERACT, GF_LOG_COMPOSE, GF_LOG_CACHE, GF_LOG_MMIO,
  GF_LOG_RTI, GF_LOG_SMIL, GF_LOG_MEMORY, GF_LOG_AUDIO,
  GF_LOG_MODULE, GF_LOG_MUTEX, GF_LOG_CONSOLE, GF_LOG_ALL,
  GF_LOG_TOOL_MAX = GF_LOG_ALL
}
enum  { GF_RTI_ALL_PROCESSES_TIMES = 1, GF_RTI_PROCESS_MEMORY = 1<<1, GF_RTI_SYSTEM_MEMORY_ONLY = 1<<2 }

Functions

const char * gpac_features ()
 4CC Formatting
const char * gf_4cc_to_str (u32 type)
 4CC Printing
int gf_asprintf (char **buffer, const char *fmt,...)
 asprintf() portable implementation
size_t gf_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream)
 file writing helper
FILE * gf_f64_open (const char *file_name, const char *mode)
 large file opening
u64 gf_f64_tell (FILE *f)
 large file position query
u64 gf_f64_seek (FILE *f, s64 pos, s32 whence)
 large file seeking
const char * gf_error_to_string (GF_Err e)
 Error Printing.
void gf_log_set_strict_error (Bool strict)
 Log exits at first error assignment.
char * gf_log_get_tools_levels ()
 gets string-formated log tools
void gf_log_set_tool_level (u32 tool, u32 level)
 Log modules assignment.
gf_log_cbk gf_log_set_callback (void *usr_cbk, gf_log_cbk cbk)
 Log overwrite.
void gf_log (const char *fmt,...)
void gf_log_lt (u32 ll, u32 lt)
Bool gf_log_tool_level_on (u32 log_tool, u32 log_level)
 Log level checking.
GF_Err gf_log_set_tools_levels (const char *log_tools_levels)
 Set log tools and levels.
GF_Err gf_log_modify_tools_levels (const char *val)
 Modify log tools and levels.
void gf_rand_init (Bool Reset)
 PseudoRandom Integer Generation Initialization.
u32 gf_rand ()
 PseudoRandom Integer Generation.
void gf_get_user_name (char *buf, u32 buf_size)
 user name
GF_Err gf_enum_directory (const char *dir, Bool enum_directory, gf_enum_dir_item enum_dir, void *cbck, const char *filter)
 Directory enumeration.
GF_Err gf_delete_file (const char *fileName)
 File Deletion.
void gf_move_file (const char *fileName, const char *newFileName)
 File Move.
FILE * gf_temp_file_new ()
 Temporary File Creation.
u64 gf_file_modification_time (const char *filename)
 File Modification Time.
void gf_set_progress (const char *title, u64 done, u64 total)
 Progress formatting.
void gf_set_progress_callback (void *user_cbk, gf_on_progress_cbk prog_cbk)
 Progress overwriting.
Bool gf_prompt_has_input ()
 Prompt checking.
char gf_prompt_get_char ()
 Prompt character flush.
void gf_prompt_set_echo_off (Bool echo_off)
 turns prompt echo on/off
void gf_sys_init (Bool enable_memory_tracker)
 System setup.
void gf_sys_close ()
 System closing.
u32 gf_sys_clock ()
 System clock query.
void gf_sleep (u32 ms)
 Sleeps thread/process.
GF_Err gf_rmdir (char *DirPathName)
 Delete Directory.
GF_Err gf_mkdir (char *DirPathName)
 Create Directory.
GF_Err gf_cleanup_dir (char *DirPathName)
 Create Directory.
u32 gf_crc_32 (char *data, u32 size)
 CRC32 compute.
Bool gf_sys_get_rti (u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags)
 Gets Run-Time info.
Bool gf_sys_get_battery_state (Bool *onBattery, u32 *onCharge, u32 *level, u32 *batteryLifeTime, u32 *batteryFullLifeTime)
GF_GlobalLock * gf_global_resource_lock (const char *resourceName)
GF_Err gf_global_resource_unlock (GF_GlobalLock *lock)
char * gf_get_default_cache_directory ()
GF_Err gf_gz_compress_payload (char **data, u32 data_len, u32 *out_size)
GF_Err gf_gz_decompress_payload (char *data, u32 data_len, char **uncompressed_data, u32 *out_size)
GF_SHA1Context * gf_sha1_starts ()
void gf_sha1_update (GF_SHA1Context *ctx, u8 *input, u32 length)
void gf_sha1_finish (GF_SHA1Context *ctx, u8 digest[20])
int gf_sha1_file (const char *filename, u8 digest[20])
void gf_sha1_csum (u8 *buf, u32 buflen, u8 digest[20])

Detailed Description

This file contains basic functions and core definitions of the GPAC framework. This file is usually included by all GPAC header files since it contains the error definitions.


Generated on 4 Jul 2012 for libgpac by  doxygen 1.6.1