Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
bdaac334
Commit
bdaac334
authored
Feb 03, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wasapi: split as separate module
parent
0c3e5519
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
25 deletions
+48
-25
modules/audio_output/Makefile.am
modules/audio_output/Makefile.am
+5
-4
modules/audio_output/mmdevice.c
modules/audio_output/mmdevice.c
+31
-8
modules/audio_output/mmdevice.h
modules/audio_output/mmdevice.h
+3
-3
modules/audio_output/wasapi.c
modules/audio_output/wasapi.c
+9
-10
No files found.
modules/audio_output/Makefile.am
View file @
bdaac334
...
...
@@ -57,11 +57,12 @@ if HAVE_JACK
aout_LTLIBRARIES
+=
libjack_plugin.la
endif
libmmdevice_plugin_la_SOURCES
=
audio_output/mmdevice.c audio_output/mmdevice.h
\
audio_output/wasapi.c
libmmdevice_plugin_la_LIBADD
=
-lole32
-lksuser
libmmdevice_plugin_la_SOURCES
=
audio_output/mmdevice.c audio_output/mmdevice.h
libmmdevice_plugin_la_LIBADD
=
-lole32
libwasapi_plugin_la_SOURCES
=
audio_output/wasapi.c
libwasapi_plugin_la_LIBADD
=
-lole32
-lksuser
if
HAVE_WASAPI
aout_LTLIBRARIES
+=
libmmdevice_plugin.la
aout_LTLIBRARIES
+=
libmmdevice_plugin.la
libwasapi_plugin.la
endif
libdirectsound_plugin_la_SOURCES
=
audio_output/directsound.c
\
...
...
modules/audio_output/mmdevice.c
View file @
bdaac334
...
...
@@ -40,6 +40,7 @@ DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd,
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_charset.h>
#include <vlc_modules.h>
#include "audio_output/mmdevice.h"
DEFINE_GUID
(
GUID_VLC_AUD_OUT
,
0x4533f59d
,
0x59ee
,
0x00c6
,
...
...
@@ -74,6 +75,7 @@ static wchar_t default_device[1] = L"";
struct
aout_sys_t
{
aout_stream_t
*
stream
;
/**< Underlying audio output stream */
module_t
*
module
;
#if !VLC_WINSTORE_APP
audio_output_t
*
aout
;
IMMDeviceEnumerator
*
it
;
/**< Device enumerator, NULL when exiting */
...
...
@@ -858,10 +860,27 @@ static HRESULT ActivateDevice(void *opaque, REFIID iid, PROPVARIANT *actparms,
}
#endif
/* VLC_WINSTORE_APP */
static
int
aout_stream_Start
(
void
*
func
,
va_list
ap
)
{
aout_stream_start_t
start
=
func
;
aout_stream_t
*
s
=
va_arg
(
ap
,
aout_stream_t
*
);
audio_sample_format_t
*
fmt
=
va_arg
(
ap
,
audio_sample_format_t
*
);
return
SUCCEEDED
(
start
(
s
,
fmt
,
&
GUID_VLC_AUD_OUT
))
?
VLC_SUCCESS
:
VLC_EGENERIC
;
}
static
void
aout_stream_Stop
(
void
*
func
,
va_list
ap
)
{
aout_stream_stop_t
stop
=
func
;
aout_stream_t
*
s
=
va_arg
(
ap
,
aout_stream_t
*
);
stop
(
s
);
}
static
int
Start
(
audio_output_t
*
aout
,
audio_sample_format_t
*
restrict
fmt
)
{
aout_sys_t
*
sys
=
aout
->
sys
;
HRESULT
hr
;
assert
(
sys
->
stream
==
NULL
);
#if !VLC_WINSTORE_APP
...
...
@@ -882,14 +901,18 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
s
->
owner
.
activate
=
ActivateDevice
;
EnterMTA
();
hr
=
aout_stream_Start
(
s
,
fmt
,
&
GUID_VLC_AUD_OUT
);
if
(
SUCCEEDED
(
hr
))
sys
->
stream
=
s
;
else
vlc_object_release
(
s
);
sys
->
module
=
vlc_module_load
(
s
,
"aout stream"
,
NULL
,
false
,
aout_stream_Start
,
s
,
fmt
);
LeaveMTA
();
return
vlc_FromHR
(
aout
,
hr
);
if
(
sys
->
module
==
NULL
)
{
vlc_object_release
(
s
);
return
-
1
;
}
sys
->
stream
=
s
;
return
0
;
}
static
void
Stop
(
audio_output_t
*
aout
)
...
...
@@ -899,7 +922,7 @@ static void Stop(audio_output_t *aout)
assert
(
sys
->
stream
!=
NULL
);
EnterMTA
();
aout_stream_Stop
(
sys
->
stream
);
vlc_module_unload
(
sys
->
module
,
aout_stream_Stop
,
sys
->
stream
);
LeaveMTA
();
vlc_object_release
(
sys
->
stream
);
...
...
modules/audio_output/mmdevice.h
View file @
bdaac334
...
...
@@ -49,13 +49,13 @@ struct aout_stream
* \param fmt audio output sample format [IN/OUT]
* \param sid audio output session GUID [IN]
*/
HRESULT
aout_stream_Start
(
aout_stream_t
*
s
,
audio_sample_format_t
*
fmt
,
const
GUID
*
sid
);
typedef
HRESULT
(
*
aout_stream_start_t
)(
aout_stream_t
*
s
,
audio_sample_format_t
*
fmt
,
const
GUID
*
sid
);
/**
* Destroys an audio output stream.
*/
void
aout_stream_Stop
(
aout_stream_t
*
);
typedef
HRESULT
(
*
aout_stream_stop_t
)
(
aout_stream_t
*
);
static
inline
HRESULT
aout_stream_TimeGet
(
aout_stream_t
*
s
,
mtime_t
*
delay
)
{
...
...
modules/audio_output/wasapi.c
View file @
bdaac334
...
...
@@ -32,6 +32,7 @@
#include <vlc_common.h>
#include <vlc_aout.h>
#include <vlc_plugin.h>
#include "audio_output/mmdevice.h"
static
LARGE_INTEGER
freq
;
/* performance counters frequency */
...
...
@@ -399,13 +400,11 @@ static void Stop(aout_stream_t *s)
IAudioClient_Release
(
sys
->
client
);
}
HRESULT
aout_stream_Start
(
aout_stream_t
*
s
,
audio_sample_format_t
*
restrict
fmt
,
const
GUID
*
sid
)
{
return
Start
(
s
,
fmt
,
sid
);
}
void
aout_stream_Stop
(
aout_stream_t
*
s
)
{
Stop
(
s
);
}
vlc_module_begin
()
set_shortname
(
"WASAPI"
)
set_description
(
N_
(
"Windows Audio Session API output"
))
set_capability
(
"aout stream"
,
/*50*/
0
)
set_category
(
CAT_AUDIO
)
set_subcategory
(
SUBCAT_AUDIO_AOUT
)
set_callbacks
(
Start
,
Stop
)
vlc_module_end
()
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