MPD
0.20.18
|
#include <HttpdInternal.hxx>
Public Member Functions | |
HttpdOutput (EventLoop &_loop, const ConfigBlock &block) | |
~HttpdOutput () | |
operator AudioOutput * () | |
void | Bind () |
void | Unbind () |
void | OpenEncoder (AudioFormat &audio_format) |
Caller must lock the mutex. More... | |
void | Open (AudioFormat &audio_format) |
Caller must lock the mutex. More... | |
void | Close () |
Caller must lock the mutex. More... | |
gcc_pure bool | HasClients () const noexcept |
Check whether there is at least one client. More... | |
gcc_pure bool | LockHasClients () const noexcept |
Check whether there is at least one client. More... | |
void | AddClient (int fd) |
void | RemoveClient (HttpdClient &client) |
Removes a client from the httpd_output.clients linked list. More... | |
void | SendHeader (HttpdClient &client) const |
Sends the encoder header to the client. More... | |
gcc_pure std::chrono::steady_clock::duration | Delay () const noexcept |
Page * | ReadPage () |
Reads data from the encoder (as much as available) and returns it as a new #page object. More... | |
void | BroadcastPage (Page *page) |
Broadcasts a page struct to all clients. More... | |
void | BroadcastFromEncoder () |
Broadcasts data from the encoder to all clients. More... | |
void | EncodeAndPlay (const void *chunk, size_t size) |
Throws #std::runtime_error on error. More... | |
void | SendTag (const Tag &tag) |
size_t | Play (const void *chunk, size_t size) |
void | CancelAllClients () |
Static Public Member Functions | |
static HttpdOutput * | Cast (AudioOutput *ao) |
Data Fields | |
const char * | content_type |
The MIME type produced by the #encoder. More... | |
Mutex | mutex |
This mutex protects the listener socket and the client list. More... | |
Cond | cond |
This condition gets signalled when an item is removed from #pages. More... | |
char const * | name |
The configured name. More... | |
char const * | genre |
The configured genre. More... | |
char const * | website |
The configured website address. More... | |
Definition at line 51 of file HttpdInternal.hxx.
HttpdOutput::HttpdOutput | ( | EventLoop & | _loop, |
const ConfigBlock & | block | ||
) |
HttpdOutput::~HttpdOutput | ( | ) |
void HttpdOutput::AddClient | ( | int | fd | ) |
void HttpdOutput::Bind | ( | ) |
void HttpdOutput::BroadcastFromEncoder | ( | ) |
Broadcasts data from the encoder to all clients.
void HttpdOutput::BroadcastPage | ( | Page * | page | ) |
Broadcasts a page struct to all clients.
Mutext must not be locked.
void HttpdOutput::CancelAllClients | ( | ) |
|
inlinestatic |
Definition at line 162 of file HttpdInternal.hxx.
void HttpdOutput::Close | ( | ) |
Caller must lock the mutex.
|
noexcept |
void HttpdOutput::EncodeAndPlay | ( | const void * | chunk, |
size_t | size | ||
) |
Throws #std::runtime_error on error.
|
inlinenoexcept |
Check whether there is at least one client.
Caller must lock the mutex.
Definition at line 194 of file HttpdInternal.hxx.
|
inlinenoexcept |
Check whether there is at least one client.
Definition at line 202 of file HttpdInternal.hxx.
void HttpdOutput::Open | ( | AudioFormat & | audio_format | ) |
Caller must lock the mutex.
void HttpdOutput::OpenEncoder | ( | AudioFormat & | audio_format | ) |
Caller must lock the mutex.
Throws #std::runtime_error on error.
|
inline |
Definition at line 155 of file HttpdInternal.hxx.
size_t HttpdOutput::Play | ( | const void * | chunk, |
size_t | size | ||
) |
Page* HttpdOutput::ReadPage | ( | ) |
Reads data from the encoder (as much as available) and returns it as a new #page object.
void HttpdOutput::RemoveClient | ( | HttpdClient & | client | ) |
Removes a client from the httpd_output.clients linked list.
void HttpdOutput::SendHeader | ( | HttpdClient & | client | ) | const |
Sends the encoder header to the client.
This is called right after the response headers have been sent.
void HttpdOutput::SendTag | ( | const Tag & | tag | ) |
void HttpdOutput::Unbind | ( | ) |
Cond HttpdOutput::cond |
This condition gets signalled when an item is removed from #pages.
Definition at line 90 of file HttpdInternal.hxx.
const char* HttpdOutput::content_type |
The MIME type produced by the #encoder.
Definition at line 78 of file HttpdInternal.hxx.
char const* HttpdOutput::genre |
The configured genre.
Definition at line 125 of file HttpdInternal.hxx.
|
mutable |
This mutex protects the listener socket and the client list.
Definition at line 84 of file HttpdInternal.hxx.
char const* HttpdOutput::name |
The configured name.
Definition at line 121 of file HttpdInternal.hxx.
char const* HttpdOutput::website |
The configured website address.
Definition at line 129 of file HttpdInternal.hxx.