How to set a specific JNI memory model in Xuggler?

34 views
Skip to first unread message

akhil sharma

unread,
Apr 20, 2016, 2:20:13 PM4/20/16
to xuggler-users
Hi. I am new to Xuggle. I am able to create video (with audio stream) via xuggle. But want to experiment with different memory models available as specified under JNIMemoryManager class.

But i am not sure where to set a specific memory model. Available models are:

JAVA_STANDARD_HEAP(default)
JAVA_DIRECT_BUFFERS_WITH_STANDARD_HEAP_NOTIFICATION
NATIVE_BUFFERS_WITH_STANDARD_HEAP_NOTIFICATION
JAVA_DIRECT_BUFFERS
NATIVE_BUFFERS.

Thanks

Ed St Louis

unread,
May 9, 2016, 10:05:54 AM5/9/16
to akhil sharma, xuggler-users

All you do is call setMemoryModel and pass in the model you want. I do this in the static initialization of my class. For example, I do the following:

 

import com.xuggle.ferry.JNIMemoryManager;

import com.xuggle.ferry.JNIMemoryManager.MemoryModel;

import com.xuggle.xuggler.Global;

                static {

                                try {

                                                JNIMemoryManager.setMemoryModel(MemoryModel.JAVA_STANDARD_HEAP);

                                                for (com.xuggle.ferry.Logger.Level c : com.xuggle.ferry.Logger.Level.values()) {

                                                                com.xuggle.ferry.Logger.setGlobalIsLogging(c, false);

                                                }

                                                Global.setFFmpegLoggingLevel(-1);

                                } catch (Throwable t) {

                                                logger.warn("Didn't properly initialize logging and memory model in Xuggler.", t);

                                }

                }

 

That disables the logging that I don’t care about and sets the memory model to the model of my choosing.

 

Ed St. Louis
801-999-8844

--

You received this message because you are subscribed to the Google Groups "xuggler-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to xuggler-user...@googlegroups.com.

To post to this group, send email to xuggle...@googlegroups.com.

Visit this group at https://groups.google.com/group/xuggler-users.

For more options, visit https://groups.google.com/d/optout.

 

Reply all
Reply to author
Forward
0 new messages