vlc video audio #133

Closed
passenger94 opened this Issue Jun 18, 2015 · 81 comments

Comments

Projects
None yet
3 participants
@passenger94
Contributor

passenger94 commented Jun 18, 2015

made a "video" branch on my repository

working for me using system libvlc 2.2.0
should work on Windows too according to vlc doc with a method change from libvlc_media_player_set_xwindow to libvlc_media_player_set_hwnd, there's also a cocoa method : libvlc_media_player_set_nsobject ...

tested with simple-video.rb with a remote and a local file

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jun 18, 2015

Contributor

VLC has distribution problems for packaged Shoes - which libs to include in the package and
where to put them on the users system. Very difficult issue when it gets to codecs which may not be FOSS. That's the main reason it was ripped out of Shoes long ago.

Contributor

ccoupe commented Jun 18, 2015

VLC has distribution problems for packaged Shoes - which libs to include in the package and
where to put them on the users system. Very difficult issue when it gets to codecs which may not be FOSS. That's the main reason it was ripped out of Shoes long ago.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jun 18, 2015

Contributor

I was suspecting something like that ... reason why i used installed vlc,
could be set as an option though, like it was, except it could possibly work :-) let the user decide if it can/could deal with the distribution problems.
Of course it may not worth the maintenance work, though it was rather easy to rebuild the feature, i was missing the ability to have an easy solution for sounds inside shoes (i know there is gems for that but vlc is quite an amazing tool, there's also mpv but i found it to be more difficult to install headers)

Contributor

passenger94 commented Jun 18, 2015

I was suspecting something like that ... reason why i used installed vlc,
could be set as an option though, like it was, except it could possibly work :-) let the user decide if it can/could deal with the distribution problems.
Of course it may not worth the maintenance work, though it was rather easy to rebuild the feature, i was missing the ability to have an easy solution for sounds inside shoes (i know there is gems for that but vlc is quite an amazing tool, there's also mpv but i found it to be more difficult to install headers)

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jun 18, 2015

Contributor

For audio, the portaudio gem/extension source is still in Shoes - it's just not compiled and the libs aren't copied into the Shoes place. PITA if you get the wrong version of portaudio installed with apt-get. VLC video also had threading problems with 1.9.1 (many things did) and given the distribution issues (and window issues at the time) no one wanted to rewrite the Shoes C code to deal with the new VLC api. I

Contributor

ccoupe commented Jun 18, 2015

For audio, the portaudio gem/extension source is still in Shoes - it's just not compiled and the libs aren't copied into the Shoes place. PITA if you get the wrong version of portaudio installed with apt-get. VLC video also had threading problems with 1.9.1 (many things did) and given the distribution issues (and window issues at the time) no one wanted to rewrite the Shoes C code to deal with the new VLC api. I

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jun 29, 2015

Contributor

just to let you know it works nice here, made a video_gtk3 branch which is current with master (main point of this message) so if you want to foresee merging issues about gtk3 branch into master ...
(result + history)
cheers

Contributor

passenger94 commented Jun 29, 2015

just to let you know it works nice here, made a video_gtk3 branch which is current with master (main point of this message) so if you want to foresee merging issues about gtk3 branch into master ...
(result + history)
cheers

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Nov 19, 2015

Contributor

Considering that the work that is going into #54 is based on the old Video code we should probably probably put the code back into Shoes.

Contributor

ccoupe commented Nov 19, 2015

Considering that the work that is going into #54 is based on the old Video code we should probably probably put the code back into Shoes.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 12, 2016

Contributor

I don't know how practical the following idea is. I don't want to build/maintain Shoes dependency for libVLC (and all it's components) and I certainly don't want to bloat the Shoes download size by including it. However, we could include a fiddle/ffi based Ruby interface to the libVLC api and try to load the so/dylib/dll from known locations ( in cache.rb or shoes.rb ) if It loads and the version numbers are good enough then enable creation of Shoes Video Viideo widgets for Shoes scripts

VLC still has an external display window option. Obviously getting that done in Shoes is a bit of a challenge after all these years of neglect. Less clear is how to handle Control buttons like start/stop/pause/ff/rew and associated callback and threading issues. However we all use pthreads now so that might not be a blocker.

The load locations of VLC are knowable for all platforms (according to VLC). The real trick is creating the fiddle/ffi interface - once but usable for all platforms. Furthermore, we would have to use ruby calls (rb_eval etc ) to the fiddle api so we have no static inker dependencies.

Contributor

ccoupe commented Jan 12, 2016

I don't know how practical the following idea is. I don't want to build/maintain Shoes dependency for libVLC (and all it's components) and I certainly don't want to bloat the Shoes download size by including it. However, we could include a fiddle/ffi based Ruby interface to the libVLC api and try to load the so/dylib/dll from known locations ( in cache.rb or shoes.rb ) if It loads and the version numbers are good enough then enable creation of Shoes Video Viideo widgets for Shoes scripts

VLC still has an external display window option. Obviously getting that done in Shoes is a bit of a challenge after all these years of neglect. Less clear is how to handle Control buttons like start/stop/pause/ff/rew and associated callback and threading issues. However we all use pthreads now so that might not be a blocker.

The load locations of VLC are knowable for all platforms (according to VLC). The real trick is creating the fiddle/ffi interface - once but usable for all platforms. Furthermore, we would have to use ruby calls (rb_eval etc ) to the fiddle api so we have no static inker dependencies.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 18, 2016

Contributor

@passenger94 - would you create a video branch on the gitthub site and push to it so I can look at what you've done already.

Contributor

ccoupe commented Jan 18, 2016

@passenger94 - would you create a video branch on the gitthub site and push to it so I can look at what you've done already.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 18, 2016

Contributor

done, pending pull request on video_vlc branch (still working by my side)

if i remember correctly, the only change for Osx and Windows might be lines 351; 352
https://github.com/Shoes3/shoes3/pull/189/files#diff-153758cf9bd8a68fbd3d25b2079b22aaR351
That could be an option to use user installed vlc, in Loose Shoes environment (no library management troubles, it used to be that way, before)

Contributor

passenger94 commented Jan 18, 2016

done, pending pull request on video_vlc branch (still working by my side)

if i remember correctly, the only change for Osx and Windows might be lines 351; 352
https://github.com/Shoes3/shoes3/pull/189/files#diff-153758cf9bd8a68fbd3d25b2079b22aaR351
That could be an option to use user installed vlc, in Loose Shoes environment (no library management troubles, it used to be that way, before)

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 19, 2016

Contributor

@passenger94. Thank you. I like that most of the VLC code is isolated into shoes/video/ instead of cluttering up ruby.c Looking at your code has also helped me to think about my proposed fiddle/ffi method of dealing with Video. In that magical universe , the shoes/video/* vlc code would be replaced with C that calls Ruby (using rb_eval) and the ruby code would use a dynamic ffi/fiddle built bindings to talk to the vlc library - assuming the user has installed vlc on their system. Some methods that deal with general Shoes things (top, left, move) would still be C. Any of your methods (for example) that call into vlc_apis would have to cross the Shoes.C- > Ruby/ffi -> vlc C barriers.

The goal is to not to use C to compile vlc calls and thereby create a link dependency for vlc libs to be includes with Shoes. Side effect - you wouldn't need VLC installed to build a distributable Shoes that could handle VLC if installed on the users system. It's a lot to think about. I have no idea if Gtk3/Windows shoes_native_surface() returns something acceptable to vlc.

Contributor

ccoupe commented Jan 19, 2016

@passenger94. Thank you. I like that most of the VLC code is isolated into shoes/video/ instead of cluttering up ruby.c Looking at your code has also helped me to think about my proposed fiddle/ffi method of dealing with Video. In that magical universe , the shoes/video/* vlc code would be replaced with C that calls Ruby (using rb_eval) and the ruby code would use a dynamic ffi/fiddle built bindings to talk to the vlc library - assuming the user has installed vlc on their system. Some methods that deal with general Shoes things (top, left, move) would still be C. Any of your methods (for example) that call into vlc_apis would have to cross the Shoes.C- > Ruby/ffi -> vlc C barriers.

The goal is to not to use C to compile vlc calls and thereby create a link dependency for vlc libs to be includes with Shoes. Side effect - you wouldn't need VLC installed to build a distributable Shoes that could handle VLC if installed on the users system. It's a lot to think about. I have no idea if Gtk3/Windows shoes_native_surface() returns something acceptable to vlc.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 19, 2016

Contributor

:-D Now, That's what i'm calling Fiddling ! MAN !!! this is heavy stuff !!! Lots of fun :-D
arid documentation + almost bare bones programming !!! ouch ! and i' have only discovered the beginning of fiddle -> libvlc side, that is a pledge to be quite a funky experience when trying to render on a cairo surface !

Contributor

passenger94 commented Jan 19, 2016

:-D Now, That's what i'm calling Fiddling ! MAN !!! this is heavy stuff !!! Lots of fun :-D
arid documentation + almost bare bones programming !!! ouch ! and i' have only discovered the beginning of fiddle -> libvlc side, that is a pledge to be quite a funky experience when trying to render on a cairo surface !

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 20, 2016

Contributor

Its very bare bones, learn as you go. Thankfully you have working code so it could be done one vlc call at a time until the last thing to do is delete #include "vlc.h" Getting the structs properly configured is important and make sure nothing is lost in conversion from C into Ruby. There are a couple of Projects the have done ffi&vlc in Node.js and Scheme. I wouldn't try Cairo drawing/manipulation/transforms this way but we need those do we for video widgets? A lot of work.

Might be a way to handle other strange native widgets in the future, if there are any.

Contributor

ccoupe commented Jan 20, 2016

Its very bare bones, learn as you go. Thankfully you have working code so it could be done one vlc call at a time until the last thing to do is delete #include "vlc.h" Getting the structs properly configured is important and make sure nothing is lost in conversion from C into Ruby. There are a couple of Projects the have done ffi&vlc in Node.js and Scheme. I wouldn't try Cairo drawing/manipulation/transforms this way but we need those do we for video widgets? A lot of work.

Might be a way to handle other strange native widgets in the future, if there are any.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 21, 2016

Contributor

ok, Thanks to the github goldmine, having a vlc instance playing a video/audio in an external window is quite straightforward, that's one thing, but
interacting with structures and unpacking what's pointers are pointing to ........
there are some limitations apparently too,
for example a union inside structure is not allowed in fiddle, we have to use a workaround for this.... create a place-holder and then squirm around fiddle pointers and sisters...
lots to learn :-D

Contributor

passenger94 commented Jan 21, 2016

ok, Thanks to the github goldmine, having a vlc instance playing a video/audio in an external window is quite straightforward, that's one thing, but
interacting with structures and unpacking what's pointers are pointing to ........
there are some limitations apparently too,
for example a union inside structure is not allowed in fiddle, we have to use a workaround for this.... create a place-holder and then squirm around fiddle pointers and sisters...
lots to learn :-D

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 22, 2016

Contributor

shoe_fiddle_vlc

something is working :-)
fiddle + libvlc on the ruby side of Shoes
nothing in shoes C specific to vlc, generic api, but uses Shoes placements routines (here with margins)
Sound and Vision !

2 lines of code in ruby, specific to linux / windows / osx (using libvlc that is)

Contributor

passenger94 commented Jan 22, 2016

shoe_fiddle_vlc

something is working :-)
fiddle + libvlc on the ruby side of Shoes
nothing in shoes C specific to vlc, generic api, but uses Shoes placements routines (here with margins)
Sound and Vision !

2 lines of code in ruby, specific to linux / windows / osx (using libvlc that is)

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 22, 2016

Contributor

Amazing! Wonderful!

Contributor

ccoupe commented Jan 22, 2016

Amazing! Wonderful!

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 30, 2016

Contributor

I have some head scratching ahead for Windows, It kind of works, I get the audio track for an mp4
but error messages on the dos commandline and no video,

E:\shoes3\samples>cshoes.exe videoFiddleVlc01.rb
[03da64c4] core video output error: video output creation failed
[03d84d3c] core decoder error: failed to create video output
[03da64c4] core video output error: video output creation failed
[03d84d3c] core decoder error: failed to create video output

VLC (standalone app) does show the video, so it's definitely s Shoes/Window problem. Probably the gdk call. to get a Handle.

Contributor

ccoupe commented Jan 30, 2016

I have some head scratching ahead for Windows, It kind of works, I get the audio track for an mp4
but error messages on the dos commandline and no video,

E:\shoes3\samples>cshoes.exe videoFiddleVlc01.rb
[03da64c4] core video output error: video output creation failed
[03d84d3c] core decoder error: failed to create video output
[03da64c4] core video output error: video output creation failed
[03d84d3c] core decoder error: failed to create video output

VLC (standalone app) does show the video, so it's definitely s Shoes/Window problem. Probably the gdk call. to get a Handle.

@ccoupe ccoupe closed this Jan 30, 2016

@ccoupe ccoupe reopened this Jan 30, 2016

ccoupe added a commit that referenced this issue Jan 30, 2016

for #133 - Windows has video
* oddly enough its a new window, not the Shoes window and of
  course their are error messages.
* good enough for tonight
@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 30, 2016

Contributor

the libvlc hook to the drawing area is not yet totally finished (still missing some proper thickness to the widget to act like other widgets) but should work ... head scratching ... any chance to capture an actually helpful message ?
There was some complain about h264 (mp4) rendering ...

Contributor

passenger94 commented Jan 30, 2016

the libvlc hook to the drawing area is not yet totally finished (still missing some proper thickness to the widget to act like other widgets) but should work ... head scratching ... any chance to capture an actually helpful message ?
There was some complain about h264 (mp4) rendering ...

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 30, 2016

Contributor

Yes, I've set the hook for Windows. Different error message but we have video. It's got new oddities but I'm convinced the fiddle concept you implemented will work. Even with the Windows issues, this will get into Shoes 3.3.1, as proof of concept, samples/very-expert-video.rb. or a widget. I need to get the OSX code working at least as good as Window. Tomorrow, I hope.

Contributor

ccoupe commented Jan 30, 2016

Yes, I've set the hook for Windows. Different error message but we have video. It's got new oddities but I'm convinced the fiddle concept you implemented will work. Even with the Windows issues, this will get into Shoes 3.3.1, as proof of concept, samples/very-expert-video.rb. or a widget. I need to get the OSX code working at least as good as Window. Tomorrow, I hope.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 30, 2016

Contributor

what do i need to get quickly set, on windows 7, to be able to mess around with c code ? if such a request has a meaning on windows ...

Contributor

passenger94 commented Jan 30, 2016

what do i need to get quickly set, on windows 7, to be able to mess around with c code ? if such a request has a meaning on windows ...

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 30, 2016

Contributor

You will need RubyInstaller and the matching devkit. That should get you
the MingW msys environment which is a kind of like the unix shell. It's
important to get the 32 bit versions of both. So Ruby 2.2.3 is their
latest and the 32 bit devkit for it.

http://rubyinstaller.org/downloads/

You'll probably want 7zip utilitiy so you can untar things from Shoe
website. Plus some patience. The terminal is pretty lame re:
cut/paste/select.

On 01/30/2016 01:07 AM, passenger94 wrote:

what do i need to get quickly set, on windows 7, to be able to mess
around with c code ?


Reply to this email directly or view it on GitHub
#133 (comment).

Contributor

ccoupe commented Jan 30, 2016

You will need RubyInstaller and the matching devkit. That should get you
the MingW msys environment which is a kind of like the unix shell. It's
important to get the 32 bit versions of both. So Ruby 2.2.3 is their
latest and the 32 bit devkit for it.

http://rubyinstaller.org/downloads/

You'll probably want 7zip utilitiy so you can untar things from Shoe
website. Plus some patience. The terminal is pretty lame re:
cut/paste/select.

On 01/30/2016 01:07 AM, passenger94 wrote:

what do i need to get quickly set, on windows 7, to be able to mess
around with c code ?


Reply to this email directly or view it on GitHub
#133 (comment).

@BackOrder

This comment has been minimized.

Show comment
Hide comment
@BackOrder

BackOrder Jan 30, 2016

Collaborator

Is this part of 3.3.1 release? Some issues might need tagging.

Collaborator

BackOrder commented Jan 30, 2016

Is this part of 3.3.1 release? Some issues might need tagging.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 30, 2016

Contributor

Actually it's not tagged because it's not completely certain it's going to work or when it's going to work well enough. I think it's pretty close but I'm an optimist about schedules and features. We all know feature schedules are moveable.

Contributor

ccoupe commented Jan 30, 2016

Actually it's not tagged because it's not completely certain it's going to work or when it's going to work well enough. I think it's pretty close but I'm an optimist about schedules and features. We all know feature schedules are moveable.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Jan 31, 2016

Contributor

The OSX code is going to take awhile. The new shoes_native_surface-* functions are a lot different from what cocoa.m has. I think the newer code can be done in Cocoa and makes more sense once I get back my head into Objective-C mode. Plus I've got other bugs to fix on OSX.

Contributor

ccoupe commented Jan 31, 2016

The OSX code is going to take awhile. The new shoes_native_surface-* functions are a lot different from what cocoa.m has. I think the newer code can be done in Cocoa and makes more sense once I get back my head into Objective-C mode. Plus I've got other bugs to fix on OSX.

@ccoupe ccoupe added Normal and removed Low labels Jan 31, 2016

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Jan 31, 2016

Contributor

@ccoupe , Is Windows part working now ?
Looking at cocoa, makes me wondering if video was ever an option on Shoes osx ? The ancient code doesn't make much sense, it's missing a proper canvas to draw on, the equivalent of a GtkDrawingArea , at the moment "shoes_native_surface_new" returns the entire app canvas ...
Apart from that, it should be relatively straightforward (from my totally objective-C blind perspective, that is)

Contributor

passenger94 commented Jan 31, 2016

@ccoupe , Is Windows part working now ?
Looking at cocoa, makes me wondering if video was ever an option on Shoes osx ? The ancient code doesn't make much sense, it's missing a proper canvas to draw on, the equivalent of a GtkDrawingArea , at the moment "shoes_native_surface_new" returns the entire app canvas ...
Apart from that, it should be relatively straightforward (from my totally objective-C blind perspective, that is)

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 1, 2016

Contributor

It should be just a case of creating an NSView with a NRect from the width and height and enablling/disabling certain event callbacks . I agree that VLC may have never worked on OSX.

The Windows code is still misbehaving. I got tired of working on Windows and decided to give the OSX codebase some attention.

Contributor

ccoupe commented Feb 1, 2016

It should be just a case of creating an NSView with a NRect from the width and height and enablling/disabling certain event callbacks . I agree that VLC may have never worked on OSX.

The Windows code is still misbehaving. I got tired of working on Windows and decided to give the OSX codebase some attention.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 1, 2016

Contributor

i'm concerned with this :
https://github.com/passenger94/shoes3/blob/video_fiddle_vlc/lib/shoes/videoffi.rb#L256

it works nice and we HAVE to wait for parent canvas to be drawn in order to accesss the drawable for vlc
But it might conflict with a user supplied start event in a shoes script (happened to me)
The only other solution, i found, is something like that but it's ugly... any idea ?

 Thread.new do
        sleep 0.5
        drID = @video.drawable  # xlib window / HWND / NSView  id
        if libvlc_media_player_get_xwindow(@player) == 0
            libvlc_media_player_set_xwindow(@player, drID)
                # libvlc_media_player_set_hwnd       on Windows
                # libvlc_media_player_set_nsobject   on osx
         end

        play if @loaded && @autoplay
   end

Also waiting in a loop for app.started? (in a Thread) but it's not enough when app is started, asynchronous drawing is not yet finished ...

EDIT: we might add an internal (private, not documented, reserved for Shoes) canvas.started? function, emitted at the same time as start event ...

Contributor

passenger94 commented Feb 1, 2016

i'm concerned with this :
https://github.com/passenger94/shoes3/blob/video_fiddle_vlc/lib/shoes/videoffi.rb#L256

it works nice and we HAVE to wait for parent canvas to be drawn in order to accesss the drawable for vlc
But it might conflict with a user supplied start event in a shoes script (happened to me)
The only other solution, i found, is something like that but it's ugly... any idea ?

 Thread.new do
        sleep 0.5
        drID = @video.drawable  # xlib window / HWND / NSView  id
        if libvlc_media_player_get_xwindow(@player) == 0
            libvlc_media_player_set_xwindow(@player, drID)
                # libvlc_media_player_set_hwnd       on Windows
                # libvlc_media_player_set_nsobject   on osx
         end

        play if @loaded && @autoplay
   end

Also waiting in a loop for app.started? (in a Thread) but it's not enough when app is started, asynchronous drawing is not yet finished ...

EDIT: we might add an internal (private, not documented, reserved for Shoes) canvas.started? function, emitted at the same time as start event ...

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 6, 2016

Contributor

@passenger94 - sorry I didn't get back to you sooner. I'm OK with adding undocumented/private methods. We've got draw methods that should never be called from general purpose scripts.

Contributor

ccoupe commented Feb 6, 2016

@passenger94 - sorry I didn't get back to you sooner. I'm OK with adding undocumented/private methods. We've got draw methods that should never be called from general purpose scripts.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 6, 2016

Contributor

No problem :)

On windows rake is complaining about not finding " ../mingw/lib/libmsvcrt-ruby220.so" when trying to compile Shoes, i thought it was looking for a dll - i do have a "msvcrt-ruby220.dll" in Ruby bin folder and a "libmsvcrt-ruby220.dll.a" in Ruby lib folder - ?!
(i can compile gem extensions, so i guess installation is fine)

Contributor

passenger94 commented Feb 6, 2016

No problem :)

On windows rake is complaining about not finding " ../mingw/lib/libmsvcrt-ruby220.so" when trying to compile Shoes, i thought it was looking for a dll - i do have a "msvcrt-ruby220.dll" in Ruby bin folder and a "libmsvcrt-ruby220.dll.a" in Ruby lib folder - ?!
(i can compile gem extensions, so i guess installation is fine)

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 6, 2016

Contributor

Sounds like your Ruby install is OK. Shoes is more complicated. See https://github.com/Shoes3/shoes3/wiki/Building-Shoes-on-Windows

  1. you need the precompiled dependencies, (http://shoes.mvmanila.com/public/shoesdeps/mingw/ShoesDeps.zip - 96MB)
  2. you need a win7-custom.yaml - see https://github.com/Shoes3/shoes3/wiki/Custom.yaml.
    with your settings for your system. 3) Patience - it does work.
Contributor

ccoupe commented Feb 6, 2016

Sounds like your Ruby install is OK. Shoes is more complicated. See https://github.com/Shoes3/shoes3/wiki/Building-Shoes-on-Windows

  1. you need the precompiled dependencies, (http://shoes.mvmanila.com/public/shoesdeps/mingw/ShoesDeps.zip - 96MB)
  2. you need a win7-custom.yaml - see https://github.com/Shoes3/shoes3/wiki/Custom.yaml.
    with your settings for your system. 3) Patience - it does work.
@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 6, 2016

Contributor

yeah i followed that route, after remembering you took a lot of time to write Wiki pages about it ... !!
i'm sure it does work but the whole thing is kind of frightening to say the least ...

There is only a "libwinpthread.dll.a" inside ShoesDeps.zip, is it ok ? i was expecting a lot more (directories, dlls ...)
it seems like the win7-custom.yaml is called only if cross compiling, no ? i'm lost there
btw i'm trying to do a loose build, hoping it to be more easy, but i might be wrong probably because then i need all the dependencies installed , right ?

Contributor

passenger94 commented Feb 6, 2016

yeah i followed that route, after remembering you took a lot of time to write Wiki pages about it ... !!
i'm sure it does work but the whole thing is kind of frightening to say the least ...

There is only a "libwinpthread.dll.a" inside ShoesDeps.zip, is it ok ? i was expecting a lot more (directories, dlls ...)
it seems like the win7-custom.yaml is called only if cross compiling, no ? i'm lost there
btw i'm trying to do a loose build, hoping it to be more easy, but i might be wrong probably because then i need all the dependencies installed , right ?

@ccoupe ccoupe assigned passenger94 and unassigned ccoupe Feb 11, 2016

ccoupe added a commit that referenced this issue Feb 11, 2016

get osx working for #133 Yay!
* remove my hacks.
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 11, 2016

Contributor

Awesome is the work of @passenger94 !!!

I do have a question for the international folks. We have hard coded paths to /Applications/VLC.app on OSX, for example. Is that a good path for internationalized OSX? . We check for "c:\Program Files (x86). Is that name used in all Windows? I have no idea.

Betas for OSX and Windows at the usual place http://walkabout.mvmanila.com/public/shoes Tight Linux builds have some issues which I know will be solvable. Documenting this ability for Shoes will be something of a challenge that I look forward too. I can hardly wait to tell everyone!

It's hard to describe how pleased I am.

Contributor

ccoupe commented Feb 11, 2016

Awesome is the work of @passenger94 !!!

I do have a question for the international folks. We have hard coded paths to /Applications/VLC.app on OSX, for example. Is that a good path for internationalized OSX? . We check for "c:\Program Files (x86). Is that name used in all Windows? I have no idea.

Betas for OSX and Windows at the usual place http://walkabout.mvmanila.com/public/shoes Tight Linux builds have some issues which I know will be solvable. Documenting this ability for Shoes will be something of a challenge that I look forward too. I can hardly wait to tell everyone!

It's hard to describe how pleased I am.

@BackOrder

This comment has been minimized.

Show comment
Hide comment
@BackOrder

BackOrder Feb 11, 2016

Collaborator

We have hard coded paths to /Applications/VLC.app on OSX, for example. Is that a good path for internationalized OSX?

My understanding is that translation is provided on UI level rather than filesystem level. The filesystem is all on the same on any localized version of MacOS X. Can anyone confirm this?

We check for "c:\Program Files (x86). Is that name used in all Windows?

Actually, we are supposed to use %ProgramFiles% and %ProgramFiles(X86)%. Never hard coded path! Please, take note that translation is provided at UI level. Filesystem is in plain English.

References
https://technet.microsoft.com/en-us/library/cc749104(v=ws.10).aspx

Collaborator

BackOrder commented Feb 11, 2016

We have hard coded paths to /Applications/VLC.app on OSX, for example. Is that a good path for internationalized OSX?

My understanding is that translation is provided on UI level rather than filesystem level. The filesystem is all on the same on any localized version of MacOS X. Can anyone confirm this?

We check for "c:\Program Files (x86). Is that name used in all Windows?

Actually, we are supposed to use %ProgramFiles% and %ProgramFiles(X86)%. Never hard coded path! Please, take note that translation is provided at UI level. Filesystem is in plain English.

References
https://technet.microsoft.com/en-us/library/cc749104(v=ws.10).aspx

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 11, 2016

Contributor

Thanks @BackOrder , It appears that we have ENV['ProgramFiles(x86)'] already available (use samples/simple-info.rb) so that should be used . Here's screen shot after that change
win7-video

Contributor

ccoupe commented Feb 11, 2016

Thanks @BackOrder , It appears that we have ENV['ProgramFiles(x86)'] already available (use samples/simple-info.rb) so that should be used . Here's screen shot after that change
win7-video

ccoupe added a commit that referenced this issue Feb 11, 2016

@BackOrder

This comment has been minimized.

Show comment
Hide comment
@BackOrder

BackOrder Feb 11, 2016

Collaborator

Take note that ENV['ProgramFiles(x86)'] is only available on 64 bit systems. 32 bit systems and older systems such as Windows XP use ENV['ProgramFiles'].

Collaborator

BackOrder commented Feb 11, 2016

Take note that ENV['ProgramFiles(x86)'] is only available on 64 bit systems. 32 bit systems and older systems such as Windows XP use ENV['ProgramFiles'].

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 11, 2016

Contributor

YES ! cool, nice news !! 👍

Contributor

passenger94 commented Feb 11, 2016

YES ! cool, nice news !! 👍

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 12, 2016

Contributor

There are confounding issues with the case of not having vlc installed in Linux - it doesn't always trigger an exception from dlload(). That one I think I can fix (have fixed for Linux?)

There is a more difficult problem if the vlc version is too old. Then videoffi.rb dies trying to extern something not in the older libvlc. VLC 2.0 vs 2.1 and 2.2. ? You'd want to raise an exception that says "Your version of VLC is too old" I'm unclear where to do that. The @Version string isn't available until
import symbols is called. @passenger94 - Advice, please

There's another error that may be related to my old linux chroot for x86 and i386 when run outside the chroot - They fail in ffi.so trying to load fiddle.so from Ruby which seems backwards to me. That could be that ruby wasn't compiled with ffi or fiddle or ... Doesn't happen on the pi2 build which uses a more recent debian that the chroots.

Lastly, there is @BackOrder mention of XP and 32 bit Windows. I have no way of testing on XP or interest in XP and you'll probably run afoul of the older VLC version problem noted above. It's only a few lines of Ruby to add to your XP Shoes. If systems are too old to run the new video code (and I have two linux chroots that won't) then it's time to update or do without video.

Failing gracefully is what I'm working on now.

Contributor

ccoupe commented Feb 12, 2016

There are confounding issues with the case of not having vlc installed in Linux - it doesn't always trigger an exception from dlload(). That one I think I can fix (have fixed for Linux?)

There is a more difficult problem if the vlc version is too old. Then videoffi.rb dies trying to extern something not in the older libvlc. VLC 2.0 vs 2.1 and 2.2. ? You'd want to raise an exception that says "Your version of VLC is too old" I'm unclear where to do that. The @Version string isn't available until
import symbols is called. @passenger94 - Advice, please

There's another error that may be related to my old linux chroot for x86 and i386 when run outside the chroot - They fail in ffi.so trying to load fiddle.so from Ruby which seems backwards to me. That could be that ruby wasn't compiled with ffi or fiddle or ... Doesn't happen on the pi2 build which uses a more recent debian that the chroots.

Lastly, there is @BackOrder mention of XP and 32 bit Windows. I have no way of testing on XP or interest in XP and you'll probably run afoul of the older VLC version problem noted above. It's only a few lines of Ruby to add to your XP Shoes. If systems are too old to run the new video code (and I have two linux chroots that won't) then it's time to update or do without video.

Failing gracefully is what I'm working on now.

ccoupe added a commit that referenced this issue Feb 12, 2016

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 12, 2016

Contributor

for the libvlc version, we can

  • get rid of the extern 'const char* libvlc_get_version()' inside the import_symbols class method
  • do the load lib voodoo, check only (no version checking) that libvlc loads (therefore exists - there is a Fiddle::DLError - )
  • once loaded, before calling import symbols, declare extern 'const char* libvlc_get_version()' and check version with libvlc_get_version()
  • if everyone is happy, adult and consenting then import_symbols (we might soon need branching from here anyway, a new libvlc 3.0 version is coming, maybe already there, not sure as we have basic support for libvlc)

sorry i didn't paid much attention to that, just thrown (threw ?) a minimal check
also the Object monkey patching is temporary, and maybe some structure declaration not needed for the moment :
i'm still struggling with Fiddle to be able to check for width and height of a possible Video track, if someone have some advice ... ... i have different "working" (computer gods accepts the offering) routines but i get absurd numbers, and still unclear how to manage a union inside a structure in Fiddle context, which i need to access video, audio or subtitle track after calling libvlc_media_tracks_get
https://github.com/Shoes3/shoes3/blob/b667c0b21574cbce8502a786256b36ac453e8922/lib/shoes/videoffi.rb#L333

Contributor

passenger94 commented Feb 12, 2016

for the libvlc version, we can

  • get rid of the extern 'const char* libvlc_get_version()' inside the import_symbols class method
  • do the load lib voodoo, check only (no version checking) that libvlc loads (therefore exists - there is a Fiddle::DLError - )
  • once loaded, before calling import symbols, declare extern 'const char* libvlc_get_version()' and check version with libvlc_get_version()
  • if everyone is happy, adult and consenting then import_symbols (we might soon need branching from here anyway, a new libvlc 3.0 version is coming, maybe already there, not sure as we have basic support for libvlc)

sorry i didn't paid much attention to that, just thrown (threw ?) a minimal check
also the Object monkey patching is temporary, and maybe some structure declaration not needed for the moment :
i'm still struggling with Fiddle to be able to check for width and height of a possible Video track, if someone have some advice ... ... i have different "working" (computer gods accepts the offering) routines but i get absurd numbers, and still unclear how to manage a union inside a structure in Fiddle context, which i need to access video, audio or subtitle track after calling libvlc_media_tracks_get
https://github.com/Shoes3/shoes3/blob/b667c0b21574cbce8502a786256b36ac453e8922/lib/shoes/videoffi.rb#L333

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 12, 2016

Contributor

That's much like I was going to do for version checks but I thought I should ask you since you know more than I about fiddle and vlc. I'll constrain my changes to that part of videoffi.rb FWIW, one can get VLC 2.1.5 on old debians (7.2 timeframe) via the backport repo. Removing it is not so obvious. Shoes 3.3.1 works with that one on i686 and fails properly if there is no vlc installed.

Contributor

ccoupe commented Feb 12, 2016

That's much like I was going to do for version checks but I thought I should ask you since you know more than I about fiddle and vlc. I'll constrain my changes to that part of videoffi.rb FWIW, one can get VLC 2.1.5 on old debians (7.2 timeframe) via the backport repo. Removing it is not so obvious. Shoes 3.3.1 works with that one on i686 and fails properly if there is no vlc installed.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 12, 2016

Contributor

so it's under control now ? failing gracefully everywhere if problems ?

i managed, finally !, to get the width and height of the video track through libvlc_media_tracks_getusing a void pointer in place of the union in the Media_track structure

Contributor

passenger94 commented Feb 12, 2016

so it's under control now ? failing gracefully everywhere if problems ?

i managed, finally !, to get the width and height of the video track through libvlc_media_tracks_getusing a void pointer in place of the union in the Media_track structure

ccoupe added a commit that referenced this issue Feb 13, 2016

ccoupe added a commit that referenced this issue Feb 13, 2016

for #133 - Windows detects Vlc better.
* osx draws black background on video widget like gtk does.
* update CHANGELOG because it has to be done.
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 13, 2016

Contributor

Now it doing the right thing for Linux, OSX & Windows when VLC is not installed or the version is too old. Also added a check for @BackOrder 32 bit XP "Program Files" but I can't test that.

I'm going to work on the manual for this feature. @passenger94 , if you get bored coding, you could always update the Wiki articles for installing Shoes on Windows or tell me what instructions were wrong or outdated.

Contributor

ccoupe commented Feb 13, 2016

Now it doing the right thing for Linux, OSX & Windows when VLC is not installed or the version is too old. Also added a check for @BackOrder 32 bit XP "Program Files" but I can't test that.

I'm going to work on the manual for this feature. @passenger94 , if you get bored coding, you could always update the Wiki articles for installing Shoes on Windows or tell me what instructions were wrong or outdated.

ccoupe referenced this issue Feb 13, 2016

update manual to describe video widget. Incomplete.
* better than nothing
* also suggests what could be done if anyone cares.
@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 15, 2016

Contributor

Some food to think about the better protocol to call libvlc

i managed to compile latest git vlc (linux, 3.0.0 Vetinari) and our fiddling works !
I didn't installed it, so i gave the (not standard) path to libvlc to Vlc.load_lib AND i had to point the ENV['VLC_PLUGIN_PATH'] to the modules subdir ! (obviously becomes the plugins dir if installed)

So, at the moment, user have 2 different places to change in order to work with a random vlc lib, not good (and one is in shoes libs) ... also ENV['VLC_PLUGIN_PATH'] might be something to check on all platform (not standard installation is a frequent enough dandyism, i myself ....)
Thoughts ?

Contributor

passenger94 commented Feb 15, 2016

Some food to think about the better protocol to call libvlc

i managed to compile latest git vlc (linux, 3.0.0 Vetinari) and our fiddling works !
I didn't installed it, so i gave the (not standard) path to libvlc to Vlc.load_lib AND i had to point the ENV['VLC_PLUGIN_PATH'] to the modules subdir ! (obviously becomes the plugins dir if installed)

So, at the moment, user have 2 different places to change in order to work with a random vlc lib, not good (and one is in shoes libs) ... also ENV['VLC_PLUGIN_PATH'] might be something to check on all platform (not standard installation is a frequent enough dandyism, i myself ....)
Thoughts ?

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 15, 2016

Contributor

i propose giving an optional "plugin_path" argument, set to a default nil, for Vlc.load_lib function
and inside that function after importing symbols setting the ENV['VLC_PLUGIN_PATH'] with the value if given.
I mean using named arguments, so we can deal with all combination of "path" and "plugin_path", being nil or not (assuming ruby 2.0+)

for example for me, in Shoes script, it is :
Vlc.load_lib path: '~/NBWorkspace/vlc/lib/.libs/libvlc.so.5.5.0', plugin_path: "~/NBWorkspace/vlc/modules"

Contributor

passenger94 commented Feb 15, 2016

i propose giving an optional "plugin_path" argument, set to a default nil, for Vlc.load_lib function
and inside that function after importing symbols setting the ENV['VLC_PLUGIN_PATH'] with the value if given.
I mean using named arguments, so we can deal with all combination of "path" and "plugin_path", being nil or not (assuming ruby 2.0+)

for example for me, in Shoes script, it is :
Vlc.load_lib path: '~/NBWorkspace/vlc/lib/.libs/libvlc.so.5.5.0', plugin_path: "~/NBWorkspace/vlc/modules"

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 15, 2016

Contributor

I do think it's a good idea to allow for non standard locations (plural) but rather than code that location into the users script, why not another cobbler screen. Very similarly to how we can change the location of the packaging downloads. Screen would allow user to enter the locations and create a small file in ~/.shoes/walkabout (and set two ENV['vars'] ). At Shoes startup, (lib/shoes/cache.rb) we can test for that file and if found, load the ENV['vars'] Should be pretty simple.

we could also move/duplicate some of the code in vlc.load_lib to run at Shoes startup to populate the ENV[vars] if the file doesn't exist but the defaults paths do.

Contributor

ccoupe commented Feb 15, 2016

I do think it's a good idea to allow for non standard locations (plural) but rather than code that location into the users script, why not another cobbler screen. Very similarly to how we can change the location of the packaging downloads. Screen would allow user to enter the locations and create a small file in ~/.shoes/walkabout (and set two ENV['vars'] ). At Shoes startup, (lib/shoes/cache.rb) we can test for that file and if found, load the ENV['vars'] Should be pretty simple.

we could also move/duplicate some of the code in vlc.load_lib to run at Shoes startup to populate the ENV[vars] if the file doesn't exist but the defaults paths do.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 15, 2016

Contributor

oh yes, let's go to the cobbler, sounds good to me !
Beware, that guy is slowly but surely growing up ... ! ;-D

Speaking of back shop, i finally put the libvlc_media_tracks_get under control, after like decades of fiddle and C pointers bloody skirmish, (that was something !)

cleaning, synch and PR

Edit: another advantage of non standard locations is that you can zip/pack libvlc with your script as an option and set paths accordingly (will be platform dependant, but it'll be a user choice only)

is it good to synch now ? or better wait a bit ?

As for the build on Windows Wiki page, i'll look closely, but the general explanation is accurate (with the precious help of your prepared files ...)

Contributor

passenger94 commented Feb 15, 2016

oh yes, let's go to the cobbler, sounds good to me !
Beware, that guy is slowly but surely growing up ... ! ;-D

Speaking of back shop, i finally put the libvlc_media_tracks_get under control, after like decades of fiddle and C pointers bloody skirmish, (that was something !)

cleaning, synch and PR

Edit: another advantage of non standard locations is that you can zip/pack libvlc with your script as an option and set paths accordingly (will be platform dependant, but it'll be a user choice only)

is it good to synch now ? or better wait a bit ?

As for the build on Windows Wiki page, i'll look closely, but the general explanation is accurate (with the precious help of your prepared files ...)

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 15, 2016

Contributor

I'll volunteer to update the cobbler, cache and and that part of videoffi.rb if you like. I'm familiar with it. Unless you want to do it.

Contributor

ccoupe commented Feb 15, 2016

I'll volunteer to update the cobbler, cache and and that part of videoffi.rb if you like. I'm familiar with it. Unless you want to do it.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 15, 2016

Contributor

please do so, i'm not familiar with the cobbler, i should though !! :-D

Contributor

passenger94 commented Feb 15, 2016

please do so, i'm not familiar with the cobbler, i should though !! :-D

ccoupe added a commit that referenced this issue Feb 16, 2016

for #133. Add vlc.yaml handling for detecting vlc availablility
* add new module for common vlc path functions.
* create video ENV var at startup if possible
* add Cobbler button/screen to manage vlc.yaml
* might work. might not.
* incomplete - it's only a branch - not even beta
* does not affect videoffi.rb. Yet.

ccoupe added a commit that referenced this issue Feb 17, 2016

For #133 - using ENV vars to control VLC location
* OK for Windows. Untested on Linux for a different VLC location.
  Should work. Please test.
* OSX could work but Shoes ask_open_* won't dig into VLC.app.
  Bless their controling effort to save us from errors.
* Tweak samples/expert-video-player.rb to put up an alert if
  ENV['VLC_APP_PATH'] because folks shouldn't learn to use begin/rescue
  to handle optional capabibilites.
* Sutle edge cases may exist in the logic. It's very difficult to test for
  or even know  what the proper behavior is for failure. Continues the
  Shoes tradition.
* Remember the number of users with two VLC's on their system is prety
  small
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 17, 2016

Contributor

I think I'm done with my mods. Works well enough for me. I'd be happy for a PR from @passenger94 and we can merge this branch into master and release 3.3.1. After documenting and testing again, of course.

Contributor

ccoupe commented Feb 17, 2016

I think I'm done with my mods. Works well enough for me. I'd be happy for a PR from @passenger94 and we can merge this branch into master and release 3.3.1. After documenting and testing again, of course.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 17, 2016

Contributor

Edit: another advantage of non standard locations is that you can zip/pack libvlc with your script as an option and set paths accordingly (will be platform dependant, but it'll be a user choice only)

Anybody that does that successfully cross platform Will be named "King Of Shoes." All hail their suffering.

Contributor

ccoupe commented Feb 17, 2016

Edit: another advantage of non standard locations is that you can zip/pack libvlc with your script as an option and set paths accordingly (will be platform dependant, but it'll be a user choice only)

Anybody that does that successfully cross platform Will be named "King Of Shoes." All hail their suffering.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 17, 2016

Contributor

haha ! i sure got that !
I mean : if one wants to give a shoes script using video facility to someone else not having vlc or not wanting to install vlc, she/he could do it provided both being on same platform ! just send the (usual packed) script along with a copy of libvlc and plugins dir then set path accordingly, conceivable ?
just tested ok with both libvlc and plugin dir in some random dir (250Mo+ though ...)
Your setup seems to work nice !!! Thanks !!!!!
Doing a PR with synched repo and further fixes, enhancements (regression?)

do we need this ? :
https://github.com/Shoes3/shoes3/blob/video_vlc/samples/expert-video-player.rb#L113
This should be taken care of in Vlc.load_lib (it is, i think)
just require 'shoes/videoffi'; Vlc.load_lib;
and be done ? isn't it the whole purpose of the cobbler ?

Contributor

passenger94 commented Feb 17, 2016

haha ! i sure got that !
I mean : if one wants to give a shoes script using video facility to someone else not having vlc or not wanting to install vlc, she/he could do it provided both being on same platform ! just send the (usual packed) script along with a copy of libvlc and plugins dir then set path accordingly, conceivable ?
just tested ok with both libvlc and plugin dir in some random dir (250Mo+ though ...)
Your setup seems to work nice !!! Thanks !!!!!
Doing a PR with synched repo and further fixes, enhancements (regression?)

do we need this ? :
https://github.com/Shoes3/shoes3/blob/video_vlc/samples/expert-video-player.rb#L113
This should be taken care of in Vlc.load_lib (it is, i think)
just require 'shoes/videoffi'; Vlc.load_lib;
and be done ? isn't it the whole purpose of the cobbler ?

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 18, 2016

Contributor

I've merged everything into master at github so that's were we should finish up any more changes to video. I'm very pleased about this. Thank you for your hard work.

do we need this ? :
https://github.com/Shoes3/shoes3/blob/video_vlc/samples/expert-video-player.rb#L113

I just felt it was a better example of how to determine that you have video capabilities and respond in a GUI friendly manner (the alert) rather than a blank screen with an error message in the hidden console and also moved the required and load into the Shoes.app {} block. Or demonstrating how to catch an expectation.

just send the (usual packed) script along with a copy of libvlc and plugins dir then set path accordingly, conceivable ?
As long as you don't attempt to copy into directories you don't have permissions. Clever people could create a gem with the tar balls inside and an extract script that runs when the gem is required and you could package that HUGE gem with your script. Even bigger GEM if it has all 5 architectures inside !

2nd thought. One could have yet another cobble button to load those tar balls into some new place into the Shoes/Ruby tree (we can write into the gem areas) - very non standard from a Ruby perspective. I don't want to host those files though but someone else could.

Contributor

ccoupe commented Feb 18, 2016

I've merged everything into master at github so that's were we should finish up any more changes to video. I'm very pleased about this. Thank you for your hard work.

do we need this ? :
https://github.com/Shoes3/shoes3/blob/video_vlc/samples/expert-video-player.rb#L113

I just felt it was a better example of how to determine that you have video capabilities and respond in a GUI friendly manner (the alert) rather than a blank screen with an error message in the hidden console and also moved the required and load into the Shoes.app {} block. Or demonstrating how to catch an expectation.

just send the (usual packed) script along with a copy of libvlc and plugins dir then set path accordingly, conceivable ?
As long as you don't attempt to copy into directories you don't have permissions. Clever people could create a gem with the tar balls inside and an extract script that runs when the gem is required and you could package that HUGE gem with your script. Even bigger GEM if it has all 5 architectures inside !

2nd thought. One could have yet another cobble button to load those tar balls into some new place into the Shoes/Ruby tree (we can write into the gem areas) - very non standard from a Ruby perspective. I don't want to host those files though but someone else could.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 18, 2016

Contributor

something is missing here ?
https://github.com/Shoes3/shoes3/blob/master/shoes/video/video.c#L156

As we know that we are going to raise an exception if something is wrong with libvlc path, we just need to Shoes.show_log prior to raise, seems to work from my tests ?
that way, if working, we can keep require and load_lib clean

for the libvlc, plugins dir sharing, the idea was to give the entire responsibility of this, to the user, just letting know it's possible, if on same platform of course ! (plugins dir is like 16 Mo in fact - i was sharing the entire modules dir from a compile setup, with all intermediate files and sources -)

i have no way to test this, going from
https://github.com/Shoes3/shoes3/blob/master/lib/shoes/videoffi.rb#L263
to

    if RUBY_PLATFORM =~ /darwin/ && ENV['VLC_PLUGIN_PATH'].nil?
         ENV['VLC_PLUGIN_PATH']="/Applications/VLC.app/Contents/MacOS/plugins"
    end
    # if you need to pass command line args in, then create them like this:
    # libvlc_new(2, ["--no-xlib", "--no-video-title-show"].pack('p2'))
    @vlci = libvlc_new(0, nil)
    @version = libvlc_get_version
    raise "vlc version #{@version} #{@vlci.inspect}" if @vlci.null?
Contributor

passenger94 commented Feb 18, 2016

something is missing here ?
https://github.com/Shoes3/shoes3/blob/master/shoes/video/video.c#L156

As we know that we are going to raise an exception if something is wrong with libvlc path, we just need to Shoes.show_log prior to raise, seems to work from my tests ?
that way, if working, we can keep require and load_lib clean

for the libvlc, plugins dir sharing, the idea was to give the entire responsibility of this, to the user, just letting know it's possible, if on same platform of course ! (plugins dir is like 16 Mo in fact - i was sharing the entire modules dir from a compile setup, with all intermediate files and sources -)

i have no way to test this, going from
https://github.com/Shoes3/shoes3/blob/master/lib/shoes/videoffi.rb#L263
to

    if RUBY_PLATFORM =~ /darwin/ && ENV['VLC_PLUGIN_PATH'].nil?
         ENV['VLC_PLUGIN_PATH']="/Applications/VLC.app/Contents/MacOS/plugins"
    end
    # if you need to pass command line args in, then create them like this:
    # libvlc_new(2, ["--no-xlib", "--no-video-title-show"].pack('p2'))
    @vlci = libvlc_new(0, nil)
    @version = libvlc_get_version
    raise "vlc version #{@version} #{@vlci.inspect}" if @vlci.null?
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 18, 2016

Contributor

something is missing here ?
https://github.com/Shoes3/shoes3/blob/master/shoes/video/video.c#L156

In this case, OSX is easier. Shoes_Control_Ref is * NSView which what vlc wants to draw in. No special casting is needed.

i have no way to test this, going from
https://github.com/Shoes3/shoes3/blob/master/lib/shoes/videoffi.rb#L263

In this case OSX is harder. VLC can only be installed in /Applications and can't be moved from /Applications easily and if you do, it's not an OSX App that you can browse in to find the libvlc.dylib and plugins. So, OSX can't have two VLC's, unless one of them is built from source but not installed. Linux is actually similar. Windows does allow VLC to be installed in different places so except for your situation (two vlc's, one not installed) only Windows really could use this feature, for regular folks. I should remove that darwin condition however since it's not needed and interferes with the unlikely case that Shoes user actually has build from source vlc and a the normal VLC

Contributor

ccoupe commented Feb 18, 2016

something is missing here ?
https://github.com/Shoes3/shoes3/blob/master/shoes/video/video.c#L156

In this case, OSX is easier. Shoes_Control_Ref is * NSView which what vlc wants to draw in. No special casting is needed.

i have no way to test this, going from
https://github.com/Shoes3/shoes3/blob/master/lib/shoes/videoffi.rb#L263

In this case OSX is harder. VLC can only be installed in /Applications and can't be moved from /Applications easily and if you do, it's not an OSX App that you can browse in to find the libvlc.dylib and plugins. So, OSX can't have two VLC's, unless one of them is built from source but not installed. Linux is actually similar. Windows does allow VLC to be installed in different places so except for your situation (two vlc's, one not installed) only Windows really could use this feature, for regular folks. I should remove that darwin condition however since it's not needed and interferes with the unlikely case that Shoes user actually has build from source vlc and a the normal VLC

ccoupe added a commit that referenced this issue Feb 19, 2016

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 19, 2016

Contributor

Confirmed that on OSX, the Shoes ask_open dialogs will not go inside an App bundle. That's a good thing if you want to pick an App. Not so good to pick something inside an app.bundle. Current behavior is highly likely continue which means on OSX, VLC needs to be in /Applications.

Contributor

ccoupe commented Feb 19, 2016

Confirmed that on OSX, the Shoes ask_open dialogs will not go inside an App bundle. That's a good thing if you want to pick an App. Not so good to pick something inside an app.bundle. Current behavior is highly likely continue which means on OSX, VLC needs to be in /Applications.

@passenger94

This comment has been minimized.

Show comment
Hide comment
@passenger94

passenger94 Feb 19, 2016

Contributor

Ok ! noted :-)

Contributor

passenger94 commented Feb 19, 2016

Ok ! noted :-)

ccoupe added a commit that referenced this issue Feb 21, 2016

WARNING! This commit breaks all GTK builds except Loose Shoes linux
* Issue #206 and bleeds into #133
* -DGTK3 is not required because it's not optional.
   delete the GTK2 source code from gtk.c
* -DVIDEO is not required because it's not optional at build time
* affects all rake files. For the better, longer term.
  will fix them in future commits
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Mar 8, 2016

Contributor

I'm willing to close this issue and release 3.3.1 - Note, closing an issue doesn't mean it's 100% just that its good enough for people to use.

Contributor

ccoupe commented Mar 8, 2016

I'm willing to close this issue and release 3.3.1 - Note, closing an issue doesn't mean it's 100% just that its good enough for people to use.

ccoupe pushed a commit that referenced this issue Mar 26, 2016

Cecil Coupe
for #133 implement shoes_native_surface_remove
* video Test - no black bars on single tests.
* video Test run all still hangs after a test or two.

@ccoupe ccoupe closed this Apr 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment