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
105 char_t serverName[ICECAST_SERVER_NAME_MAX_LEN];
107 char_t resource[ICECAST_RESOURCE_MAX_LEN];
123#if (OS_STATIC_TASK_SUPPORT == ENABLED)
125 OsStackType taskStack[ICECAST_CLIENT_STACK_SIZE];
135 char_t buffer[ICECAST_CLIENT_METADATA_MAX_SIZE];
136 char_t metadata[ICECAST_CLIENT_METADATA_MAX_SIZE];
150 uint8_t *data,
size_t size,
size_t *length,
systime_t timeout);
153 char_t *metadata,
size_t size,
size_t *length);
155void icecastClientTask(
void *param);
error_t
Error codes.
Definition error.h:43
uint_t OsMutex
Mutex object.
Definition os_port_none.h:118
uint_t OsEvent
Event object.
Definition os_port_none.h:104
uint_t OsTaskId
Task identifier.
Definition os_port_none.h:97
uint32_t systime_t
System time.
Definition os_port_none.h:90
Icecast client context.
Definition icecast_client.h:117
OsEvent writeEvent
This event tells whether the buffer is writable.
Definition icecast_client.h:120
Socket * socket
Underlying socket.
Definition icecast_client.h:127
size_t blockSize
Number of data bytes between subsequent metadata blocks.
Definition icecast_client.h:128
size_t metadataLength
Length of the metadata.
Definition icecast_client.h:137
OsTaskTcb taskTcb
Task control block.
Definition icecast_client.h:124
size_t readIndex
Current read index within the buffer.
Definition icecast_client.h:133
size_t bufferLength
Streaming buffer length.
Definition icecast_client.h:131
OsMutex mutex
Mutex protecting critical sections.
Definition icecast_client.h:119
size_t totalLength
Total number of bytes that have been received.
Definition icecast_client.h:134
IcecastClientSettings settings
User settings.
Definition icecast_client.h:118
size_t writeIndex
Current write index within the buffer.
Definition icecast_client.h:132
uint8_t * streamBuffer
Streaming buffer.
Definition icecast_client.h:129
size_t bufferSize
Streaming buffer size.
Definition icecast_client.h:130
OsEvent readEvent
This event tells whether the buffer is readable.
Definition icecast_client.h:121
OsTaskId taskId
Task identifier.
Definition icecast_client.h:122
Icecast client settings.
Definition icecast_client.h:103
NetInterface * interface
Underlying network interface.
Definition icecast_client.h:104
size_t bufferSize
Streaming buffer size.
Definition icecast_client.h:108
uint16_t serverPort
Icecast server port.
Definition icecast_client.h:106