Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
cef11803
Commit
cef11803
authored
Apr 11, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/pulse_audio_enc: add buffer fullness messages
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
bc31a579
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
pulse_audio_enc.c
libavdevice/pulse_audio_enc.c
+18
-0
No files found.
libavdevice/pulse_audio_enc.c
View file @
cef11803
...
@@ -48,13 +48,27 @@ static void pulse_stream_writable(pa_stream *stream, size_t nbytes, void *userda
...
@@ -48,13 +48,27 @@ static void pulse_stream_writable(pa_stream *stream, size_t nbytes, void *userda
{
{
AVFormatContext
*
h
=
userdata
;
AVFormatContext
*
h
=
userdata
;
PulseData
*
s
=
h
->
priv_data
;
PulseData
*
s
=
h
->
priv_data
;
int64_t
val
=
nbytes
;
if
(
stream
!=
s
->
stream
)
if
(
stream
!=
s
->
stream
)
return
;
return
;
avdevice_dev_to_app_control_message
(
h
,
AV_DEV_TO_APP_BUFFER_WRITABLE
,
&
val
,
sizeof
(
val
));
pa_threaded_mainloop_signal
(
s
->
mainloop
,
0
);
pa_threaded_mainloop_signal
(
s
->
mainloop
,
0
);
}
}
static
void
pulse_overflow
(
pa_stream
*
stream
,
void
*
userdata
)
{
AVFormatContext
*
h
=
userdata
;
avdevice_dev_to_app_control_message
(
h
,
AV_DEV_TO_APP_BUFFER_OVERFLOW
,
NULL
,
0
);
}
static
void
pulse_underflow
(
pa_stream
*
stream
,
void
*
userdata
)
{
AVFormatContext
*
h
=
userdata
;
avdevice_dev_to_app_control_message
(
h
,
AV_DEV_TO_APP_BUFFER_UNDERFLOW
,
NULL
,
0
);
}
static
void
pulse_stream_state
(
pa_stream
*
stream
,
void
*
userdata
)
static
void
pulse_stream_state
(
pa_stream
*
stream
,
void
*
userdata
)
{
{
PulseData
*
s
=
userdata
;
PulseData
*
s
=
userdata
;
...
@@ -214,6 +228,8 @@ static av_cold int pulse_write_trailer(AVFormatContext *h)
...
@@ -214,6 +228,8 @@ static av_cold int pulse_write_trailer(AVFormatContext *h)
pa_stream_disconnect
(
s
->
stream
);
pa_stream_disconnect
(
s
->
stream
);
pa_stream_set_state_callback
(
s
->
stream
,
NULL
,
NULL
);
pa_stream_set_state_callback
(
s
->
stream
,
NULL
,
NULL
);
pa_stream_set_write_callback
(
s
->
stream
,
NULL
,
NULL
);
pa_stream_set_write_callback
(
s
->
stream
,
NULL
,
NULL
);
pa_stream_set_overflow_callback
(
s
->
stream
,
NULL
,
NULL
);
pa_stream_set_underflow_callback
(
s
->
stream
,
NULL
,
NULL
);
pa_stream_unref
(
s
->
stream
);
pa_stream_unref
(
s
->
stream
);
s
->
stream
=
NULL
;
s
->
stream
=
NULL
;
}
}
...
@@ -353,6 +369,8 @@ static av_cold int pulse_write_header(AVFormatContext *h)
...
@@ -353,6 +369,8 @@ static av_cold int pulse_write_header(AVFormatContext *h)
}
}
pa_stream_set_state_callback
(
s
->
stream
,
pulse_stream_state
,
s
);
pa_stream_set_state_callback
(
s
->
stream
,
pulse_stream_state
,
s
);
pa_stream_set_write_callback
(
s
->
stream
,
pulse_stream_writable
,
h
);
pa_stream_set_write_callback
(
s
->
stream
,
pulse_stream_writable
,
h
);
pa_stream_set_overflow_callback
(
s
->
stream
,
pulse_overflow
,
h
);
pa_stream_set_underflow_callback
(
s
->
stream
,
pulse_underflow
,
h
);
if
((
ret
=
pa_stream_connect_playback
(
s
->
stream
,
s
->
device
,
&
buffer_attributes
,
if
((
ret
=
pa_stream_connect_playback
(
s
->
stream
,
s
->
device
,
&
buffer_attributes
,
stream_flags
,
NULL
,
NULL
))
<
0
)
{
stream_flags
,
NULL
,
NULL
))
<
0
)
{
...
...
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