SG Com
SG_Com_Player.h
Go to the documentation of this file.
1
4
5#ifndef SG_COM_PLAYER_H
6#define SG_COM_PLAYER_H
7
8#include "SG.h"
9
13#define SG_COM_PLAYER_VERSION_NAME "5.3.0"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
22 typedef enum {
33
37 typedef struct SG_COM_PLAYER_Config {
40 float buffer_sec;
42
48
66
68 SG_LoggingLevel logging_level,
69 SG_LoggingCallback logging_callback);
70
77
86
95
99 typedef struct SG_COM_PLAYER_Context* SG_COM_PLAYER_Handle;
100
108 const SG_COM_PLAYER_Config *player_config,
109 SG_COM_PLAYER_Handle *player_handle
110 );
111
118 SG_COM_PLAYER_Handle player_handle
119 );
120
129 SG_COM_PLAYER_Handle player_handle,
130 const char *packet,
131 sg_size packet_bytes
132 );
133
142 SG_COM_PLAYER_Handle player_handle,
143 const char* event,
144 sg_size event_bytes
145 );
146
155 SG_COM_PLAYER_Handle player_handle,
156 SG_AnimationNode **animation_nodes,
157 sg_size *num_animation_nodes
158 );
159
170 SG_COM_PLAYER_Handle player_handle,
171 double time_ms,
172 double *current_time_ms
173 );
174
182 SG_COM_PLAYER_Handle player_handle,
183 double* min_time_ms,
184 double* max_time_ms
185 );
186
187#ifdef __cplusplus
188}
189#endif
190
191#endif // SG_COM_PLAYER_H
unsigned int sg_size
Definition: SG.h:21
void(* SG_LoggingCallback)(const char *message)
Callback that will be called by an Engine to output log messages.
Definition: SG.h:87
unsigned char sg_byte
Definition: SG.h:22
#define SG_DYN
Used to determine if we are building a shared library, as opposed to building a static library or con...
Definition: SG.h:17
SG_LoggingLevel
Enum for logging level.
Definition: SG.h:56
struct SG_COM_PLAYER_Config SG_COM_PLAYER_Config
Structure containing a Player configuration.
SG_DYN const char * SG_COM_PLAYER_GetVersionString(void)
Get the runtime version number for this library in string format.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_Initialize(SG_LoggingLevel logging_level, SG_LoggingCallback logging_callback)
Initialize the internal context of SG Com.
SG_DYN const char * SG_COM_PLAYER_GetExceptionText(void)
Retrieve exception text after SG_COM_PLAYER_ERROR_EXCEPTION error.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_Shutdown(void)
Shut down and dispose of the internal context of SG Com.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_Create(const SG_COM_PLAYER_Config *player_config, SG_COM_PLAYER_Handle *player_handle)
Create a Player to play the output from a Broadcast Engine.
struct SG_COM_PLAYER_Context * SG_COM_PLAYER_Handle
Handle type.
Definition: SG_Com_Player.h:99
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_GetPlayableRange(SG_COM_PLAYER_Handle player_handle, double *min_time_ms, double *max_time_ms)
Get the range of buffered animation.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_Destroy(SG_COM_PLAYER_Handle player_handle)
Destroy a Player.
SG_COM_PLAYER_Error
Enum of error codes.
Definition: SG_Com_Player.h:22
@ SG_COM_PLAYER_ERROR_INVALID_PACKET
An invalid data packet was received.
Definition: SG_Com_Player.h:25
@ SG_COM_PLAYER_ERROR_INVALID_EVENT
An invalid event was received.
Definition: SG_Com_Player.h:26
@ SG_COM_PLAYER_ERROR_OK
No error.
Definition: SG_Com_Player.h:23
@ SG_COM_PLAYER_ERROR_INVALID_PARAM
An invalid parameter was passed to a function.
Definition: SG_Com_Player.h:27
@ SG_COM_PLAYER_ERROR_OUT_OF_ORDER_PACKET_DISCARDED
A data packet was received out of order and was discarded.
Definition: SG_Com_Player.h:28
@ SG_COM_PLAYER_ERROR_EXCEPTION
An exception was raised, call SG_COM_PLAYER_GetExceptionText() for details.
Definition: SG_Com_Player.h:29
@ SG_COM_PLAYER_ERROR_UNDEFINED
An unclassified error occurred.
Definition: SG_Com_Player.h:31
@ SG_COM_PLAYER_ERROR_NOT_IMPLEMENTED
This operation is not implemented.
Definition: SG_Com_Player.h:30
@ SG_COM_PLAYER_ERROR_INVALID_HANDLE
An invalid Engine or Player was created or referenced.
Definition: SG_Com_Player.h:24
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_ReceivePacket(SG_COM_PLAYER_Handle player_handle, const char *packet, sg_size packet_bytes)
Receive an output packet from an Engine into the corresponding Player.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_GetAnimationNodes(SG_COM_PLAYER_Handle player_handle, SG_AnimationNode **animation_nodes, sg_size *num_animation_nodes)
Get the animation nodes for a given Player.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_ReceiveEvent(SG_COM_PLAYER_Handle player_handle, const char *event, sg_size event_bytes)
Receive an event loaded in memory into the corresponding Player.
SG_DYN SG_COM_PLAYER_Error SG_COM_PLAYER_UpdateAnimation(SG_COM_PLAYER_Handle player_handle, double time_ms, double *current_time_ms)
Set the current play time and update the animation nodes.
SG_DYN unsigned int SG_COM_PLAYER_GetVersionNumber(void)
Get the runtime version number for this library.
Structure containing an animation node.
Definition: SG.h:74
Structure containing a Player configuration.
Definition: SG_Com_Player.h:37
sg_byte * character_file_in_memory
The character file data loaded into memory.
Definition: SG_Com_Player.h:38
float buffer_sec
The maximum duration (in seconds) that the output buffer can hold.
Definition: SG_Com_Player.h:40
sg_size character_file_bytes
The size of the character file data in bytes.
Definition: SG_Com_Player.h:39