Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
libvlcpp
Commits
701e84ad
Commit
701e84ad
authored
Feb 13, 2015
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InstanceCX: Initialize MMDevice
parent
a909c5bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
cppcx/InstanceCX.cpp
cppcx/InstanceCX.cpp
+23
-1
No files found.
cppcx/InstanceCX.cpp
View file @
701e84ad
...
...
@@ -25,6 +25,7 @@
#include <collection.h>
//HACK HACK HACK
#include "MMDeviceLocator.h"
using
namespace
Windows
::
Graphics
::
Display
;
namespace
libVLCX
...
...
@@ -32,7 +33,7 @@ namespace libVLCX
Instance
::
Instance
(
Windows
::
Foundation
::
Collections
::
IVector
<
Platform
::
String
^>^
argv
,
SwapChainPanel
^
panel
)
:
m_chainPanel
(
panel
)
{
int
extraArgs
=
4
;
int
extraArgs
=
5
;
auto
c_argv
=
new
char
*
[
argv
->
Size
+
extraArgs
];
unsigned
int
i
=
0
;
for
(
auto
arg
:
argv
)
...
...
@@ -57,6 +58,27 @@ namespace libVLCX
m_dxManager
->
CreateSwapPanel
(
m_chainPanel
);
UpdateSize
(
m_chainPanel
->
ActualWidth
,
m_chainPanel
->
ActualHeight
);
ComPtr
<
MMDeviceLocator
>
audioReg
=
Make
<
MMDeviceLocator
>
();
audioReg
->
m_AudioClient
=
NULL
;
audioReg
->
m_audioClientReady
=
CreateEventEx
(
NULL
,
TEXT
(
"AudioClientReady"
),
0
,
EVENT_ALL_ACCESS
);
audioReg
->
RegisterForWASAPI
();
void
*
addr
=
NULL
;
DWORD
res
;
while
((
res
=
WaitForSingleObjectEx
(
audioReg
->
m_audioClientReady
,
1000
,
TRUE
))
==
WAIT_TIMEOUT
)
{
OutputDebugStringW
(
L"Waiting for audio
\n
"
);
}
CloseHandle
(
audioReg
->
m_audioClientReady
);
if
(
res
!=
WAIT_OBJECT_0
)
{
OutputDebugString
(
TEXT
(
"Failure while waiting for audio client"
));
return
;
}
char
ptr_astring
[
40
];
sprintf_s
(
ptr_astring
,
"--winstore-audioclient=0x%p"
,
audioReg
->
m_AudioClient
);
argv
[
nbArgs
++
]
=
_strdup
(
ptr_astring
);
char
ptr_d2dstring
[
40
];
sprintf_s
(
ptr_d2dstring
,
"--winrt-d2dcontext=0x%p"
,
m_dxManager
->
cp_d2dContext
);
argv
[
nbArgs
++
]
=
_strdup
(
ptr_d2dstring
);
...
...
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