Raw Pointer to GLContext

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

Raw Pointer to GLContext

Malte
Hi *,

I'm trying to retrieve the raw "long" pointer to a GLContext object. I guess this is not really done often,
but the idea is to pass that pointer to another piece of (raw C-) code, that shares the same context as the java app (its not the same thread, so I really need to pass the context pointer...).

Is there a way to do this?

Thanks,
Malte
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Sven Gothel
Administrator
On Friday, June 18, 2010 01:20:02 Malte [via jogamp] wrote:

>
> Hi *,
>
> I'm trying to retrieve the raw "long" pointer to a GLContext object. I guess
> this is not really done often,
> but the idea is to pass that pointer to another piece of (raw C-) code, that
> shares the same context as the java app (its not the same thread, so I
> really need to pass the context pointer...).
>
> Is there a way to do this?

Hi Malte,

what you probably want is not the memory pointer to the JavaVM heap of GLContext,
but the OpenGL context handle, which you could 'reuse' in native OpenGL calls ?!


If so - and only this make sense IMHO, please check:

http://jogamp.org/deployment/jogl-next/javadoc_public/javax/media/opengl/GLContext.html#getHandle%28%29

Cheers, Sven
>
> Thanks,
> Malte
>
> ______________________________________
> View message @ http://jogamp.762907.n3.nabble.com/Raw-Pointer-to-GLContext-tp904275p904275.html
> To start a new topic under jogamp, email [hidden email]
> To unsubscribe from jogamp, click http://jogamp.762907.n3.nabble.com/subscriptions/Unsubscribe.jtp?code=c2dvdGhlbEBqYXVzb2Z0LmNvbXw3NjI5MDd8MzkxNDI4MzU5
>
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Malte
Hey Sven,

wow - what a quick response.

You are right, I was quite imprecise - but you still guessed it right ;-)

I think this will do what I need - I just did not think of the word "handle" for the thing I was looking for.

Just as an info: What I basically want to do: Use gstreamer, which has a (i think quite experimental) glupload plugin, that can copy video streams into an opengl texture. By sharing the context with that plugin, and using JOGL + java-gstreamer, it should be possible to bring the whole media world to java+opengl.

But at the moment, I am trying to hack some kind of prototype together, to see if this is REALLY possible. And that's the reason why so "stupid" questions come up ;-) ...

Thanks for the help ... Thumps up!
Malte
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Malte
... argh - perhaps that was a bit too fast: In the GLContext used in my current version of JOGL, I do not see that specific method "getHandle".

Is the version you are refering to a special version of JOGL?


... I try to build JOGL from the latest GIT sources and see what happens ...
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Malte
As far as I can see, this is not THAT long in the source tree ;-)

However, I tried to build JOGL on Mac OS X, and it fails:

generate.grammar:
    [javac] Compiling 5 source files to /Users/mnuhn/Desktop/opengl/jogl/gluegen/build/classes
    [javac] Compiling 28 source files to /Users/mnuhn/Desktop/opengl/jogl/gluegen/build/classes
    [javac] /Users/mnuhn/Desktop/opengl/jogl/gluegen/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java:322: incompatible types
    [javac] found   : java.util.List<java.lang.Class>
    [javac] required: java.util.List<java.lang.Class<?>>
    [javac]             List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
    [javac]                                                          ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error

any ideas? Or can i grab a compiled version somewhere?

Cheers,
Malte
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Sven Gothel
Administrator
On Friday, June 18, 2010 03:27:48 Malte [via jogamp] wrote:
>
> As far as I can see, this is not THAT long in the source tree ;-)
Yes, we are working hard and cleaning up :)

>
> However, I tried to build JOGL on Mac OS X, and it fails:

Well, sorry, I don't know that particular error,
but the osx port is currently broken and I will fix it after
a few tasks I am currently working on (< a week).

~Sven

>
> generate.grammar:
>     [javac] Compiling 5 source files to
> /Users/mnuhn/Desktop/opengl/jogl/gluegen/build/classes
>     [javac] Compiling 28 source files to
> /Users/mnuhn/Desktop/opengl/jogl/gluegen/build/classes
>     [javac]
> /Users/mnuhn/Desktop/opengl/jogl/gluegen/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java:322:
> incompatible types
>     [javac] found   : java.util.List<java.lang.Class>
>     [javac] required: java.util.List<java.lang.Class<?>>
>     [javac]             List<Class<?>> baseInterfaces =
> Arrays.asList(baseInterfaceClass.getInterfaces());
>     [javac]                                                          ^
>     [javac] Note: Some input files use unchecked or unsafe operations.
>     [javac] Note: Recompile with -Xlint:unchecked for details.
>     [javac] 1 error
>
> any ideas? Or can i grab a compiled version somewhere?
>
> Cheers,
> Malte
>
> ______________________________________
> View message @ http://jogamp.762907.n3.nabble.com/Raw-Pointer-to-GLContext-tp904275p904523.html
> To start a new topic under jogamp, email [hidden email]
> To unsubscribe from jogamp, click http://jogamp.762907.n3.nabble.com/subscriptions/Unsubscribe.jtp?code=c2dvdGhlbEBqYXVzb2Z0LmNvbXw3NjI5MDd8MzkxNDI4MzU5
>
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Sven Gothel
Administrator
In reply to this post by Malte
On Friday, June 18, 2010 02:20:35 Malte [via jogamp] wrote:

>
> Hey Sven,
>
> wow - what a quick response.
>
> You are right, I was quite imprecise - but you still guessed it right ;-)
>
> I think this will fix my problems - I just did not think of the word
> "handle" for the thing I was looking.
>
> Just as an info: What I basically want to do is using gstreamer, which has a
> (i think quite experimental) glupload plugins. It can copy video streams
> into an opengl texture. By sharing the context with that plugin, and using
> JOGL + java-gstreamer this should be doable with java, too.
>

Malte, if you have some time .. why don't you help fixing/doing the OpenMAX port for desktop ?

http://www.khronos.org/openmax/

http://limoa.sourceforge.net/
http://omxil.sourceforge.net/

I already tested some openmax on an embedded device, worked great,
so .. we would need some experimentation on desktop, if time allows.

Common goal, video streaming using the same API on desktop/mobile.

~Sven


> But at the moment, I am trying to hack some kind of prototype together, to
> see if this is REALLY possible.
>
> Thanks for the help ... Thumps up!
> Malte
>
> ______________________________________
> View message @ http://jogamp.762907.n3.nabble.com/Raw-Pointer-to-GLContext-tp904275p904392.html
> To start a new topic under jogamp, email [hidden email]
> To unsubscribe from jogamp, click http://jogamp.762907.n3.nabble.com/subscriptions/Unsubscribe.jtp?code=c2dvdGhlbEBqYXVzb2Z0LmNvbXw3NjI5MDd8MzkxNDI4MzU5
>


--
health & wealth
mailto:[hidden email] ; http://jausoft.com
land : +49 (471) 4707742 ; cell: +49 (151) 28145941
Timezone CET: PST+9, EST+6, UTC+1
Reply | Threaded
Open this post in threaded view
|

Re: Raw Pointer to GLContext

Malte
Hey Sven,

thanks again for your reply. I will simply wait, until the osx port is fixed ;)
Is there a way for me to check for this? Any location I might look at regularly?

About OpenMAX: I have had a look at it. This looks really interesing: I have never heard of OpenMAX before.

Nervetheless, I am afraid I do not have enough time at the moment + it looks a bit too heavy for me. But perhaps the things I should do are easier than I think - so if you have a little pointer where to start, I might think about it.

Thanks,
Malte