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
4d1ce702
Commit
4d1ce702
authored
Aug 04, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/pipewire: implement Pause()
parent
52577ac8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
PipeWireOutputPlugin.cxx
src/output/plugins/PipeWireOutputPlugin.cxx
+18
-1
No files found.
src/output/plugins/PipeWireOutputPlugin.cxx
View file @
4d1ce702
...
...
@@ -58,6 +58,7 @@ class PipeWireOutput final : AudioOutput {
bool
disconnected
;
bool
interrupted
;
bool
paused
;
bool
drained
;
explicit
PipeWireOutput
(
const
ConfigBlock
&
block
);
...
...
@@ -139,7 +140,7 @@ private:
void
Drain
()
override
;
void
Cancel
()
noexcept
override
;
// TODO:
bool Pause() noexcept override;
bool
Pause
()
noexcept
override
;
};
static
constexpr
auto
stream_events
=
PipeWireOutput
::
MakeStreamEvents
();
...
...
@@ -287,6 +288,7 @@ void
PipeWireOutput
::
Open
(
AudioFormat
&
audio_format
)
{
disconnected
=
false
;
paused
=
false
;
drained
=
true
;
auto
props
=
pw_properties_new
(
PW_KEY_MEDIA_TYPE
,
"Audio"
,
...
...
@@ -379,6 +381,9 @@ PipeWireOutput::Play(const void *chunk, size_t size)
{
const
PipeWire
::
ThreadLoopLock
lock
(
thread_loop
);
if
(
paused
)
pw_stream_set_active
(
stream
,
true
);
while
(
true
)
{
CheckThrowError
();
...
...
@@ -416,6 +421,18 @@ PipeWireOutput::Cancel() noexcept
ring_buffer
->
reset
();
}
bool
PipeWireOutput
::
Pause
()
noexcept
{
const
PipeWire
::
ThreadLoopLock
lock
(
thread_loop
);
interrupted
=
false
;
paused
=
true
;
pw_stream_set_active
(
stream
,
false
);
return
true
;
}
const
struct
AudioOutputPlugin
pipewire_output_plugin
=
{
"pipewire"
,
nullptr
,
...
...
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