After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676331 - osxvideosink: Improvements for OSX's video sink
osxvideosink: Improvements for OSX's video sink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other Mac OS
: Normal enhancement
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-18 15:52 UTC by Andoni Morales
Modified: 2012-11-24 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-osvideosink-create-destroy-resize-and-draw-from-the-.patch (8.57 KB, patch)
2012-05-18 15:57 UTC, Andoni Morales
committed Details | Review
0002-osxvideosink-implement-the-navigation-interface.patch (8.21 KB, patch)
2012-05-18 15:57 UTC, Andoni Morales
committed Details | Review
0003-osxvideosink-start-internal-window-if-no-view-is-pro.patch (12.63 KB, patch)
2012-05-18 15:58 UTC, Andoni Morales
committed Details | Review
0004-osxvideosink-add-force-aspect-ratio-property.patch (5.37 KB, patch)
2012-05-18 15:59 UTC, Andoni Morales
committed Details | Review
0005-osxvideosink-fix-navigation-when-force-aspect-ratio-.patch (4.61 KB, patch)
2012-05-18 16:00 UTC, Andoni Morales
committed Details | Review
0006-osxvideosink-reset-the-embed-property-for-backward-c.patch (2.88 KB, patch)
2012-05-18 16:01 UTC, Andoni Morales
committed Details | Review

Description Andoni Morales 2012-05-18 15:52:29 UTC
The attached patches provides the following list of improvements for osxvideosink:
  * create and internal window when no one is provided through the GstVideoOverlay API, which makes it work again with gst-launch.
  * implement the GstNavigation interface.
  * add 'force-aspect-ratio' property to respect the input PAR adding black borders.

The creation of an internal Cocoa window, needed to make this sink usable with gst-launch for instance, was removed some time ago because it was racy causing random crashes. This happens because Cocoa's framework is not thread-safe and all cocoa-related operations must always happen in the "main thread", which is the first thread created by the application.

This issues is now fixed deferring all the operations to create, resize, draw frame  and destroy to the main thread using performSelectorOnMainThread.

For this to work, the main run loop must be running to process theses messages and convert them into calls on the main thread. A typical GUI application will always be running the main run loop in the main thread, as it happens with every native Cocoa application calling [NSApp run], gtk application calling gtk_main() (gdk event loop integrates with cocoa's one) or qt apps.

For applications that don't run the main run loop in the main thread, like gst-launch, we assume that there is at least glib's main loop spinning in this main thread. This allows us attaching a GSource that poll events regularly on the main thread to make the internal Cocoa Window responsive and process the performSelectorOnMainThread calls.

You can find the branch with the proposed patches here:
https://github.com/ylatuya/gst-plugins-good/commits/osxvideosink
Comment 1 Andoni Morales 2012-05-18 15:57:12 UTC
Created attachment 214364 [details] [review]
0001-osvideosink-create-destroy-resize-and-draw-from-the-.patch

Call create, destroy, resize and draw from the main thread
Comment 2 Andoni Morales 2012-05-18 15:57:45 UTC
Created attachment 214365 [details] [review]
0002-osxvideosink-implement-the-navigation-interface.patch

Implement the GstNavigation interface
Comment 3 Andoni Morales 2012-05-18 15:58:28 UTC
Created attachment 214366 [details] [review]
0003-osxvideosink-start-internal-window-if-no-view-is-pro.patch 

Start an internal window when no external view is provided
Comment 4 Andoni Morales 2012-05-18 15:59:25 UTC
Created attachment 214367 [details] [review]
0004-osxvideosink-add-force-aspect-ratio-property.patch

Add 'force-apsect-ratio' porperty to keep DAR drawing black borders
Comment 5 Andoni Morales 2012-05-18 16:00:02 UTC
Created attachment 214368 [details] [review]
0005-osxvideosink-fix-navigation-when-force-aspect-ratio-.patch 

Fix navigation when using black borders
Comment 6 Andoni Morales 2012-05-18 16:01:35 UTC
Created attachment 214369 [details] [review]
0006-osxvideosink-reset-the-embed-property-for-backward-c.patch 

Reset the embed property for application that want tho embed their own view but don't respond the 'have-ns-view' synchronously.

'have-ns-view' should be completely removed for 1.0 in favour of the GstVideoOverlay API.
Comment 7 Tim-Philipp Müller 2012-11-24 15:08:44 UTC
Looks like these were pushed a while ago:


commit 04e8a9fa574cc6058f290b08b833e111d167271c
Author: Andoni Morales Alastruey <ylatuya@gmail.com>
Date:   Wed May 16 21:52:45 2012 +0200

    osxvideosink: reset the embed property for backward compatilibity

commit b0e664ca7bac61f62378fcb434561fc60bf57f2b
Author: Andoni Morales Alastruey <ylatuya@gmail.com>
Date:   Wed May 16 21:12:22 2012 +0200

    osxvideosink: fix navigation when force-aspect-ratio is activated

commit 31d6828cd1e82de1b4aa1e21ae5f8dccc35575d6
Author: Andoni Morales Alastruey <ylatuya@gmail.com>
Date:   Wed May 16 18:52:45 2012 +0200

    osxvideosink: add force-aspect-ratio property

commit 8132de5d96f12935bc5bb978cf03f3e63ef21076
Author: Andoni Morales Alastruey <ylatuya@gmail.com>
Date:   Mon May 14 18:01:02 2012 +0200

    osxvideosink: start internal window if no view is provided

commit 8daff6e1c77f0aec9e1e7fd57c5f228a4677e5a0
Author: Andoni Morales Alastruey <ylatuya@gmail.com>
Date:   Mon May 14 14:27:58 2012 +0200

    osxvideosink: implement the navigation interface

commit 37a90e96e6c17bdb355401555e77430b003fd41a
Author: Andoni Morales Alastruey <ylatuya@gmail.com>
Date:   Fri May 11 18:24:08 2012 +0200

    osvideosink: create, destroy, resize and draw from the main thread