get mouse navigation events on application level ?
Tim-Philipp Müller
t.i.m at zen.co.uk
Wed Aug 14 10:26:56 PDT 2013
On Wed, 2013-08-14 at 16:41 +0200, adrian at tortenboxer.de wrote:
Hi,
> In my application the stream from a live camera (appsrc) is displayed
> in a GTK drawarea (autovideosink+gst_video_overlay_set_window_handle).
> I would like to be able to interactively draw rectangular selections on
> the video. For the drawing I can use a cairooverlay element, but it is
> not clear to me how to subscribe to mouse navigation events.
>
> That is, using GTK (motion-notify-events of the drawing_area etc.) I
> can get the widget-relative pointer coordinates, but then I have to
> calculate the frame-relative coordinates myself (which might be
> inaccurate, considering I force the aspect ratio so that the video
> overlay is possibly much smaller than the drawing area widget itself).
> I can see how the navigationtest element does the job, looking at its
> source code, but I am under the impression that I would have to
> implement a gstreamer element in order to subscribe to these upstream
> propagating events. Am I wrong ? In any case the application developer
> manual does not explain how to connect to these events. Is there
> another element which exposes the "mouse-move" etc. events ?
Well, it's quite an obscure feature, mostly used for things like DVD
menu navigation :)
But you're right in that you have to write your own element in order to
pick up these events.
http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/video/navigation.h
has a few helper functions (which don't seem to be appear in the docs it
seems, something to fix).
Cheers
-Tim
More information about the gstreamer-devel
mailing list