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 538656 - xvimagesink support for autofill/colorkey property
xvimagesink support for autofill/colorkey property
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal enhancement
: 0.10.21
Assigned To: Stefan Sauer (gstreamer, gtkdoc dev)
GStreamer Maintainers
: 538659 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-16 19:40 UTC by tzicatl
Modified: 2008-07-29 08:59 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
implement custom colorkey handling (4.31 KB, patch)
2008-06-25 13:20 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review
test application (4.56 KB, text/plain)
2008-06-25 13:21 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
  Details

Description tzicatl 2008-06-16 19:40:49 UTC
Curretly xvimagesink does autofill-colorkey. That is it fills the drawable with the colorkey so that you see the video. 
The programmer can fill the drawable by himself with the colorkey he chooses and paint things (like rectangles) with a different color over it. The video will be seen where the colorkey is visible.
Comment 1 tzicatl 2008-06-16 19:41:07 UTC
Nieto, Noe M schrieb:
> Hi everybody,
> 
>  
> 
> I am writing an application where the user should be able to draw 
> (with the mouse) a rectangle on a playing video window (for now it is 
> an ximagesink).

Thats not so easy. Curretly xvimagesink does autofill-colorkey. That is it fills the drawable with the colorkey so that you see the video. Please file an enhancement request, so that xvimagesink supports a property to turn off autofill and another to tell you about the colorkey. Then you can fill the drawable yourself with the colorkey and paint your rectangle in a different color over it. The video will be seen where the colorkey is visible.

Stefan
> 
>  
> 
> I try the following but I see nothing drawing on the screen…
> 
> ### CONFIGURE PIPELINE TO CATCH SYNC MESSAGES
> 
> bus = self.Pipeline.get_bus()
> 
> bus.add_signal_watch()
> 
> bus.enable_sync_message_emission()
> 
> bus.connect('message', self.on_message)
> 
> bus.connect('sync-message::element', self.on_sync_message)
> 
>  
> 
>  
> 
> #############
> 
> ## Tell ximagesink to draw into the draw area that I give it, not in 
> it’s own …
> 
>     def on_sync_message(self, bus, message):
> 
>       if message.structure is None:
> 
>             return
> 
>       message_name = message.structure.get_name()
> 
>       if message_name == "prepare-xwindow-id":
> 
>             imagesink = message.src
> 
>             imagesink.set_property("force-aspect-ratio", True)
> 
>             imagesink.set_xwindow_id(self.DrawingArea.window.xid)
> 
>  
> 
> #############
> 
> ## Now, on the expose event of the drawing area, paint the rectangle 
> according to user input (mouse)
> 
> #############
> 
>     def on_DrawingAreaCamera_expose_event(self,widget,event):
> 
>         #if self.area_selection_now is True:
> 
>         context = widget.window.cairo_create()
> 
>         #widget.window.draw(context)
> 
>         context.rectangle(self.area_selection)
> 
>         context.set_source_rgb(1,0,0)
> 
>         context.stroke()
> 
>  
> 
>  
> 
> What is the right way to interact with ximagesink, so I can also draw 
> things on it’s drawable??
> 
>  
> 
> Regards
> 
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-17 09:50:30 UTC
*** Bug 538659 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-17 09:54:40 UTC
Its not mandatory for drivers to support those. The options I see so far:
1) 4 normal object properties
gboolean autofill
gboolean has-autofill
GdkColor colorkey
gboolean has-colorkey
2) a colorkey interface with two iface properties
gboolean autofill
GdkColor colorkey

2) only makes sense if similar colorkey handling exists anywhere else. It would also rely on GstImplementsInterface (as we know of the atoms when probing the hardware)
Comment 4 David Schleef 2008-06-17 17:38:42 UTC
Setting properties is allowed to fail silently, so 'has-*' is not necessary.  The application is responsible for reading back the property to see that is has the intended value.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-25 13:20:32 UTC
Created attachment 113397 [details] [review]
implement custom colorkey handling
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-25 13:21:26 UTC
Created attachment 113398 [details]
test application

small standalone test app, that does fakeshading with a checker pattern
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-30 11:08:33 UTC
Noe, have you had a chance to try the change?
Comment 8 tzicatl 2008-06-30 15:48:01 UTC
Tonight I will download a snapshot and try it.

I will let you know ...
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2008-07-02 05:50:08 UTC
One more thing. Right now the "colorkey" property exposes the color key the gstreamer sets (which right now is rgb={1,2,3}). I made the "colorkey" property readonly and just allow the app to query this so far. We might also want to allow the application to set a colorkey.
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2008-07-29 08:59:30 UTC
Thaytan was okay with this on irc too.

2008-07-29  Stefan Kost  <ensonic@users.sf.net>

	* sys/xvimage/xvimagesink.c:
	* sys/xvimage/xvimagesink.h:
	  Add autofill/colorkey properties. Fixes #538656.