webradio/shoutcast.c-Dateireferenz


Ausführliche Beschreibung

SHOUTcast communication routines.

 *
 * $Log$
 *
 * 

Definiert in Datei shoutcast.c.

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define SHOUTCAST_THREAD_STACK   2048
#define SHOUTCAST_QLIST   "www.shoutcast.com/sbin/newxml.phtml"
#define SHOUTCAST_QTUNE   "www.shoutcast.com/sbin/tunein-station.pls"
#define ENCTYP_MPEG   1
#define ENCTYP_AAC   2
#define ENCTYP_AACP   3
#define ENCTYP_OGG   4
#define ENCTYP_WMA   5

Funktionen

static FILE * OpenTcpStream (TCPSOCKET *sock, CONST char *host, u_short port)
static int SendHttpRequest (FILE *stream, HTTP_SCHEME *schm)
static int ShoutCastGetGenreList (void)
 Retrieve a genre list from the SHOUTcast server.
int station_cmp (CONST void *ip1, CONST void *ip2)
static int ShoutCastGetStationList (CONST char *genre)
 Retrieve station list of a specified genre from SHOUTcast.
char * ShoutCastGetGenre (int idx)
char * ShoutCastGetStationName (char *genre, int idx)
int ShoutCastAddStation (int idx, int pos)
 Query streams of a specified station and create a favorites list entry.
int ShoutCastGetPlayList (int id)
static int ProcessMetaData (TCPSOCKET *sock, SHOUTCASTINFO *sci, u_int *status)
 Process embedded meta data.
void ShoutCastThread (void *arg)
 SHOUTcast receiver thread.
int ShoutCastCreate (RECEIVERINFO *rip)
 Create a SHOUTcast receiver instance.
int ShoutCastSetup (RECEIVERINFO *rip, STATIONINFO *sip)
 Setup SHOUTcast receiver.

Variablen

static char station_genre [32]
static UXML_NODE * genre_tree
static int station_cnt
static STATION_INFO * station_list
RECEIVERPLUGIN rpiShoutcast
 Receiver plug-in reference structure.


Makro-Dokumentation

#define SHOUTCAST_THREAD_STACK   2048

Definiert in Zeile 89 der Datei shoutcast.c.

Wird benutzt von ShoutCastCreate().

#define SHOUTCAST_QLIST   "www.shoutcast.com/sbin/newxml.phtml"

Definiert in Zeile 93 der Datei shoutcast.c.

Wird benutzt von ShoutCastGetGenreList() und ShoutCastGetStationList().

#define SHOUTCAST_QTUNE   "www.shoutcast.com/sbin/tunein-station.pls"

Definiert in Zeile 94 der Datei shoutcast.c.

Wird benutzt von ShoutCastAddStation() und ShoutCastGetPlayList().

#define ENCTYP_MPEG   1

Definiert in Zeile 99 der Datei shoutcast.c.

#define ENCTYP_AAC   2

Definiert in Zeile 100 der Datei shoutcast.c.

#define ENCTYP_AACP   3

Definiert in Zeile 101 der Datei shoutcast.c.

#define ENCTYP_OGG   4

Definiert in Zeile 102 der Datei shoutcast.c.

#define ENCTYP_WMA   5

Definiert in Zeile 103 der Datei shoutcast.c.


Dokumentation der Funktionen

static FILE* OpenTcpStream ( TCPSOCKET *  sock,
CONST char *  host,
u_short  port 
) [static]

Definiert in Zeile 116 der Datei shoutcast.c.

Benutzt LOG_SHOUTCAST, LOG_STATION, LogMsg(), MAX_TCPRCV_WAIT und TcpHostConnect().

Wird benutzt von ShoutCastAddStation(), ShoutCastGetGenreList() und ShoutCastGetStationList().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

LogMsgTcpHostConnect

static int SendHttpRequest ( FILE *  stream,
HTTP_SCHEME schm 
) [static]

Definiert in Zeile 133 der Datei shoutcast.c.

Benutzt proxy, HTTP_PROXY::proxy_port, HTTP_SCHEME::schm_host, HTTP_SCHEME::schm_path und HTTP_SCHEME::schm_uri.

Wird benutzt von ShoutCastAddStation(), ShoutCastGetGenreList() und ShoutCastGetStationList().

static int ShoutCastGetGenreList ( void   )  [static]

Retrieve a genre list from the SHOUTcast server.

Definiert in Zeile 152 der Datei shoutcast.c.

Benutzt genre_tree, HttpSchemeParse(), HttpSchemeRelease(), OpenTcpStream(), HTTP_SCHEME::schm_host, HTTP_SCHEME::schm_portnum, SendHttpRequest() und SHOUTCAST_QLIST.

Wird benutzt von ShoutCastGetGenre().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

HttpSchemeParseHttpSchemeReleaseOpenTcpStreamSendHttpRequestLogMsgTcpHostConnect

int station_cmp ( CONST void *  ip1,
CONST void *  ip2 
)

Definiert in Zeile 183 der Datei shoutcast.c.

Wird benutzt von ShoutCastGetStationList().

static int ShoutCastGetStationList ( CONST char *  genre  )  [static]

Retrieve station list of a specified genre from SHOUTcast.

Definiert in Zeile 192 der Datei shoutcast.c.

Benutzt HttpSchemeParse(), HttpSchemeRelease(), LOG_SHOUTCAST, LogMsg(), OpenTcpStream(), HTTP_SCHEME::schm_host, HTTP_SCHEME::schm_portnum, SendHttpRequest(), SHOUTCAST_QLIST, station_cmp(), station_cnt, station_genre und station_list.

Wird benutzt von ShoutCastGetStationName().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

HttpSchemeParseHttpSchemeReleaseLogMsgOpenTcpStreamSendHttpRequeststation_cmpTcpHostConnect

char* ShoutCastGetGenre ( int  idx  ) 

Definiert in Zeile 275 der Datei shoutcast.c.

Wird benutzt von CgiShoutCastGenres().

char* ShoutCastGetStationName ( char *  genre,
int  idx 
)

Definiert in Zeile 298 der Datei shoutcast.c.

Wird benutzt von CgiShoutCastStations().

int ShoutCastAddStation ( int  idx,
int  pos 
)

Query streams of a specified station and create a favorites list entry.

Parameter:
idx SHOUTcast station list index.
pos Favorites list index.
Rückgabe:
0 on success, -1 otherwise.

Definiert in Zeile 317 der Datei shoutcast.c.

Wird benutzt von CgiShoutCastControl().

int ShoutCastGetPlayList ( int  id  ) 

Definiert in Zeile 374 der Datei shoutcast.c.

Benutzt HttpSchemeParse(), HttpSchemeRelease(), LOG_SHOUTCAST, LOG_STATION, LogMsg(), MAX_TCPRCV_WAIT, proxy, HTTP_PROXY::proxy_port, HTTP_SCHEME::schm_host, HTTP_SCHEME::schm_path, HTTP_SCHEME::schm_portnum, HTTP_SCHEME::schm_uri, SHOUTCAST_QTUNE, TcpGetLine(), TcpHostConnect() und TcpPutString().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

HttpSchemeParseHttpSchemeReleaseLogMsgTcpGetLineTcpHostConnectTcpPutString

static int ProcessMetaData ( TCPSOCKET *  sock,
SHOUTCASTINFO sci,
u_int *  status 
) [static]

Process embedded meta data.

Definiert in Zeile 464 der Datei shoutcast.c.

Benutzt DIST_FORCE, LOG_SHOUTCAST, LogMsg(), SHOUTCASTINFO::sci_metatitle, SHOUTCASTINFO::sci_metaurl, strdup(), TcpGetBuffer() und UserIfShowStatus().

Wird benutzt von ShoutCastThread().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

LogMsgstrdupTcpGetBufferUserIfShowStatus

void ShoutCastThread ( void *  arg  ) 

SHOUTcast receiver thread.

Reads audio data from a TCP socket and passes it to a ring buffer. Meta data is parsed and removed from the audio stream.

Parameter:
arg Pointer to the player info structure.

Definiert in Zeile 544 der Datei shoutcast.c.

Benutzt DIST_FORCE, LOG_ERROR, LOG_SHOUTCAST, LOG_WARN, LogMsg(), MAX_WAIT_MP3BUF_FILLED, ProcessMetaData(), RECEIVERINFO::ri_bcast, RECEIVERINFO::ri_cmdevt, RECEIVERINFO::ri_decoder, RECEIVERINFO::ri_sip, RECEIVERINFO::ri_status, RECEIVERINFO::ri_stsevt, RSTAT_BUFFERING, RSTAT_IDLE, RSTAT_RUNNING, RSTAT_START, RSTAT_STOP, SHOUTCASTINFO::sci_metaint, SHOUTCASTINFO::sci_metapos und UserIfShowStatus().

Wird benutzt von ShoutCastCreate().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

LogMsgProcessMetaDataUserIfShowStatusstrdupTcpGetBuffer

int ShoutCastCreate ( RECEIVERINFO rip  ) 

Create a SHOUTcast receiver instance.

Parameter:
rip Pointer to the receiver information structure.
Rückgabe:
0 on success, -1 otherwise.

Definiert in Zeile 699 der Datei shoutcast.c.

Benutzt RECEIVERINFO::ri_bcast, SHOUTCAST_THREAD_STACK und ShoutCastThread().

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

ShoutCastThreadLogMsgProcessMetaDataUserIfShowStatusstrdupTcpGetBuffer

int ShoutCastSetup ( RECEIVERINFO rip,
STATIONINFO sip 
)

Setup SHOUTcast receiver.

Parses the header lines of the HTTP response.

Rückgabe:
0 on success, or -1 if the server responded with an error code or doesn't seem to provide a SHOUTcast stream.

Definiert in Zeile 725 der Datei shoutcast.c.

Benutzt CONTENT_TYPE_AACP, CONTENT_TYPE_MP3, CONTENT_TYPE_OGG, CONTENT_TYPE_UNKNOWN, PROTOCOL_TYPE_ICECAST, PROTOCOL_TYPE_SHOUTCAST, RECEIVERINFO::ri_bcast, SHOUTCASTINFO::sci_metaint, STATIONINFO::si_bitrate, STATIONINFO::si_content, STATIONINFO::si_genre, STATIONINFO::si_header, STATIONINFO::si_name und STATIONINFO::si_protocol.


Variablen-Dokumentation

char station_genre[32] [static]

Definiert in Zeile 96 der Datei shoutcast.c.

Wird benutzt von ShoutCastGetStationList() und ShoutCastGetStationName().

UXML_NODE* genre_tree [static]

Definiert in Zeile 97 der Datei shoutcast.c.

Wird benutzt von ShoutCastGetGenre() und ShoutCastGetGenreList().

int station_cnt [static]

Definiert in Zeile 113 der Datei shoutcast.c.

Wird benutzt von ShoutCastAddStation(), ShoutCastGetStationList() und ShoutCastGetStationName().

STATION_INFO* station_list [static]

Definiert in Zeile 114 der Datei shoutcast.c.

Wird benutzt von ShoutCastAddStation(), ShoutCastGetStationList() und ShoutCastGetStationName().

RECEIVERPLUGIN rpiShoutcast

Initialisierung:

Receiver plug-in reference structure.

Used by the application to create a SHOUTcast receiver instance.

Definiert in Zeile 796 der Datei shoutcast.c.

Wird benutzt von main().


© 2008 by egnite GmbH - besuchen Sie www.ethernut.de