aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/native/GLContext.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-08-28 12:44:06 +0200
committerSven Gothel <[email protected]>2013-08-28 12:44:06 +0200
commit9bf14f3c6bf98bd86913bec6e7feb54537f9b7d3 (patch)
tree7b50a3db64dd1335003bbac371f18b4244c06299 /src/jogl/native/GLContext.c
parentb99511d438a6c621a5afc582168cca69bd2eb9da (diff)
Fix libav/ffmpeg compilation; FFMPEGMediaPlayer Enahncements (More YUV*, Use def. high camera options, cleanup symbols)
- Fix libav/ffmpeg compilation - Split native GLContext code from JoglCommon - JoglCommon is required for ffmpeg_* c-compile/link - Supported versions now: - 0.8 53.53.51 - 9.0 54.54.52 - FFMPEGMediaPlayer - Update API doc, add compatibility .. etc - Pixel format conversions (via shader texture lookup func): - YUV420P, YUVJ420P - YUV422P, YUVJ422P - YUYV422 - Properly handle aid/vid - In camera mode: set high default values - TODO: Make it configurable via camera URI: - video_size - framerate - ? - FFMPEGDynamicLibraryBundleInfo - Cleanup symbols / remove unused (pre 53) - Add av_dict_* methods
Diffstat (limited to 'src/jogl/native/GLContext.c')
-rw-r--r--src/jogl/native/GLContext.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/jogl/native/GLContext.c b/src/jogl/native/GLContext.c
new file mode 100644
index 000000000..f10d0e421
--- /dev/null
+++ b/src/jogl/native/GLContext.c
@@ -0,0 +1,46 @@
+
+#include "jogamp_opengl_GLContextImpl.h"
+#include "JoglCommon.h"
+
+#include <assert.h>
+#include <KHR/khrplatform.h>
+
+/*
+ * Class: jogamp_opengl_GLContextImpl
+ * Method: glGetStringInt
+ * Signature: (IJ)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_jogamp_opengl_GLContextImpl_glGetStringInt(JNIEnv *env, jclass _unused, jint name, jlong procAddress) {
+ typedef const khronos_uint8_t * (KHRONOS_APIENTRY*_local_PFNGLGETSTRINGPROC)(unsigned int name);
+ _local_PFNGLGETSTRINGPROC ptr_glGetString;
+ const khronos_uint8_t * _res;
+ ptr_glGetString = (_local_PFNGLGETSTRINGPROC) (intptr_t) procAddress;
+ assert(ptr_glGetString != NULL);
+ _res = (* ptr_glGetString) ((unsigned int) name);
+ if (NULL == _res) return NULL;
+ return (*env)->NewStringUTF(env, _res);
+}
+
+/*
+ * Class: jogamp_opengl_GLContextImpl
+ * Method: glGetIntegervInt
+ * Signature: (ILjava/lang/Object;I)V
+ */
+JNIEXPORT void JNICALL
+Java_jogamp_opengl_GLContextImpl_glGetIntegervInt(JNIEnv *env, jclass _unused, jint pname, jobject params, jint params_byte_offset, jlong procAddress) {
+ typedef void (KHRONOS_APIENTRY*_local_PFNGLGETINTEGERVPROC)(unsigned int pname, int * params);
+
+ _local_PFNGLGETINTEGERVPROC ptr_glGetIntegerv;
+ int * _params_ptr = NULL;
+ if ( NULL != params ) {
+ _params_ptr = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, params, NULL) ) + params_byte_offset);
+ }
+ ptr_glGetIntegerv = (_local_PFNGLGETINTEGERVPROC) (intptr_t) procAddress;
+ assert(ptr_glGetIntegerv != NULL);
+ (* ptr_glGetIntegerv) ((unsigned int) pname, (int *) _params_ptr);
+ if ( NULL != params ) {
+ (*env)->ReleasePrimitiveArrayCritical(env, params, _params_ptr, 0);
+ }
+}
+