glupload, glimagesink openGL question

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: glupload, glimagesink openGL question

Miquel Àngel Farré
sorry, attached now

2009/8/30 Julien Isorce <[hidden email]>
Hi,

Thx for the patch but it seems that it's not attached to the bug:
http://bugzilla.gnome.org/show_bug.cgi?id=593486

Julien

2009/8/29 Miquel Àngel Farré <[hidden email]>


Bug opened and patch uploaded

2009/8/28 Julien Isorce <[hidden email]>
Hi Miquel,

Could you review your changes and make a patch that I would be able to commit ?

-> remove unused line at the begnning
-> use gpointer instead of void*
-> let the #ifdef WIN32 you removed
->  replace the last
g_print ("no yet implemented if not win32\n");
 return -1;

by glXMakeCurrent (sdl_display, None, 0);
-> remove APPLE and mach stuffs at the beginning
-> put #include <GL/glx.h> in a #ifndef WIN32

Then open a bug and attach your patch using git-format

Julien

2009/8/27 Miquel Àngel Farré <[hidden email]>
Julien,

 Thanks a lot for your sdl example, I have changed some things related with sdl_syswm and some casts and finally it works fine on linux :)

Atached you can find the modified example and his makefile


Thanks,

Miquel

2009/8/26 Julien Isorce <[hidden email]>
Hi Miquel,

Take a look at gst-plugins-gl/tests/examples/sdl/sdlshare.c example.

(note that I have currently only tested it on win32, but I did the stuffs for GLX, so it should work on linux too)

I think your use case is a little bit more complex because you was talking about threads,
maybe because of sdl main loop and glib main loop.
So if you succeed then I would like to put your example in gst gl git.

Regards
Julien



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: glupload, glimagesink openGL question

Julien Isorce
In reply to this post by Julien Isorce
Hi,

As I told you I am not surprised.
Send me your code I think I know where is the problem but hard to explain.
Julien


2009/8/26 Julien Isorce <[hidden email]>
Hi Miquel,

I think your use case is a little bit more complex because you was talking about threads,
maybe because of sdl main loop and glib main loop.
So if you succeed then I would like to put your example in gst gl git.

Regards
Julien


2009/8/31 Miquel Àngel Farré <[hidden email]>
Good Morning Julien,

Definitely it seems that the problem is on my code, I have modified a bit your example, specifically the pipeline:   

 GST_PIPELINE (gst_parse_launch
    ("filesrc location =../../gstreamer/dumps/bbc.ts ! mpegtsparse ! mpegtsdemux program-number=4229 ! queue ! mpeg2dec ! videoscale ! video/x-raw-yuv,pixel-aspect-ratio=1/1 ! glupload ! fakesink sync=true", NULL));

This is what I do on my test application and doesen't work (it seems sthat there is no sync.. nevertheless on your test example works fine)

Biggest difference between my code and your example is that I have a thread with a bucle and a drawglscene() function inside (very similar to yours).

Parameters to drawglscene are texture, width and height which I actualize through update_sdl_scene...

I don't know if this could cause the async playing... nevertheless I wanted to share with you this difference between your code and mine..

 





 


2009/8/26 Julien Isorce <[hidden email]>
Hello Miquel,

First, the fact to be able to use the texture from gstgl and use them into your own opengl scene (through your favorite GL framework: clutter, SDL, Qt etc..) is possible (see cluttershare example), interesting and a need for a lot of people.

Actually, I was waitting for someone that uses SDL. I would like to have an example like (cluttershare.c example that uses the framework clutter) but I want one example with SDL.
So this is you

We will try to make it works

2009/8/26 Miquel Àngel Farré <[hidden email]>
Julien,


I am managing my openGL scene under linux, using SDL.

I have tryed xoverlay: glimagesink sending video to my openGL context through his windowID.

I was able to see the video on my openGL context screen, the problem is flickering, in my application I am doing something like:
Flickering is often due to background redraw.
You have to desactivate it trough SDL API.


while(true)
{
 
  glClear(); 
  for (all textures)
  {
    draw();
  }
  glSwapBuffers();
 }

 Another (secundary) problem is that sometimes I need the video in a little quad instead of fullscreen..

In this case you have to do the same thing as cluttershare example, but using SDL.
 

What do you think is the best way to implement it?


Thanks,


Miquel


2009/8/26 Julien Isorce <[hidden email]>


2009/8/26 Miquel Àngel Farré <[hidden email]>

Bug is submitted!

Putting the bug apart, if I do something like mpegtsdemux ! queue ! glupload ! appsink, what I have at the output are opengl textures right? So I can draw it directly into a quad ? 
 
This is not exact.

If you are making an OpenGL scene, and you want to put gstgl textures into this scene.
(then it means that you are managing your opengl context and your are also familiar with OpenGL API)
Then gst-plugins-gl/tests/examples/clutter/cluttershare.c is the example you need.
(But it's not so easy. you have to share your OpenGL context with the one inside gl elements)

If you are not familiar with opengl and you just want to display the video on a quad, then you should consider to look into gst-plugins-gl/tests/examples/generic/cube and gst-plugins-gl/tests/examples/qt/qglwidgetxoverlay



The bigger reason of use glupload is avoid the raw-yuv to rgb conversion..

So if your are not managing your own opengl scene, then just look into
gst-plugins-gl/tests/examples/gtk/gtkxoverlay
This example shows how to use the xoverlay interface.


Just a question in case your are familiar with OpenGL and if you are already managing your own OpenGL scene,  which framework are you using ? on which OS ?

Regards
Julien
 


Thanks,


Miquel

2009/8/26 Julien Isorce <[hidden email]>


2009/8/26 Florent <[hidden email]>
Hi

>  * Question: what glupload ! glimagesink do?

glimagesink uses glupload internally, so you don't need it for using
glimagesink. You need glupload only if you want to filter the frames
using opengl (ex: glupload ! gleffects effect=2 ! glimagesink)

Florent



 Doesen't work:

   gst-launch -v -m filesrc location=../dumps/itv.ts !  mpegtsdemux program-number="8442" ! queue ! mpeg2dec ! glupload ! glimagesink

   gst-launch -v -m filesrc location=../dumps/itv.ts !  mpegtsdemux program-number="8442" ! queue ! mpeg2dec ! glupload ! gldownload ! glimagesink

 * Question: what glupload ! glimagesink do?


Thanks,


 Miquel
 
Hi,

Both should work,
Please file a bug and attach the console log of:

GST_DEBUG=gldisplay:3 gst-launch -v -m filesrc location=../dumps/itv.ts !  mpegtsdemux program-number="8442" ! queue ! mpeg2dec ! glupload ! glimagesink

and:

GST_DEBUG=gldisplay:3 videotestsrc ! "video/x-raw-yuv, format=(fourcc)I420" ! glupload ! glimagesink

Julien




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
12