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 728451 - glimagesink: expects a NSWindow instead of a NSView as the window handle
glimagesink: expects a NSWindow instead of a NSView as the window handle
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal blocker
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-17 17:48 UTC by Andoni Morales
Modified: 2014-05-02 05:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andoni Morales 2014-04-17 17:48:47 UTC
glimagesink's GstVideoOverlay implementation expects a NSWindow instead of a NSView in set_window_handle, breaking backwards compatibility and making it more difficult to embed in applications.
Comment 1 Julien Isorce 2014-04-23 10:36:55 UTC
Hi, indeed. Looking at osxvideosink implementation I can see it adds its internal NSView to the foreign view passed with set_window_handle:

[internalView addSubview:foreignView];

Whereas currently we set our internal view as the view of the foreign window:

[foreignWindow setContentView: internalView];

I'll have a try with the example in gst-plugins-gl/tests/examples/cocoa/videooverlay/. It was in my plan to move it to -bad too.
Comment 2 Julien Isorce 2014-04-24 09:40:56 UTC
commit 510040e0336a57d3244df0a0ffe751040753dd43
Author: Julien Isorce <julien.isorce@gmail.com>
Date:   Thu Apr 24 10:37:00 2014 +0100

    gl/cocoa: pass a NSView to set_window_handle instead of a NSWindow
    
    Fix backwards compatibility
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728451
Comment 3 Julien Isorce 2014-04-24 09:44:19 UTC
I will move gst-plugins-gl/tests/examples/cocoa/videooverlay/main.m  to -bad before to close the bug. Maybe tomorrow.

The diff is just to replace "window" by "[window contentView]" in gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)), (guintptr) window);
Comment 4 Julien Isorce 2014-04-29 07:50:21 UTC
So in order to move gst-plugins-gl/tests/examples/cocoa/videooverlay/main.m  to -bad I did the following:

1- In in a clone dir of gst-plugins-gl:
git format-patch --subject-prefix="" --numbered  --root --  tests/examples/cocoa/

It generates 18 patches to keep this history: http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/log/tests/examples/cocoa

0001-add-Cocoa-xoverlay-interface-example.patch
0002-make-cocoa-backend-work-on-MacOSX.patch
0003-Cocoa-backend-fix-crash-when-resizing.patch
0004-Cocoa-backend-improve-support-on-GNUStep.patch
0005-tests-replace-_set_xwindow_id-with-_set_window_handl.patch
0006-cocoa-example-remove-white-spaces.patch
0007-cocoa-example-do-not-set-pipeline-to-null-state-twic.patch
0008-objc-add-GST_OBJCFLAGS-and-friends.patch
0009-Update-versioning-for-gstreamer-1.0.patch
0010-tests-update-for-1.0.patch
0011-update-add-.gitignore-files.patch
0012-determine-the-GL-platform-to-use-at-runtime.patch
0013-fix-cocoa-videooverlay-example.patch
0014-remove-GNUstep-makefiles.patch
0015-fix-build-failure-when-building-Cocoa-tests.patch
0016-Use-gst_object_-un-ref-so-we-can-get-refcounts-in-th.patch
0017-cocoa-fix-build-when-GNUSTEP-is-not-defined.patch
0018-gl-Some-less-long-ulong-gulong-usage.patch

For example the content of 0001-add-Cocoa-xoverlay-interface-example.patch is :
...
From: Julien Isorce <julien.isorce@gmail.com>
Date: Sat, 7 Mar 2009 03:17:04 +0100
Subject: [01/18] add Cocoa xoverlay interface example
...

2- In a clone dir of gst-plugins-bad, from master branch:
git checkout -b move_gl_cocoa_example
git am -3 -k *.patch  (-k to keep [n/m])

3- now merge:
git checkout master
git merge --no-ff -m "examples: move cocoa-videooverlay from gst-plugins-gl" move_gl_cocoa_example

the log would looks like:

commit a170e4ede596ff81a03ce70c83ced91bc3d49617
Merge: 4e90366 a0154c
Author: Julien Isorce <julien.isorce@gmail.com>
Date:   Sun Apr 27 19:36:20 2014 +0100

    examples: move cocoa-videooverlay from gst-plugins-gl

commit a0154cbbed3303769042514f37cc75de59bf48df
Author: Sebastian Dröge <slomo@circular-chaos.org>
Date:   Wed Jul 17 11:22:02 2013 +0200

    [18/18] gl: Some less long/ulong/gulong usage

commit f33a1d381b5c8b1e9220e94b97f27bc349948614
Author: Julien Isorce <julien.isorce@gmail.com>
Date:   Wed Jul 10 15:47:23 2013 +0100

    [17/18] cocoa: fix build when GNUSTEP is not defined

commit 99df7c26cd471122234fbc7ce055780b76e4c96f
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Thu Jun 13 14:36:41 2013 +1000

...

    [01/18] ...


But then I would like to rename the test from tests/examples/cocoa to tests/examples/overlay/cocoa-videooverlay.m to match same naming as in gst-plugins-base.

The result is that git log tests/examples/overlay will no show the old history. It would require to do git log --follow

It would be the same result as gstglimagesink.c : http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/log/ext/gl/gstglimagesink.c where we do not see commits earlier than the move except if you pass --follow

It is ok to do this way ?
Comment 5 Julien Isorce 2014-04-29 08:12:42 UTC
Also I think the history for this example is not particularly interesting so I would go for just one commit that adds tests/examples/overlay/cocoa-videooverlay.m and its Makefile.am + activation in configure.ac, based on the code from gst-plugins-gl/tests/examples/cocoa/videooverlay/main.m 

Any suggestion ? (see also solution #4)
Comment 6 Matthew Waters (ystreet00) 2014-04-29 08:46:01 UTC
I have a patch that just moves all of the examples into their own gl directory from gst-plugins-gl that I am about to push.  I didn't bother with preserving the history for the examples.
Comment 7 Julien Isorce 2014-04-29 09:08:37 UTC
ah nice! Go ahead :) . I'll do the fix for the cocoa example after your push.
Comment 8 Julien Isorce 2014-05-02 05:09:12 UTC
commit 619e7be7489d0f7a65288e4f72ee3c798618a2a3
Author: Julien Isorce <julien.isorce@gmail.com>
Date:   Fri May 2 05:51:36 2014 +0100

    gl: pass NSView instead of NSWindow in cocoa-videooverlay example
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728451