set_aspect_ratio on OS X

This forum is about all development around libVLC.
V.i.t
New Cone
New Cone
Posts: 1
Joined: 01 Nov 2014 15:05

set_aspect_ratio on OS X

Postby V.i.t » 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:

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

Jo2003
Blank Cone
Blank Cone
Posts: 67
Joined: 08 Feb 2010 13:29

Re: set_aspect_ratio on OS X

Postby Jo2003 » 16 Nov 2014 18:43

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: set_aspect_ratio on OS X

Postby Jean-Baptiste Kempf » 10 Dec 2014 14:50

You can crop at the NSView level.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests