Re: [clutter] actor not refreshing when triggered from outside

2008-07-06 Thread Andre Schmidt
On Sun, 2008-07-06 at 03:38 +0100, iain wrote:
 On Sat, 2008-07-05 at 20:36 +0200, Andre Schmidt wrote:
 
  am i doing something very stupid in that code ?
  or is it maybe a bug ?
  (or does the code work under your system?)
 
 Without having run it you may need to wrap the clutter_actor_move_by
 command in clutter_thread_enter() and clutter_thread_leave() calls as
 its being called from a thread that isn't the main thread. And add
 clutter_threads_init() at the start of main.

thank you very much! exactly what i was missing
(i attached a working code for future reference)

 
 If a clutter function is called from a thread other than the main one
 then they need to be wrapped with _enter and _leave.

i had the feeling that i needed something...
thank you for letting me know!

.andre

 
 iain
 
#include clutter/clutter.h
#include stdlib.h
#include lo/lo.h

ClutterActor *rect;

int move_actor()
{
  printf(trying to move\n);
  clutter_threads_enter();
  clutter_actor_move_by(rect,20,20);
  clutter_threads_leave();
  return 0;
}

int main(int argc, char *argv[])
{
  lo_server_thread st = lo_server_thread_new(7771, NULL);
  lo_server_thread_add_method(st, NULL, NULL, move_actor, NULL);
  lo_server_thread_start(st);
  
  ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff };
  ClutterColor actor_color = { 0xff, 0xff, 0xff, 0x99 };

  g_thread_init(NULL);
  clutter_threads_init();
  clutter_init (argc, argv);

  /* Get the stage and set its size and color: */
  ClutterActor *stage = clutter_stage_get_default ();
  clutter_actor_set_size (stage, 200, 200);
  clutter_stage_set_color (CLUTTER_STAGE (stage), stage_color);

  /* Add a rectangle to the stage: */
  rect = clutter_rectangle_new_with_color (actor_color);
  clutter_actor_set_size (rect, 100, 100);
  clutter_actor_set_position (rect, 0, 0);
  clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
  clutter_actor_show (rect);


  /* Show the stage: */
  clutter_actor_show (stage);

  move_actor();

  /* Start the main loop, so we can respond to events: */
  clutter_main ();

  return EXIT_SUCCESS;

}



Re: [clutter] Sharing textures between two glx contexts

2008-07-06 Thread Chris Lord
On Sun, 2008-07-06 at 21:01 +0200, Filippo Argiolas wrote:
 Hi, within past days I've been doing some test to use clutter for
 gstreamergl rendering. This would really be useful for my SoC project,
 to bring some animated bling to Cheese.

snip

Rather than re-engineering this, you may want to look at the existing
library that does exactly this, clutter-gst:

http://www.clutter-project.org/sources/clutter-gst/

Or, if you're developing against Clutter trunk, you can get the latest
clutter-gst from subversion:

http://svn.o-hand.com/repos/clutter/trunk/clutter-gst/

Hopefully that'll save you some hassle :)

--Chris


-- 
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] Animations not smooth

2008-07-06 Thread Matthew Allum
Hi;

On Sun, 2008-07-06 at 21:52 +0200, Dirk Meyer wrote:

 I want to use imlib2 also for the reflection but I
 need the data from the texture. There seems to be no simple
 get_from_rgb_data function. Any plans to add that for 0.8?

You can use cogl_texture_get_data() - but it would be faster to create
the reflection when you initially have the data from imlib rather than
uploading to texture memory and then re-downloading..

   == Matthew


-- 
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] Sharing textures between two glx contexts

2008-07-06 Thread Filippo Argiolas
Il giorno dom, 06/07/2008 alle 20.55 +0100, Chris Lord ha scritto:
 On Sun, 2008-07-06 at 21:01 +0200, Filippo Argiolas wrote:
  Hi, within past days I've been doing some test to use clutter for
  gstreamergl rendering. This would really be useful for my SoC project,
  to bring some animated bling to Cheese.
 
 snip
 
 Rather than re-engineering this, you may want to look at the existing
 library that does exactly this, clutter-gst:
 
 http://www.clutter-project.org/sources/clutter-gst/
 
 Or, if you're developing against Clutter trunk, you can get the latest
 clutter-gst from subversion:
 
 http://svn.o-hand.com/repos/clutter/trunk/clutter-gst/
 
 Hopefully that'll save you some hassle :)

Hi Chris I'm already aware of your work ;). 
The thing I want to accomplish though is quite different:
I know I can use clutter-gst to render gstreamer data into a clutter
texture but it creates it from rgb data. With gstreamergl I have
x-raw-gl data, i.e. a texture containing the current video frame and I'd
like share just that with cluttertexture, without having to retrieve
pixels from video memory since that would introduce a slowdown in the
pipeline.
The reason I cannot use just clutter-gst for my work on cheese is that I
need to apply shader effects within the gstreamer pipeline because
that's needed to save manipulated photos and video. So I'd like to use
clutter just as a sink after doing some shader based opengl effect on
the video stream.
Feel free to ask details,
Cheers


Filippo



signature.asc
Description: Questa è una parte del messaggio	firmata digitalmente


Re: [clutter] Sharing textures between two glx contexts

2008-07-06 Thread Matthew Allum
Hi;

On Sun, 2008-07-06 at 21:01 +0200, Filippo Argiolas wrote:
 This could probably be done in gstreamergl creating our context with the
 clutter one marked as shared.
 Is there someway to retrieve the GLXContext from clutter backend? I see
 there is some api to retrieve X11 stuff like display, screen, window,
 etc.. is there some equivalent thing for glx? 

You could maybe try glXGetCurrentContext () ?

  == Matthew

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] Sharing textures between two glx contexts

2008-07-06 Thread Filippo Argiolas
Il giorno dom, 06/07/2008 alle 21.09 +0100, Matthew Allum ha scritto:
 Hi;
 
 On Sun, 2008-07-06 at 21:01 +0200, Filippo Argiolas wrote:
  This could probably be done in gstreamergl creating our context with the
  clutter one marked as shared.
  Is there someway to retrieve the GLXContext from clutter backend? I see
  there is some api to retrieve X11 stuff like display, screen, window,
  etc.. is there some equivalent thing for glx? 
 
 You could maybe try glXGetCurrentContext () ?

Yup, you're right.. it was so simple! Now let me make some test to see
if it solves the black screen issue.
Besides, do you think I'm doing this thing in the right way? I mean with
texture_from_foreign, etc?
Thanks

Filippo


signature.asc
Description: Questa è una parte del messaggio	firmata digitalmente


[clutter] eglnative events : CLUTTER_MOTION not followed by CLUTTER_BUTTON_RELEASE

2008-07-06 Thread Olivier Butler


Hi,

I'm trying to make clutter+tidy working on a Imx31 SOM module ( --with- 
flavour=eglnative) .


test-finger-scroll is not working well :

1- the scroll-bar does not vanish after sweeping the screen with one  
finger

2- there is not deceleration effects
3- while scrolling the scroll-bar repaint all the screen instead of  
repainting only the bar itself



About 1  2,  I found that the issue is on the clutter-event-egl.c file.
The visible issue is that the CLUTTER_MOTION event should be  
followed by a CLUTTER_BUTTON_RELEASE. Witch it is not the case.

This causes the 1  2 issues.

After spending hours on this file, I found that clutter_event_dispatch  
function occur less often than   new TS samples.
This function will make ts_read one time even there is more than 1  
sample pending.


That's what I found, I didn't find any solution.
I hope someone got it.  If not the MOTION event is not usable on my  
platform.


About 3-, if someone 's got any hint ?


regards
olivier


--
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] Sharing textures between two glx contexts

2008-07-06 Thread Matthew Allum
Hi;

On Sun, 2008-07-06 at 22:26 +0200, Filippo Argiolas wrote:
 
 Yup, you're right.. it was so simple! Now let me make some test to see
 if it solves the black screen issue.

Fingers crossed!

 Besides, do you think I'm doing this thing in the right way? I mean with
 texture_from_foreign, etc?

Yeah, I *think* so - difficult to really say however without seeing the
code. It would indeed be nice if the gstreamer-gl sink just worked with
Clutter though afaik it is really orientated to being the single
renderer targetting a X drawable (its subcalsses the base X thingy
iirc?) and working around that could be the difficult part. Im no
gstreamer expert however.

  == Matthew 

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]