HaxeVLC icon indicating copy to clipboard operation
HaxeVLC copied to clipboard

vs 2017 update

Open bluelemonade opened this issue 7 years ago • 12 comments

hi,

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

thanks

bluelemonade avatar Nov 23 '18 19:11 bluelemonade

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.

phfernandez avatar Feb 04 '19 12:02 phfernandez

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

datee avatar Feb 22 '19 20:02 datee

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.

talvarez75 avatar Feb 18 '20 21:02 talvarez75

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.

phfernandez avatar Feb 18 '20 21:02 phfernandez

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.

talvarez75 avatar Feb 19 '20 13:02 talvarez75

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.

phfernandez avatar Feb 19 '20 22:02 phfernandez

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 avatar Feb 19 '20 22:02 talvarez75

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!

talvarez75 avatar Feb 20 '20 15:02 talvarez75

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.

phfernandez avatar Feb 20 '20 19:02 phfernandez

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!

talvarez75 avatar Feb 21 '20 13:02 talvarez75

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.

phfernandez avatar Feb 21 '20 16:02 phfernandez

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

talvarez75 avatar Feb 21 '20 16:02 talvarez75