Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Finkel
vlc-unity
Commits
8b0d056a
Commit
8b0d056a
authored
Oct 09, 2019
by
Martin Finkel
Browse files
For the rest of the code to work, you still need a mediaplayer right now
Not subscribing to d3d callbacks though
parent
d85c9622
Changes
1
Show whitespace changes
Inline
Side-by-side
Plugin/RenderingPlugin.cpp
View file @
8b0d056a
...
@@ -39,7 +39,7 @@ static void* Hwnd;
...
@@ -39,7 +39,7 @@ static void* Hwnd;
extern
"C"
libvlc_media_player_t
*
UNITY_INTERFACE_EXPORT
UNITY_INTERFACE_API
extern
"C"
libvlc_media_player_t
*
UNITY_INTERFACE_EXPORT
UNITY_INTERFACE_API
CreateAndInitMediaPlayer
(
libvlc_instance_t
*
libvlc
)
CreateAndInitMediaPlayer
(
libvlc_instance_t
*
libvlc
)
{
{
/*
if(libvlc == NULL)
if
(
libvlc
==
NULL
)
{
{
DEBUG
(
"libvlc is NULL, aborting..."
);
DEBUG
(
"libvlc is NULL, aborting..."
);
return
NULL
;
return
NULL
;
...
@@ -54,13 +54,13 @@ CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
...
@@ -54,13 +54,13 @@ CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
return
NULL
;
return
NULL
;
}
}
mp = libvlc_media_player_new(inst);
*/
mp
=
libvlc_media_player_new
(
inst
);
RenderAPI
*
s_CurrentAPI
;
RenderAPI
*
s_CurrentAPI
;
/*
if (mp == NULL) {
if
(
mp
==
NULL
)
{
DEBUG
(
"Error initializing media player"
);
DEBUG
(
"Error initializing media player"
);
goto
err
;
goto
err
;
}
*/
}
DEBUG
(
"Calling... Initialize Render API
\n
"
);
DEBUG
(
"Calling... Initialize Render API
\n
"
);
...
@@ -75,20 +75,16 @@ CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
...
@@ -75,20 +75,16 @@ CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
DEBUG
(
"s_CurrentAPI is NULL
\n
"
);
DEBUG
(
"s_CurrentAPI is NULL
\n
"
);
}
}
// DEBUG("Calling... SetupTextureInfo \n");
// s_CurrentAPI->SetupTextureInfo(Width, Height, Hwnd);
DEBUG
(
"Calling... ProcessDeviceEvent
\n
"
);
DEBUG
(
"Calling... ProcessDeviceEvent
\n
"
);
s_CurrentAPI
->
ProcessDeviceEvent
(
kUnityGfxDeviceEventInitialize
,
s_UnityInterfaces
);
s_CurrentAPI
->
ProcessDeviceEvent
(
kUnityGfxDeviceEventInitialize
,
s_UnityInterfaces
);
DEBUG
(
"Calling... setVlcContext s_CurrentAPI=%p mp=%p"
,
s_CurrentAPI
,
mp
);
DEBUG
(
"Calling... setVlcContext s_CurrentAPI=%p mp=%p"
,
s_CurrentAPI
,
mp
);
//s_CurrentAPI->setVlcContext(mp);
//
s_CurrentAPI->setVlcContext(mp);
contexts
[
NULL
]
=
s_CurrentAPI
;
contexts
[
mp
]
=
s_CurrentAPI
;
return
NULL
;
return
mp
;
err:
err:
if
(
mp
)
{
if
(
mp
)
{
// Stop playing
// Stop playing
...
@@ -104,7 +100,10 @@ err:
...
@@ -104,7 +100,10 @@ err:
extern
"C"
void
*
UNITY_INTERFACE_EXPORT
UNITY_INTERFACE_API
extern
"C"
void
*
UNITY_INTERFACE_EXPORT
UNITY_INTERFACE_API
getVideoFrameVLC
(
libvlc_media_player_t
*
mp
,
bool
*
updated
)
getVideoFrameVLC
(
libvlc_media_player_t
*
mp
,
bool
*
updated
)
{
{
RenderAPI
*
s_CurrentAPI
=
contexts
.
find
(
NULL
)
->
second
;
if
(
mp
==
NULL
)
return
NULL
;
RenderAPI
*
s_CurrentAPI
=
contexts
.
find
(
mp
)
->
second
;
if
(
!
s_CurrentAPI
)
{
if
(
!
s_CurrentAPI
)
{
DEBUG
(
"Error, no Render API"
);
DEBUG
(
"Error, no Render API"
);
...
...
Write
Preview
Supports
Markdown
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