set_aspect_ratio on OS X
Posted: 01 Nov 2014 16:11
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:
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
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];
}
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