Commit 8b0d056a authored by Martin Finkel's avatar 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
......@@ -39,7 +39,7 @@ static void* Hwnd;
extern "C" libvlc_media_player_t* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API
CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
{
/*if(libvlc == NULL)
if(libvlc == NULL)
{
DEBUG("libvlc is NULL, aborting...");
return NULL;
......@@ -54,13 +54,13 @@ CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
return NULL;
}
mp = libvlc_media_player_new(inst);*/
mp = libvlc_media_player_new(inst);
RenderAPI* s_CurrentAPI;
/*if (mp == NULL) {
if (mp == NULL) {
DEBUG("Error initializing media player");
goto err;
}*/
}
DEBUG("Calling... Initialize Render API \n");
......@@ -75,20 +75,16 @@ CreateAndInitMediaPlayer(libvlc_instance_t* libvlc)
DEBUG("s_CurrentAPI is NULL \n");
}
// DEBUG("Calling... SetupTextureInfo \n");
// s_CurrentAPI->SetupTextureInfo(Width, Height, Hwnd);
DEBUG("Calling... ProcessDeviceEvent \n");
s_CurrentAPI->ProcessDeviceEvent(kUnityGfxDeviceEventInitialize, s_UnityInterfaces);
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:
if ( mp ) {
// Stop playing
......@@ -104,7 +100,10 @@ err:
extern "C" void* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API
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) {
DEBUG("Error, no Render API");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment