Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
2aa34882
Commit
2aa34882
authored
Jan 27, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/httpd: move functions into the HttpdOutput class
parent
27f8ef2f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
16 deletions
+74
-16
HttpdClient.cxx
src/output/HttpdClient.cxx
+2
-2
HttpdInternal.hxx
src/output/HttpdInternal.hxx
+72
-14
HttpdOutputPlugin.cxx
src/output/HttpdOutputPlugin.cxx
+0
-0
No files found.
src/output/HttpdClient.cxx
View file @
2aa34882
...
...
@@ -55,7 +55,7 @@ HttpdClient::~HttpdClient()
void
HttpdClient
::
Close
()
{
httpd
_output_remove_client
(
httpd
,
this
);
httpd
->
RemoveClient
(
*
this
);
}
void
...
...
@@ -74,7 +74,7 @@ HttpdClient::BeginResponse()
write_source_id
=
0
;
current_page
=
nullptr
;
httpd
_output_send_header
(
httpd
,
this
);
httpd
->
SendHeader
(
*
this
);
}
/**
...
...
src/output/HttpdInternal.hxx
View file @
2aa34882
...
...
@@ -122,21 +122,79 @@ struct HttpdOutput {
* at the same time.
*/
guint
clients_max
,
clients_cnt
;
};
/**
* Removes a client from the httpd_output.clients linked list.
*/
void
httpd_output_remove_client
(
struct
HttpdOutput
*
httpd
,
HttpdClient
*
client
);
bool
Bind
(
GError
**
error_r
);
void
Unbind
();
/**
* Sends the encoder header to the client. This is called right after
* the response headers have been sent.
*/
void
httpd_output_send_header
(
struct
HttpdOutput
*
httpd
,
HttpdClient
*
client
);
/**
* Caller must lock the mutex.
*/
bool
OpenEncoder
(
struct
audio_format
*
audio_format
,
GError
**
error_r
);
/**
* Caller must lock the mutex.
*/
bool
Open
(
struct
audio_format
*
audio_format
,
GError
**
error_r
);
/**
* Caller must lock the mutex.
*/
void
Close
();
/**
* Check whether there is at least one client.
*
* Caller must lock the mutex.
*/
gcc_pure
bool
HasClients
()
const
{
return
!
clients
.
empty
();
}
/**
* Check whether there is at least one client.
*/
gcc_pure
bool
LockHasClients
()
const
{
const
ScopeLock
protect
(
mutex
);
return
HasClients
();
}
void
AddClient
(
int
fd
);
/**
* Removes a client from the httpd_output.clients linked list.
*/
void
RemoveClient
(
HttpdClient
&
client
);
/**
* Sends the encoder header to the client. This is called
* right after the response headers have been sent.
*/
void
SendHeader
(
HttpdClient
&
client
)
const
;
/**
* Reads data from the encoder (as much as available) and
* returns it as a new #page object.
*/
page
*
ReadPage
();
/**
* Broadcasts a page struct to all clients.
*
* Mutext must not be locked.
*/
void
BroadcastPage
(
struct
page
*
page
);
/**
* Broadcasts data from the encoder to all clients.
*/
void
BroadcastFromEncoder
();
bool
EncodeAndPlay
(
const
void
*
chunk
,
size_t
size
,
GError
**
error_r
);
void
SendTag
(
const
struct
tag
*
tag
);
};
#endif
src/output/HttpdOutputPlugin.cxx
View file @
2aa34882
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment