From 27f8ef2f338440f0d4d258f0f2dfc3ca88e83ab2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 27 Jan 2013 23:21:39 +0100 Subject: [PATCH] output/httpd: rename struct httpd_output --- src/output/HttpdClient.cxx | 2 +- src/output/HttpdClient.hxx | 8 ++--- src/output/HttpdInternal.hxx | 6 ++-- src/output/HttpdOutputPlugin.cxx | 50 ++++++++++++++++---------------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/output/HttpdClient.cxx b/src/output/HttpdClient.cxx index 33aad1919..6b1b9c50a 100644 --- a/src/output/HttpdClient.cxx +++ b/src/output/HttpdClient.cxx @@ -335,7 +335,7 @@ httpd_client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition, } } -HttpdClient::HttpdClient(httpd_output *_httpd, int _fd, +HttpdClient::HttpdClient(HttpdOutput *_httpd, int _fd, bool _metadata_supported) :httpd(_httpd), channel(g_io_channel_new_socket(_fd)), diff --git a/src/output/HttpdClient.hxx b/src/output/HttpdClient.hxx index d3ed2746d..8fb7c8b28 100644 --- a/src/output/HttpdClient.hxx +++ b/src/output/HttpdClient.hxx @@ -28,14 +28,14 @@ #include -struct httpd_output; +struct HttpdOutput; struct page; class HttpdClient final { /** * The httpd output object this client is connected to. */ - httpd_output *const httpd; + HttpdOutput *const httpd; /** * The TCP socket. @@ -140,11 +140,11 @@ public: * @param httpd the HTTP output device * @param fd the socket file descriptor */ - HttpdClient(httpd_output *httpd, int _fd, bool _metadata_supported); + HttpdClient(HttpdOutput *httpd, int _fd, bool _metadata_supported); /** * Note: this does not remove the client from the - * #httpd_output object. + * #HttpdOutput object. */ ~HttpdClient(); diff --git a/src/output/HttpdInternal.hxx b/src/output/HttpdInternal.hxx index 601c43162..e948afa1b 100644 --- a/src/output/HttpdInternal.hxx +++ b/src/output/HttpdInternal.hxx @@ -38,7 +38,7 @@ class HttpdClient; -struct httpd_output { +struct HttpdOutput { struct audio_output base; /** @@ -128,7 +128,7 @@ struct httpd_output { * Removes a client from the httpd_output.clients linked list. */ void -httpd_output_remove_client(struct httpd_output *httpd, +httpd_output_remove_client(struct HttpdOutput *httpd, HttpdClient *client); /** @@ -136,7 +136,7 @@ httpd_output_remove_client(struct httpd_output *httpd, * the response headers have been sent. */ void -httpd_output_send_header(struct httpd_output *httpd, +httpd_output_send_header(struct HttpdOutput *httpd, HttpdClient *client); #endif diff --git a/src/output/HttpdOutputPlugin.cxx b/src/output/HttpdOutputPlugin.cxx index d1a1a36df..985a10b7a 100644 --- a/src/output/HttpdOutputPlugin.cxx +++ b/src/output/HttpdOutputPlugin.cxx @@ -61,7 +61,7 @@ httpd_output_quark(void) */ G_GNUC_PURE static bool -httpd_output_has_clients(const httpd_output *httpd) +httpd_output_has_clients(const HttpdOutput *httpd) { return !httpd->clients.empty(); } @@ -71,7 +71,7 @@ httpd_output_has_clients(const httpd_output *httpd) */ G_GNUC_PURE static bool -httpd_output_lock_has_clients(const httpd_output *httpd) +httpd_output_lock_has_clients(const HttpdOutput *httpd) { const ScopeLock protect(httpd->mutex); return httpd_output_has_clients(httpd); @@ -82,7 +82,7 @@ httpd_listen_in_event(int fd, const struct sockaddr *address, size_t address_length, int uid, void *ctx); static bool -httpd_output_bind(httpd_output *httpd, GError **error_r) +httpd_output_bind(HttpdOutput *httpd, GError **error_r) { httpd->open = false; @@ -91,7 +91,7 @@ httpd_output_bind(httpd_output *httpd, GError **error_r) } static void -httpd_output_unbind(httpd_output *httpd) +httpd_output_unbind(HttpdOutput *httpd) { assert(!httpd->open); @@ -103,7 +103,7 @@ static struct audio_output * httpd_output_init(const struct config_param *param, GError **error) { - httpd_output *httpd = new httpd_output(); + HttpdOutput *httpd = new HttpdOutput(); if (!ao_base_init(&httpd->base, &httpd_output_plugin, param, error)) { g_free(httpd); return NULL; @@ -176,7 +176,7 @@ httpd_output_init(const struct config_param *param, static void httpd_output_finish(struct audio_output *ao) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; if (httpd->metadata) page_unref(httpd->metadata); @@ -189,10 +189,10 @@ httpd_output_finish(struct audio_output *ao) /** * Creates a new #HttpdClient object and adds it into the - * httpd_output.clients linked list. + * HttpdOutput.clients linked list. */ static void -httpd_client_add(httpd_output *httpd, int fd) +httpd_client_add(HttpdOutput *httpd, int fd) { httpd->clients.emplace_front(httpd, fd, httpd->encoder->plugin->tag == NULL); @@ -207,7 +207,7 @@ static void httpd_listen_in_event(int fd, const struct sockaddr *address, size_t address_length, G_GNUC_UNUSED int uid, void *ctx) { - httpd_output *httpd = (httpd_output *)ctx; + HttpdOutput *httpd = (HttpdOutput *)ctx; /* the listener socket has become readable - a client has connected */ @@ -258,7 +258,7 @@ httpd_listen_in_event(int fd, const struct sockaddr *address, * as a new #page object. */ static struct page * -httpd_output_read_page(httpd_output *httpd) +httpd_output_read_page(HttpdOutput *httpd) { if (httpd->unflushed_input >= 65536) { /* we have fed a lot of input into the encoder, but it @@ -288,7 +288,7 @@ httpd_output_read_page(httpd_output *httpd) } static bool -httpd_output_encoder_open(httpd_output *httpd, +httpd_output_encoder_open(HttpdOutput *httpd, struct audio_format *audio_format, GError **error) { @@ -308,7 +308,7 @@ httpd_output_encoder_open(httpd_output *httpd, static bool httpd_output_enable(struct audio_output *ao, GError **error_r) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; return httpd_output_bind(httpd, error_r); } @@ -316,7 +316,7 @@ httpd_output_enable(struct audio_output *ao, GError **error_r) static void httpd_output_disable(struct audio_output *ao) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; httpd_output_unbind(httpd); } @@ -325,7 +325,7 @@ static bool httpd_output_open(struct audio_output *ao, struct audio_format *audio_format, GError **error) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; assert(httpd->clients.empty()); @@ -349,7 +349,7 @@ httpd_output_open(struct audio_output *ao, struct audio_format *audio_format, static void httpd_output_close(struct audio_output *ao) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; const ScopeLock protect(httpd->mutex); @@ -366,7 +366,7 @@ httpd_output_close(struct audio_output *ao) } void -httpd_output_remove_client(httpd_output *httpd, HttpdClient *client) +httpd_output_remove_client(HttpdOutput *httpd, HttpdClient *client) { assert(httpd != NULL); assert(httpd->clients_cnt > 0); @@ -384,7 +384,7 @@ httpd_output_remove_client(httpd_output *httpd, HttpdClient *client) } void -httpd_output_send_header(httpd_output *httpd, HttpdClient *client) +httpd_output_send_header(HttpdOutput *httpd, HttpdClient *client) { if (httpd->header != NULL) client->PushPage(httpd->header); @@ -393,7 +393,7 @@ httpd_output_send_header(httpd_output *httpd, HttpdClient *client) static unsigned httpd_output_delay(struct audio_output *ao) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; if (!httpd_output_lock_has_clients(httpd) && httpd->base.pause) { /* if there's no client and this output is paused, @@ -417,7 +417,7 @@ httpd_output_delay(struct audio_output *ao) * Broadcasts a page struct to all clients. */ static void -httpd_output_broadcast_page(httpd_output *httpd, struct page *page) +httpd_output_broadcast_page(HttpdOutput *httpd, struct page *page) { assert(page != NULL); @@ -430,7 +430,7 @@ httpd_output_broadcast_page(httpd_output *httpd, struct page *page) * Broadcasts data from the encoder to all clients. */ static void -httpd_output_encoder_to_clients(httpd_output *httpd) +httpd_output_encoder_to_clients(HttpdOutput *httpd) { httpd->mutex.lock(); for (auto &client : httpd->clients) { @@ -449,7 +449,7 @@ httpd_output_encoder_to_clients(httpd_output *httpd) } static bool -httpd_output_encode_and_play(httpd_output *httpd, +httpd_output_encode_and_play(HttpdOutput *httpd, const void *chunk, size_t size, GError **error) { if (!encoder_write(httpd->encoder, chunk, size, error)) @@ -466,7 +466,7 @@ static size_t httpd_output_play(struct audio_output *ao, const void *chunk, size_t size, GError **error_r) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; if (httpd_output_lock_has_clients(httpd)) { if (!httpd_output_encode_and_play(httpd, chunk, size, error_r)) @@ -483,7 +483,7 @@ httpd_output_play(struct audio_output *ao, const void *chunk, size_t size, static bool httpd_output_pause(struct audio_output *ao) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; if (httpd_output_lock_has_clients(httpd)) { static const char silence[1020] = { 0 }; @@ -497,7 +497,7 @@ httpd_output_pause(struct audio_output *ao) static void httpd_output_tag(struct audio_output *ao, const struct tag *tag) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; assert(tag != NULL); @@ -546,7 +546,7 @@ httpd_output_tag(struct audio_output *ao, const struct tag *tag) static void httpd_output_cancel(struct audio_output *ao) { - httpd_output *httpd = (httpd_output *)ao; + HttpdOutput *httpd = (HttpdOutput *)ao; const ScopeLock protect(httpd->mutex); for (auto &client : httpd->clients)