|
SWILIB API (ELKA)
|
Multifunction media framework: converting, resizing, rotating, streaming, recording and other.
Usage: #include <swilib.h> or #include <swilib/obs.h>
Data Structures | |
| struct | OBSevent |
| Event for Obs_TranslateMessageGBS. More... | |
| struct | OBS_FILE_STREAM_METHODS |
| Method table of the Obs file streams (see RamObsFileStreamMethods). More... | |
Typedefs | |
| typedef int | HObj |
| typedef struct OBSevent | OBSevent |
| typedef struct OBS_FILE_STREAM_METHODS | OBS_FILE_STREAM_METHODS |
Enumerations | |
| enum | ObsEventID { OBS_EV_NO_MSG = 0x00 , OBS_EV_GetInfoCon = 0x01 , OBS_EV_ConvDestroyed = 0x05 , OBS_EV_ParamChanged = 0x06 , OBS_EV_StatusChanged = 0x08 , OBS_EV_StatusUpdated = 0x09 , OBS_EV_FrameUpdate = 0x0A , OBS_EV_LoopUpdate = 0x0B , OBS_EV_Error = 0x0C , OBS_EV_StopInd = 0x13 , OBS_EV_PauseInd = 0x14 , OBS_EV_ResumeInd = 0x15 , OBS_EV_StopCon = 0x16 , OBS_EV_PauseCon = 0x17 , OBS_EV_ResumeCon = 0x18 , OBS_EV_PrepareCon = 0x35 , OBS_EV_GetCapabilityCon = 0x37 , OBS_EV_EndList = 0x66 } |
| OBS events for async mode. More... | |
Functions | |
| HObj | Obs_CreateObject (int uid_in, int uid_out, int prio, int msg_callback, int emb4, int sync, uint32_t *err) |
| Create OBS object. | |
| int | Obs_DestroyObject (HObj obs) |
| Destroy OBS object. | |
| int | Obs_SetInput_File (HObj obs, int unk, WSHDR *path) |
| Use the file as input. | |
| int | Obs_SetInput_Memory (HObj obs, int unk, char *buf, int len) |
| Use the memory as input. | |
| int | Obs_GetInputImageSize (HObj obs, short *w, short *h) |
| Get the resolution of the input image. | |
| int | Obs_Graphics_SetClipping (HObj obs, short x, short y, short w, short h) |
| Clip image. | |
| int | Obs_SetRenderOffset (HObj obs, short x, short y) |
| Set render offset. | |
| int | Obs_SetOutputImageSize (HObj obs, short w, short h) |
| Resize image. | |
| int | Obs_SetRotation (HObj obs, int angle) |
| Rotate image. | |
| int | Obs_SetScaling (HObj obs, int method) |
| Set scaling method. | |
| int | Obs_Prepare (HObj obs) |
| Prepare before start. | |
| int | Obs_Start (HObj obs) |
| Start processing. | |
| int | Obs_Stop (HObj obs) |
| Stop processing. | |
| int | Obs_Pause (HObj obs) |
| Pause processing. | |
| int | Obs_Resume (HObj obs) |
| Resume paused processing. | |
| int | Obs_Output_GetPictstruct (HObj obs, IMGHDR **img) |
| Get the IMGHDR of the input image. | |
| int | Obs_GetInfo (HObj obs, int unk) |
| Get information from the input file. | |
| int | Obs_TranslateMessageGBS (const GBS_MSG *msg, const OBSevent *handlers) |
| Process async callbacks from GBS message. | |
| int | Obs_SetPosition (HObj obs, int position) |
| Set the given position for playing audio or video. | |
| static int | Obs_GetPosition (HObj obs, int *position) |
| Get the current position of playing audio or video. | |
| static int | Obs_GetDuration (HObj obs, int *position) |
| Get the duration of playing audio or video. | |
| int | Obs_Mam_SetPurpose (HObj obs, char purpose) |
| Set purpose for MAM. | |
| int | Obs_Sound_SetPurpose (HObj obs, int purpose) |
| Set purpose for Sound. | |
| int | Obs_Sound_SetVolumeEx (HObj obs, char volume, char delta) |
| Set sound volume. | |
| int | Obs_Sound_GetVolume (HObj obs, char *volume) |
| Get current sound volume. | |
| int | Obs_Sound_SetAMRFormat (HObj obs, int format) |
| Set AMR format. | |
| int | Obs_Sound_SetAMRDTX (HObj obs, int dtx) |
| Set AMR DTX. | |
| int | Obs_Sound_SetNofChannels (HObj obs, int num_channels) |
| Set count of the channels. | |
| int | Obs_Sound_SetAMRMode (HObj obs, int data_rate) |
| Set AMR data rate. | |
| int | Obs_Sound_SetFIsRecording (HObj obs, int is_recording) |
| Set recording mode. | |
| int | Obs_Sound_SetMaxFileSize (HObj obs, int max_file_size) |
| Set maximum file size. | |
| int | Obs_Sound_SetRecordingMode (HObj obs, int recording_mode) |
| Set mode of the recording. | |
| int | Obs_SetOutput_File (HObj obs, const WSHDR *filename) |
| Set output filename. | |
| int | Obs_SetOutput_Uid (HObj obs, int uid) |
| Set output file type (extension UID). | |
| int | Obs_Sound_SetBitrate (HObj obs, int bitrate) |
| Set sound bitrate. | |
| int | Obs_SetUserPointer (HObj obs, void *user_pointer) |
| Set custom user pointer to the OBS object. | |
| int | Obs_SetCSM (HObj obs, CSM_RAM *csm) |
| Link CSM to the OBS object. | |
| int | Obs_GetUserPointer (HObj obs, void **p_user_pointer) |
| Get custom user pointer from the OBS object. | |
| void * | Obs_MemAlloc (int size) |
| Allocate memory from the Obs heap (the pool of the Obs file stream chunks). | |
| void | Obs_MemFree (void *ptr) |
| Free memory allocated with Obs_MemAlloc. | |
| OBS_FILE_STREAM_METHODS * | RamObsFileStreamMethods (void) |
| Get the global method table of the Obs file streams, shared by all file stream objects. | |
| struct OBSevent |
| struct OBS_FILE_STREAM_METHODS |
| enum ObsEventID |
OBS events for async mode.
| HObj Obs_CreateObject | ( | int | uid_in, |
| int | uid_out, | ||
| int | prio, | ||
| int | msg_callback, | ||
| int | emb4, | ||
| int | sync, | ||
| uint32_t * | err ) |
Create OBS object.
| uid_in | UID of file type for input | |
| uid_out | UID of file type for output | |
| prio | priority | |
| msg_callback | GBS message ID for async operations | |
| emb4 | unknown, set to 1 | |
| sync | 1: sync mode, 0: async mode | |
| [out] | err | error code |
| int Obs_DestroyObject | ( | HObj | obs | ) |
Destroy OBS object.
| obs | OBS object |
Use the file as input.
| obs | OBS object |
| unk | unknown, set to 0 |
| path | path to the file |
| int Obs_SetInput_Memory | ( | HObj | obs, |
| int | unk, | ||
| char * | buf, | ||
| int | len ) |
Use the memory as input.
| obs | OBS object |
| unk | unknown, set to 0 |
| buf | pointer to the input buffer |
| len | size of the input buffer |
| int Obs_GetInputImageSize | ( | HObj | obs, |
| short * | w, | ||
| short * | h ) |
Get the resolution of the input image.
| obs | OBS object | |
| [out] | w,h | image resolution |
| int Obs_Graphics_SetClipping | ( | HObj | obs, |
| short | x, | ||
| short | y, | ||
| short | w, | ||
| short | h ) |
Clip image.
| obs | OBS object |
| x,y,w,h | clipping region |
| int Obs_SetRenderOffset | ( | HObj | obs, |
| short | x, | ||
| short | y ) |
Set render offset.
| obs | OBS object |
| x,y | render offset |
| int Obs_SetOutputImageSize | ( | HObj | obs, |
| short | w, | ||
| short | h ) |
Resize image.
| obs | OBS object |
| w,h | new image resolution |
| int Obs_SetRotation | ( | HObj | obs, |
| int | angle ) |
Rotate image.
| obs | OBS object |
| angle | rotate image using this angle (0, 90, 180, 270) |
| int Obs_SetScaling | ( | HObj | obs, |
| int | method ) |
Set scaling method.
| obs | OBS object |
| method | set to 5 |
| int Obs_Prepare | ( | HObj | obs | ) |
Prepare before start.
| obs | OBS object |
| int Obs_Start | ( | HObj | obs | ) |
Start processing.
| obs | OBS object |
| int Obs_Stop | ( | HObj | obs | ) |
Stop processing.
| obs | OBS object |
| int Obs_Pause | ( | HObj | obs | ) |
Pause processing.
| obs | OBS object |
| int Obs_Resume | ( | HObj | obs | ) |
Resume paused processing.
| obs | OBS object |
| int Obs_GetInfo | ( | HObj | obs, |
| int | unk ) |
Get information from the input file.
| obs | OBS object |
| unk | unknown, set to 1 or 0 |
Process async callbacks from GBS message.
| msg | message from GBS |
| handlers | async callbacks (array of OBSevent) |
| int Obs_SetPosition | ( | HObj | obs, |
| int | position ) |
Set the given position for playing audio or video.
| obs | OBS object |
| position | position in ms |
|
inlinestatic |
|
inlinestatic |
| int Obs_Mam_SetPurpose | ( | HObj | obs, |
| char | purpose ) |
Set purpose for MAM.
| obs | OBS object |
| purpose | unknown |
| int Obs_Sound_SetPurpose | ( | HObj | obs, |
| int | purpose ) |
Set purpose for Sound.
| obs | OBS object |
| purpose | unknown |
| int Obs_Sound_SetVolumeEx | ( | HObj | obs, |
| char | volume, | ||
| char | delta ) |
Set sound volume.
| obs | OBS object |
| volume | volume level, 0-15 |
| delta | unknown, set to 1 |
| int Obs_Sound_GetVolume | ( | HObj | obs, |
| char * | volume ) |
Get current sound volume.
| obs | OBS object | |
| [out] | volume | current volume level, 0-15 |
| int Obs_Sound_SetAMRFormat | ( | HObj | obs, |
| int | format ) |
Set AMR format.
| obs | OBS object |
| format | AMR format |
| int Obs_Sound_SetAMRDTX | ( | HObj | obs, |
| int | dtx ) |
Set AMR DTX.
| obs | OBS object |
| dtx | ARM DTX value |
| int Obs_Sound_SetNofChannels | ( | HObj | obs, |
| int | num_channels ) |
Set count of the channels.
| obs | OBS object |
| num_channels | channels count |
| int Obs_Sound_SetAMRMode | ( | HObj | obs, |
| int | data_rate ) |
Set AMR data rate.
| obs | OBS object |
| data_rate | AMR data rate value |
| int Obs_Sound_SetFIsRecording | ( | HObj | obs, |
| int | is_recording ) |
Set recording mode.
| obs | OBS object |
| is_recording | set to 1 when recording |
| int Obs_Sound_SetMaxFileSize | ( | HObj | obs, |
| int | max_file_size ) |
Set maximum file size.
| obs | OBS object |
| max_file_size | maximum file szie value |
| int Obs_Sound_SetRecordingMode | ( | HObj | obs, |
| int | recording_mode ) |
Set mode of the recording.
| obs | OBS object |
| recording_mode | mode of the recording |
Set output filename.
| obs | OBS object |
| filename | filename for output file |
| int Obs_SetOutput_Uid | ( | HObj | obs, |
| int | uid ) |
Set output file type (extension UID).
| obs | OBS object |
| uid | extension UID |
| int Obs_Sound_SetBitrate | ( | HObj | obs, |
| int | bitrate ) |
Set sound bitrate.
| obs | OBS object |
| bitrate | bitrate value |
| int Obs_SetUserPointer | ( | HObj | obs, |
| void * | user_pointer ) |
Set custom user pointer to the OBS object.
| obs | OBS object |
| user_pointer | custom user pointer |
Link CSM to the OBS object.
| obs | OBS object |
| csm | pointer to the csm |
| int Obs_GetUserPointer | ( | HObj | obs, |
| void ** | p_user_pointer ) |
Get custom user pointer from the OBS object.
| obs | OBS object |
| p_user_pointer | pointer to variable that receives the stored pointer |
| void * Obs_MemAlloc | ( | int | size | ) |
Allocate memory from the Obs heap (the pool of the Obs file stream chunks).
The file stream's get method returns its chunks from here; the reader frees them with Obs_MemFree.
| size | size in bytes |
| void Obs_MemFree | ( | void * | ptr | ) |
Free memory allocated with Obs_MemAlloc.
| ptr | pointer to the memory |
| OBS_FILE_STREAM_METHODS * RamObsFileStreamMethods | ( | void | ) |
Get the global method table of the Obs file streams, shared by all file stream objects.
Swapping methods serves virtual files to the player (s65-mp3, radio).