basic-tutorial-1 on MacOS High Sierra fails to open window

Matthew Waters ystreet00 at gmail.com
Tue Jan 2 03:16:06 UTC 2018


The difference between the basic-hello-world example and the
basic-playback example is that the latter uses a GMainLoop for the event
loop whereas the former directly pops GstMessage's off the GstBus.  This
matters because in order to perform GUI related functionality, macOS
requires that the application be running a CFRunLoop and
if you're running with the binaries provided by the GStreamer project,
then they contain additions to GMainLoop to run a CFRunLoop alongside
the GMainLoop.

Without such an addition, the application would need to run their own
CFRunLoop using something like
https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/gl/cocoa/cocoa-videooverlay.m#n222
as a kludge.

As far as the example is concerned, I think the intention of the
basic-examples is that they don't rely on the use of GMainLoop for
simplicity reasons to avoid introducing event processing and to show
that GMainLoop is *not* required for interacting with GStreamer (a
common misconception) however they could be ported to the use of
GMainLoop for the macOS use case or also pump the main CFRunLoop.

Hope that helps.
-Matt

On 02/01/18 09:30, Sean Ogden wrote:
> First - love your work guys.  I think more people need to know that.
>  So getting inexperienced people using your stuff is the way to go.
>  So its a bit of a problem when the hello world doesn't work as
> expected, so I hope you don't think this trivial
>
> First, my setup.  I do not normally develop in C, so my experience is
> on a pretty fresh XCode, and my machine is pretty clean. 
> Following the instructions
> at https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html
>
> Everything compiles and runs, I get audio, but *no window with video*.
>
> I was able to run the gst_parse_launch command string
> through /Library/Frameworks/GStreamer.framework/Versions/1.0/bin/gst-launch-1.0
> with no trouble. Window came up fine.
>
> After trying to work out how to debug such a problem - and I would
> love to have advice from an experienced XCode developer - How do you
> debug windows events??? I'm guessing you need to be in the know of
> exactly what debug context will expose them from the rest of the
> debugging data.
>
> I then tried the *example **playback-tutorial-1.c.  That worked.* So
> direct instantiation and manipulation of the g_object playbin works.
>
> With my inexperienced xcode / c debugging I discovered: 
>
> pipeline = gst_parse_launch ("playbin
> uri='file:///Users/drsog/Local/GStream_dev/gst-docs/examples/tutorials/test.mp4'",
> error);
> returns with a pipeline with 
> current_stateGstStateGST_STATE_NULL
> error is null 
>
>
> After gst_element_set_state (pipeline,
> GST_STATE_PLAYING); pipeline has the following state:
> current_stateGstStateGST_STATE_READY
> next_stateGstStateGST_STATE_PAUSED
> pending_stateGstStateGST_STATE_PLAYING
> and ret = GST_STATE_CHANGE_FAILURE
>
> So the obvious question is how to get debugging info
> on GST_STATE_CHANGE_FAILURE.
> Or is the practice to recompile al of gst to get debugging info (or on
> the mac apparently dSYM packages with dwarf-with-dsym set
> <https://medium.com/@maxraskin/background-1b4b6a9c65be>) so xcode can
> bind the sources in debug), and then trace to the cause?
>
> Happy to look into it further myself if someone would be kind enough
> to mentor me so I don't go down too many rabbit holes.
>
> Regards,
>
> Sean Ogden
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180102/6afadedd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 516 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180102/6afadedd/attachment-0001.sig>


More information about the gstreamer-devel mailing list