Page 1 of 1

set_aspect_ratio on OS X

Posted: 01 Nov 2014 16:11
by V.i.t
Hi,

I'm a C++ beginner and, for a non-profit structure, i got to resume the development of a software using the libvlc.
Since few days i'm stuck on a bug which i can't explain. Our program is a simple Qt interface (Qt 4.8.6)
which is supposed to enable the user to easily set a video. It works
on Windows (7), Ubuntu (14) and Mac (10.7, 10.8, 10.9). The user can change everything (gamma, contrast, etc...) but
(and this is the source of my trouble) it can't change the ratio of the video on OS X (it works on other platforms).
To debug i, first, checked all the classes to conclude than good values are sent to the right place.
To change the ratio we use the "libvlc_video_set_aspect_ratio" function.
Secondly, i thought that the issue was the implementation of the video widget
using QMacCocoaViewContainer. To display videos, we embed a QMacCocoaViewContainer
into an independent QMainWindow (independent from the real main window containing the widgets which allow to change settings).
As mentioned in the documentation we simply create a NSView (using objective-c) into a class constructor which inherits from QMacCocoaViewContainer
and we put the NSView as CocoaView attribute.
This is the constructor:

Code: Select all

VideoWidget::VideoWidget(QWidget *parent): QMacCocoaViewContainer(0, parent) { NSView *video = [[NSView alloc] init]; setCocoaView(video); [video setAutoresizesSubviews: YES]; [video setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable]; [video release]; }
We give the WID and the media player pointer to the "libvlc_media_player_set_nsobject" in an other time.
Surprisingly, all other settings work. But not the aspect ratio changing.
(I tried to change the method adding the new value as option, it doesn't work either.)
So my question is, please someone could give me an
idea on where or how to search the solution ?

Thanks for reading.
V.i.t

Re: set_aspect_ratio on OS X

Posted: 16 Nov 2014 18:43
by Jo2003
I'm having the same problem with the Mac Version of the libVLC. In my tests I found out that the last version which works correctly was libVLC2.01. If you use the current version and have a look at the log of the libVLC you'll find following line when changing crop or aspect:

Code: Select all

core vout display error: Failed to change source crop TODO implement crop at core

Re: set_aspect_ratio on OS X

Posted: 10 Dec 2014 14:50
by Jean-Baptiste Kempf
You can crop at the NSView level.