Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
e38ea904
Commit
e38ea904
authored
Dec 16, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: add event to request pipeline reinitialization
parent
92b8418f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
20 deletions
+24
-20
include/vlc_aout.h
include/vlc_aout.h
+10
-0
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+5
-1
src/audio_output/dec.c
src/audio_output/dec.c
+3
-19
src/audio_output/output.c
src/audio_output/output.c
+6
-0
No files found.
include/vlc_aout.h
View file @
e38ea904
...
...
@@ -205,6 +205,7 @@ struct audio_output
void
(
*
policy_report
)(
audio_output_t
*
,
bool
);
void
(
*
device_report
)(
audio_output_t
*
,
const
char
*
);
int
(
*
gain_request
)(
audio_output_t
*
,
float
);
void
(
*
restart_request
)(
audio_output_t
*
,
unsigned
);
}
event
;
};
...
...
@@ -219,6 +220,10 @@ static const uint32_t pi_vlc_chan_order_wg4[] =
AOUT_CHAN_CENTER
,
AOUT_CHAN_LFE
,
0
};
#define AOUT_RESTART_FILTERS 1
#define AOUT_RESTART_OUTPUT 2
#define AOUT_RESTART_DECODER 4
/*****************************************************************************
* Prototypes
*****************************************************************************/
...
...
@@ -324,6 +329,11 @@ static inline int aout_GainRequest(audio_output_t *aout, float gain)
return
aout
->
event
.
gain_request
(
aout
,
gain
);
}
static
inline
void
aout_RestartRequest
(
audio_output_t
*
aout
,
unsigned
mode
)
{
aout
->
event
.
restart_request
(
aout
,
mode
);
}
VLC_API
int
aout_ChannelsRestart
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
/* */
...
...
src/audio_output/aout_internal.h
View file @
e38ea904
...
...
@@ -143,8 +143,12 @@ int aout_DecGetResetLost(audio_output_t *);
void
aout_DecChangePause
(
audio_output_t
*
,
bool
b_paused
,
mtime_t
i_date
);
void
aout_DecFlush
(
audio_output_t
*
);
bool
aout_DecIsEmpty
(
audio_output_t
*
);
void
aout_RequestRestart
(
audio_output_t
*
,
unsigned
);
void
aout_InputRequestRestart
(
audio_output_t
*
);
static
inline
void
aout_InputRequestRestart
(
audio_output_t
*
aout
)
{
aout_RequestRestart
(
aout
,
AOUT_RESTART_FILTERS
);
}
/* Audio output locking */
static
inline
void
aout_lock
(
audio_output_t
*
p_aout
)
...
...
src/audio_output/dec.c
View file @
e38ea904
...
...
@@ -121,8 +121,6 @@ void aout_DecDelete (audio_output_t *aout)
var_Destroy
(
aout
,
"stereo-mode"
);
}
#define AOUT_RESTART_OUTPUT 1
#define AOUT_RESTART_INPUT 2
static
int
aout_CheckReady
(
audio_output_t
*
aout
)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
...
...
@@ -165,12 +163,10 @@ static int aout_CheckReady (audio_output_t *aout)
* Marks the audio output for restart, to update any parameter of the output
* plug-in (e.g. output device or channel mapping).
*/
static
void
aout_RequestRestart
(
audio_output_t
*
aout
)
void
aout_RequestRestart
(
audio_output_t
*
aout
,
unsigned
mode
)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
/* NOTE: restarting output requires restarting input. */
atomic_fetch_or
(
&
owner
->
restart
,
AOUT_RESTART_OUTPUT
);
atomic_fetch_or
(
&
owner
->
restart
,
mode
);
}
int
aout_ChannelsRestart
(
vlc_object_t
*
obj
,
const
char
*
varname
,
...
...
@@ -185,22 +181,10 @@ int aout_ChannelsRestart (vlc_object_t *obj, const char *varname,
* rebuilding the channel choices. */
var_Destroy
(
aout
,
"stereo-mode"
);
}
aout_RequestRestart
(
aout
);
aout_RequestRestart
(
aout
,
AOUT_RESTART_OUTPUT
);
return
0
;
}
/**
* This function will safely mark aout input to be restarted as soon as
* possible to take configuration changes into account
*/
void
aout_InputRequestRestart
(
audio_output_t
*
aout
)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
atomic_fetch_or
(
&
owner
->
restart
,
AOUT_RESTART_INPUT
);
}
/*
* Buffer management
*/
...
...
src/audio_output/output.c
View file @
e38ea904
...
...
@@ -103,6 +103,11 @@ static void aout_DeviceNotify (audio_output_t *aout, const char *id)
free
(
tmp
);
}
static
void
aout_RestartNotify
(
audio_output_t
*
aout
,
unsigned
mode
)
{
aout_RequestRestart
(
aout
,
mode
);
}
static
int
aout_GainNotify
(
audio_output_t
*
aout
,
float
gain
)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
...
...
@@ -146,6 +151,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
aout
->
event
.
device_report
=
aout_DeviceNotify
;
aout
->
event
.
policy_report
=
aout_PolicyNotify
;
aout
->
event
.
gain_request
=
aout_GainNotify
;
aout
->
event
.
restart_request
=
aout_RestartNotify
;
/* Audio output module initialization */
aout
->
start
=
NULL
;
...
...
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