icecast_client.h File Reference

Icecast client. More...

#include "core/net.h"
#include "core/socket.h"

Go to the source code of this file.

Data Structures

struct  IcecastClientSettings
 Icecast client settings. More...
 
struct  IcecastClientContext
 Icecast client context. More...
 

Macros

#define ICECAST_CLIENT_SUPPORT   DISABLED
 
#define ICECAST_CLIENT_STACK_SIZE   650
 
#define ICECAST_CLIENT_PRIORITY   OS_TASK_PRIORITY_NORMAL
 
#define ICECAST_CLIENT_TIMEOUT   10000
 
#define ICECAST_RECOVERY_DELAY   5000
 
#define ICECAST_SERVER_NAME_MAX_LEN   48
 
#define ICECAST_RESOURCE_MAX_LEN   32
 
#define ICECAST_CLIENT_METADATA_MAX_SIZE   512
 

Functions

void icecastClientGetDefaultSettings (IcecastClientSettings *settings)
 Initialize settings with default values. More...
 
error_t icecastClientInit (IcecastClientContext *context, const IcecastClientSettings *settings)
 Icecast client initialization. More...
 
error_t icecastClientStart (IcecastClientContext *context)
 Start Icecast client. More...
 
error_t icecastClientReadStream (IcecastClientContext *context, uint8_t *data, size_t size, size_t *length, systime_t timeout)
 Copy data from input stream. More...
 
error_t icecastClientReadMetadata (IcecastClientContext *context, char_t *metadata, size_t size, size_t *length)
 Copy metadata from input stream. More...
 
void icecastClientTask (void *param)
 Icecast client task. More...
 
error_t icecastClientConnect (IcecastClientContext *context)
 Connect to the specified Icecast server. More...
 
error_t icecastClientProcessMetadata (IcecastClientContext *context)
 Decode metadata block. More...
 

Detailed Description

Icecast client.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file icecast_client.h.

Macro Definition Documentation

◆ ICECAST_CLIENT_METADATA_MAX_SIZE

#define ICECAST_CLIENT_METADATA_MAX_SIZE   512

Definition at line 87 of file icecast_client.h.

◆ ICECAST_CLIENT_PRIORITY

#define ICECAST_CLIENT_PRIORITY   OS_TASK_PRIORITY_NORMAL

Definition at line 54 of file icecast_client.h.

◆ ICECAST_CLIENT_STACK_SIZE

#define ICECAST_CLIENT_STACK_SIZE   650

Definition at line 47 of file icecast_client.h.

◆ ICECAST_CLIENT_SUPPORT

#define ICECAST_CLIENT_SUPPORT   DISABLED

Definition at line 40 of file icecast_client.h.

◆ ICECAST_CLIENT_TIMEOUT

#define ICECAST_CLIENT_TIMEOUT   10000

Definition at line 59 of file icecast_client.h.

◆ ICECAST_RECOVERY_DELAY

#define ICECAST_RECOVERY_DELAY   5000

Definition at line 66 of file icecast_client.h.

◆ ICECAST_RESOURCE_MAX_LEN

#define ICECAST_RESOURCE_MAX_LEN   32

Definition at line 80 of file icecast_client.h.

◆ ICECAST_SERVER_NAME_MAX_LEN

#define ICECAST_SERVER_NAME_MAX_LEN   48

Definition at line 73 of file icecast_client.h.

Function Documentation

◆ icecastClientConnect()

error_t icecastClientConnect ( IcecastClientContext context)

Connect to the specified Icecast server.

Parameters
[in]contextPointer to the Icecast client context

Definition at line 439 of file icecast_client.c.

◆ icecastClientGetDefaultSettings()

void icecastClientGetDefaultSettings ( IcecastClientSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains Icecast client settings

Definition at line 49 of file icecast_client.c.

◆ icecastClientInit()

error_t icecastClientInit ( IcecastClientContext context,
const IcecastClientSettings settings 
)

Icecast client initialization.

Parameters
[in]contextPointer to the Icecast client context
[in]settingsIcecast client specific settings
Returns
Error code

Definition at line 78 of file icecast_client.c.

◆ icecastClientProcessMetadata()

error_t icecastClientProcessMetadata ( IcecastClientContext context)

Decode metadata block.

Parameters
[in]contextPointer to the Icecast client context

Definition at line 605 of file icecast_client.c.

◆ icecastClientReadMetadata()

error_t icecastClientReadMetadata ( IcecastClientContext context,
char_t metadata,
size_t  size,
size_t *  length 
)

Copy metadata from input stream.

Parameters
[in]contextPointer to the Icecast client context
[out]metadataPointer to the user buffer
[in]sizeMaximum number of bytes that can be read
[out]lengthNumber of bytes that have been read
Returns
Error code

Definition at line 270 of file icecast_client.c.

◆ icecastClientReadStream()

error_t icecastClientReadStream ( IcecastClientContext context,
uint8_t *  data,
size_t  size,
size_t *  length,
systime_t  timeout 
)

Copy data from input stream.

Parameters
[in]contextPointer to the Icecast client context
[out]dataPointer to the user buffer
[in]sizeMaximum number of bytes that can be read
[out]lengthNumber of bytes that have been read
[in]timeoutMaximum time to wait before returning
Returns
Error code

Definition at line 197 of file icecast_client.c.

◆ icecastClientStart()

error_t icecastClientStart ( IcecastClientContext context)

Start Icecast client.

Parameters
[in]contextPointer to the Icecast client context
Returns
Error code

Definition at line 169 of file icecast_client.c.

◆ icecastClientTask()

void icecastClientTask ( void *  param)

Icecast client task.

Parameters
[in]paramPointer to the Icecast client context

Definition at line 298 of file icecast_client.c.