2016-11-06 12:54:07 -06:00
|
|
|
#ifndef fooraopclientfoo
|
|
|
|
|
#define fooraopclientfoo
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
This file is part of PulseAudio.
|
|
|
|
|
|
|
|
|
|
Copyright 2008 Colin Guthrie
|
|
|
|
|
|
|
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License,
|
|
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
PulseAudio 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 Lesser General Public License
|
|
|
|
|
along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
***/
|
|
|
|
|
|
|
|
|
|
#include <pulse/volume.h>
|
|
|
|
|
|
|
|
|
|
#include <pulsecore/core.h>
|
|
|
|
|
#include <pulsecore/memchunk.h>
|
|
|
|
|
#include <pulsecore/rtpoll.h>
|
|
|
|
|
|
|
|
|
|
typedef enum pa_raop_protocol {
|
|
|
|
|
PA_RAOP_PROTOCOL_TCP,
|
|
|
|
|
PA_RAOP_PROTOCOL_UDP
|
|
|
|
|
} pa_raop_protocol_t;
|
|
|
|
|
|
|
|
|
|
typedef enum pa_raop_encryption {
|
|
|
|
|
PA_RAOP_ENCRYPTION_NONE,
|
|
|
|
|
PA_RAOP_ENCRYPTION_RSA,
|
|
|
|
|
PA_RAOP_ENCRYPTION_FAIRPLAY,
|
|
|
|
|
PA_RAOP_ENCRYPTION_MFISAP,
|
|
|
|
|
PA_RAOP_ENCRYPTION_FAIRPLAY_SAP25
|
|
|
|
|
} pa_raop_encryption_t;
|
|
|
|
|
|
|
|
|
|
typedef enum pa_raop_codec {
|
|
|
|
|
PA_RAOP_CODEC_PCM,
|
|
|
|
|
PA_RAOP_CODEC_ALAC,
|
|
|
|
|
PA_RAOP_CODEC_AAC,
|
|
|
|
|
PA_RAOP_CODEC_AAC_ELD
|
|
|
|
|
} pa_raop_codec_t;
|
|
|
|
|
|
|
|
|
|
typedef struct pa_raop_client pa_raop_client;
|
|
|
|
|
|
|
|
|
|
typedef enum pa_raop_state {
|
|
|
|
|
PA_RAOP_INVALID_STATE,
|
|
|
|
|
PA_RAOP_AUTHENTICATED,
|
|
|
|
|
PA_RAOP_CONNECTED,
|
|
|
|
|
PA_RAOP_RECORDING,
|
|
|
|
|
PA_RAOP_DISCONNECTED
|
|
|
|
|
} pa_raop_state_t;
|
|
|
|
|
|
|
|
|
|
pa_raop_client* pa_raop_client_new(pa_core *core, const char *host, pa_raop_protocol_t protocol,
|
raop: Add autoreconnect feature
This patch adds the autoreconnect feature to the raop module.
This is mainly to be used in a server context, but can be used
also in a desktop usage context.
With autoreconnect feature, the raop module behaves like this:
- At initialisation or in case of the RTSP TCP connection lost, it
tries to reconnect every 5 seconds
- In case of any fatal error, it tries to reconnect every 5 seconds
- In UDP mode, if no timing packets received anymore for a long time,
RTSP connection is closed, then it tries to reconnect..
- After reconnection, once RTSP session has been established again,
playing is resumed automatically.
- When the connection is not established yet (or loss), the sink
behaves like a null sink. In the source code I called it "autonull",
even if autonull is set to autoreconnect param value, it could be
split into two different params.
2019-08-15 08:14:42 +02:00
|
|
|
pa_raop_encryption_t encryption, pa_raop_codec_t codec, bool autoreconnect);
|
2016-11-06 12:54:07 -06:00
|
|
|
void pa_raop_client_free(pa_raop_client *c);
|
|
|
|
|
|
|
|
|
|
int pa_raop_client_authenticate(pa_raop_client *c, const char *password);
|
|
|
|
|
bool pa_raop_client_is_authenticated(pa_raop_client *c);
|
|
|
|
|
|
|
|
|
|
int pa_raop_client_announce(pa_raop_client *c);
|
|
|
|
|
bool pa_raop_client_is_alive(pa_raop_client *c);
|
2019-10-29 08:52:25 +01:00
|
|
|
bool pa_raop_client_is_recording(pa_raop_client *c);
|
2016-11-06 12:54:07 -06:00
|
|
|
bool pa_raop_client_can_stream(pa_raop_client *c);
|
|
|
|
|
int pa_raop_client_stream(pa_raop_client *c);
|
|
|
|
|
int pa_raop_client_set_volume(pa_raop_client *c, pa_volume_t volume);
|
|
|
|
|
int pa_raop_client_flush(pa_raop_client *c);
|
|
|
|
|
int pa_raop_client_teardown(pa_raop_client *c);
|
raop: Add autoreconnect feature
This patch adds the autoreconnect feature to the raop module.
This is mainly to be used in a server context, but can be used
also in a desktop usage context.
With autoreconnect feature, the raop module behaves like this:
- At initialisation or in case of the RTSP TCP connection lost, it
tries to reconnect every 5 seconds
- In case of any fatal error, it tries to reconnect every 5 seconds
- In UDP mode, if no timing packets received anymore for a long time,
RTSP connection is closed, then it tries to reconnect..
- After reconnection, once RTSP session has been established again,
playing is resumed automatically.
- When the connection is not established yet (or loss), the sink
behaves like a null sink. In the source code I called it "autonull",
even if autonull is set to autoreconnect param value, it could be
split into two different params.
2019-08-15 08:14:42 +02:00
|
|
|
void pa_raop_client_disconnect(pa_raop_client *c);
|
2016-11-06 12:54:07 -06:00
|
|
|
|
|
|
|
|
void pa_raop_client_get_frames_per_block(pa_raop_client *c, size_t *size);
|
|
|
|
|
bool pa_raop_client_register_pollfd(pa_raop_client *c, pa_rtpoll *poll, pa_rtpoll_item **poll_item);
|
raop: Add autoreconnect feature
This patch adds the autoreconnect feature to the raop module.
This is mainly to be used in a server context, but can be used
also in a desktop usage context.
With autoreconnect feature, the raop module behaves like this:
- At initialisation or in case of the RTSP TCP connection lost, it
tries to reconnect every 5 seconds
- In case of any fatal error, it tries to reconnect every 5 seconds
- In UDP mode, if no timing packets received anymore for a long time,
RTSP connection is closed, then it tries to reconnect..
- After reconnection, once RTSP session has been established again,
playing is resumed automatically.
- When the connection is not established yet (or loss), the sink
behaves like a null sink. In the source code I called it "autonull",
even if autonull is set to autoreconnect param value, it could be
split into two different params.
2019-08-15 08:14:42 +02:00
|
|
|
bool pa_raop_client_is_timing_fd(pa_raop_client *c, const int fd);
|
2016-11-06 12:54:07 -06:00
|
|
|
pa_volume_t pa_raop_client_adjust_volume(pa_raop_client *c, pa_volume_t volume);
|
|
|
|
|
void pa_raop_client_handle_oob_packet(pa_raop_client *c, const int fd, const uint8_t packet[], ssize_t size);
|
|
|
|
|
ssize_t pa_raop_client_send_audio_packet(pa_raop_client *c, pa_memchunk *block, size_t offset);
|
|
|
|
|
|
|
|
|
|
typedef void (*pa_raop_client_state_cb_t)(pa_raop_state_t state, void *userdata);
|
|
|
|
|
void pa_raop_client_set_state_callback(pa_raop_client *c, pa_raop_client_state_cb_t callback, void *userdata);
|
|
|
|
|
|
|
|
|
|
#endif
|