Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vs 2017 update #4

Open
bluelemonade opened this issue Nov 23, 2018 · 12 comments
Open

vs 2017 update #4

bluelemonade opened this issue Nov 23, 2018 · 12 comments

Comments

@bluelemonade
Copy link

hi,

are there plans to update the videoplayer to the 2017 version of vs . would be great to have a videoplayer for cpp.

thanks

@phfernandez
Copy link

Hi,
I managed to get the project to compile in Visual Studio 2017 (and probably in any version), just by touching a line of code. In the file: vlc / LibVLC.hx at the end of it, simply add a :: just before the delete, like this:

public inline function dispose (): Void { untyped __cpp __ (':: delete this'); }

I have found another problem with the project. If you analyze the file vlc / VlcBitmap.hx seems to be designed to work with Stage3D and textures, it gives an error on line 275:

texture = Lib.current.stage.stage3Ds [0] .context3D.createRectangleTexture (videoWidth, videoHeight, BGRA, true);

This is because the "context3D" is not created, and there does not seem to be an infrastructure to run the example directly. So either you have to add what is missing in the code or in my case, I have chosen to change the code in VlcBitmap and pass it to BitmapData rectangle (setPixels) without the need for Stage3D (for me it is more convenient).

I found another problem when passing bitmapData bytes. Sometimes the content of libvlc.getPixelData () is null, so the windows executable was hung ... Just check inside the loop other than null.

I have forked the repository here with the modifications:
https://github.com/phfernandez/HaxeVLC/

I hope it is useful.

@datee
Copy link
Owner

datee commented Feb 22, 2019

Hey, thanks for the fixes! I plan to do a updated version at some point, just have been too busy lately!

@talvarez75
Copy link

Hi. Last Fall, I had gotten VLC working with my openfl project thanks to you all. I've been focusing on html5 for the last several months and am now revisiting the windows target. Now, vlcBitmap.stop() (as well as play(videofile), etc.) causes my exe to crash for some reason. Any ideas? I'm not seeing any errors. Thank you.

@phfernandez
Copy link

Hi,
In some situations the exe hung, so in the end I had to comment this line in LibVLC.hx:
public inline function dispose (): Void { //untyped __cpp __ (':: delete this'); }

Maybe it has to do with this. I have no idea if disabling that line causes some memory leak. A priori it worked fine.

@talvarez75
Copy link

Thank you. Unfortunately, that didn't do the trick. Play and stop are crashing...not sure about seek, etc., yet. I'm continuing to troubleshoot and cross my fingers.

@phfernandez
Copy link

What openfl version do you have installed? Version 8.9.5 has a number of problems and regressions. I had problems with bitmapdata in a development ... I have updated to 8.9.6 and it already works correctly.

@talvarez75
Copy link

I have all the latest (openfl, lime, hxcpp) and Visual Studio 2017. This is one of the lines in VLCBitmap.hx causing a crash: libvlc.play(source); I'm stumped.

@talvarez75
Copy link

Well, I went back to your example here: https://github.com/phfernandez/HaxeVLC/ and noticed that I was missing the "plugins" folder in Export > windows > bin. I think that was the problem. Probably lost it using -clean at some point. I'm still troubleshooting a couple of things, but at least the crashing has stopped!! Thank you so much for your contributions!

@phfernandez
Copy link

I'm glad you solved it. On some occasion it also occurred to me that I had cleaned the project and later compiling again I had forgotten to copy the vlc libraries and folders.

@talvarez75
Copy link

I have one more hurdle that I'm dealing with. I want to be able to change the video source. When I do this, the first video plays perfectly, but the 2nd one is distorted and fuzzy if that makes sense. Have you been able to do this? Much appreciated!

@phfernandez
Copy link

I don't remember trying to change the source directly. What I have developed is a player in which to make sure there are no problems, I make a complete clean of vlcBitmap and then create it again with another video. Perhaps it is inconvenient if you need to jump very fast from one video to another but I don't know if there is another better solution.

// cleanVideo
if (vlcBitmap! = null)
{
if (vlcBitmap.isPlaying) vlcBitmap.stop ();
vlcBitmap.dispose ();
videoContainer.removeChild (vlcBitmap);
vlcBitmap = null;
}
// Create new videoplayer
// ...

It may be possible to have two players at the same time and change the video between them. I'm not sure.

@talvarez75
Copy link

This is the direction I'm going. I was trying to create multiple instances, but this seems to be the better option. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants