Go to the documentation of this file.
31 #ifndef _ICECAST_CLIENT_H
32 #define _ICECAST_CLIENT_H
39 #ifndef ICECAST_CLIENT_SUPPORT
40 #define ICECAST_CLIENT_SUPPORT DISABLED
41 #elif (ICECAST_CLIENT_SUPPORT != ENABLED && ICECAST_CLIENT_SUPPORT != DISABLED)
42 #error ICECAST_CLIENT_SUPPORT parameter is not valid
46 #ifndef ICECAST_CLIENT_STACK_SIZE
47 #define ICECAST_CLIENT_STACK_SIZE 650
48 #elif (ICECAST_CLIENT_STACK_SIZE < 1)
49 #error ICECAST_CLIENT_STACK_SIZE parameter is not valid
53 #ifndef ICECAST_CLIENT_PRIORITY
54 #define ICECAST_CLIENT_PRIORITY OS_TASK_PRIORITY_NORMAL
58 #ifndef ICECAST_CLIENT_TIMEOUT
59 #define ICECAST_CLIENT_TIMEOUT 10000
60 #elif (ICECAST_CLIENT_TIMEOUT < 1000)
61 #error ICECAST_CLIENT_TIMEOUT parameter is not valid
65 #ifndef ICECAST_RECOVERY_DELAY
66 #define ICECAST_RECOVERY_DELAY 5000
67 #elif (ICECAST_RECOVERY_DELAY < 1000)
68 #error ICECAST_RECOVERY_DELAY parameter is not valid
72 #ifndef ICECAST_SERVER_NAME_MAX_LEN
73 #define ICECAST_SERVER_NAME_MAX_LEN 48
74 #elif (ICECAST_SERVER_NAME_MAX_LEN < 1)
75 #error ICECAST_SERVER_NAME_MAX_LEN parameter is not valid
79 #ifndef ICECAST_RESOURCE_MAX_LEN
80 #define ICECAST_RESOURCE_MAX_LEN 32
81 #elif (ICECAST_RESOURCE_MAX_LEN < 1)
82 #error ICECAST_RESOURCE_MAX_LEN parameter is not valid
86 #ifndef ICECAST_CLIENT_METADATA_MAX_SIZE
87 #define ICECAST_CLIENT_METADATA_MAX_SIZE 512
88 #elif (ICECAST_CLIENT_METADATA_MAX_SIZE < 128)
89 #error ICECAST_CLIENT_METADATA_MAX_SIZE parameter is not valid
size_t metadataLength
Length of the metadata.
size_t bufferLength
Streaming buffer length.
error_t icecastClientReadStream(IcecastClientContext *context, uint8_t *data, size_t size, size_t *length, systime_t timeout)
Copy data from input stream.
size_t writeIndex
Current write index within the buffer.
#define ICECAST_RESOURCE_MAX_LEN
void icecastClientTask(void *param)
Icecast client task.
size_t totalLength
Total number of bytes that have been received.
error_t icecastClientReadMetadata(IcecastClientContext *context, char_t *metadata, size_t size, size_t *length)
Copy metadata from input stream.
IcecastClientSettings settings
User settings.
OsTaskId taskId
Task identifier.
OsMutex mutex
Mutex protecting critical sections.
size_t bufferSize
Streaming buffer size.
NetInterface * interface
Underlying network interface.
OsTaskParameters task
Task parameters.
OsEvent readEvent
This event tells whether the buffer is readable.
error_t icecastClientProcessMetadata(IcecastClientContext *context)
Decode metadata block.
uint32_t systime_t
System time.
void icecastClientGetDefaultSettings(IcecastClientSettings *settings)
Initialize settings with default values.
error_t icecastClientConnect(IcecastClientContext *context)
Connect to the specified Icecast server.
#define ICECAST_SERVER_NAME_MAX_LEN
error_t icecastClientStart(IcecastClientContext *context)
Start Icecast client.
OsEvent writeEvent
This event tells whether the buffer is writable.
Socket * socket
Underlying socket.
OsTaskParameters taskParams
Task parameters.
size_t readIndex
Current read index within the buffer.
thread_t * OsTaskId
Task identifier.
size_t blockSize
Number of data bytes between subsequent metadata blocks.
error_t icecastClientInit(IcecastClientContext *context, const IcecastClientSettings *settings)
Icecast client initialization.
size_t bufferSize
Streaming buffer size.
#define ICECAST_CLIENT_METADATA_MAX_SIZE
uint16_t serverPort
Icecast server port.
uint8_t * streamBuffer
Streaming buffer.