/project/jni/sdl_main/JNICtx.h

https://github.com/aichunyu/FFPlayer · C Header · 56 lines · 25 code · 9 blank · 22 comment · 0 complexity · 89108ed9e3af52b3034de84f01dc1294 MD5 · raw file

  1. /*
  2. ** Copyright 2012, MARVELL SEMICONDUCTOR, LTD.
  3. ** THIS CODE CONTAINS CONFIDENTIAL INFORMATION OF MARVELL.
  4. ** NO RIGHTS ARE GRANTED HEREIN UNDER ANY PATENT, MASK WORK RIGHT OR COPYRIGHT
  5. ** OF MARVELL OR ANY THIRD PARTY. MARVELL RESERVES THE RIGHT AT ITS SOLE
  6. ** DISCRETION TO REQUEST THAT THIS CODE BE IMMEDIATELY RETURNED TO MARVELL.
  7. ** THIS CODE IS PROVIDED "AS IS". MARVELL MAKES NO WARRANTIES, EXPRESSED,
  8. ** IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE.
  9. **
  10. ** MARVELL COMPRISES MARVELL TECHNOLOGY GROUP LTD. (MTGL) AND ITS SUBSIDIARIES,
  11. ** MARVELL INTERNATIONAL LTD. (MIL), MARVELL TECHNOLOGY, INC. (MTI), MARVELL
  12. ** SEMICONDUCTOR, INC. (MSI), MARVELL ASIA PTE LTD. (MAPL), MARVELL JAPAN K.K.
  13. ** (MJKK), MARVELL ISRAEL LTD. (MSIL).
  14. */
  15. /****************************************************************************************
  16. ** File Name : hdmicec_def.h
  17. **
  18. ** Description : Function prototypes , common structures, macros for hdmicec jni implement
  19. **
  20. ** Author : Faywong <faywong@marvell.com>
  21. **
  22. ****************************************************************************************/
  23. #ifndef JNICTX_H
  24. #define JNICTX_H
  25. #include "jni.h"
  26. typedef enum JNICtxResult {
  27. UNKNOW_ERROR = -3,
  28. BAD_PARAMETER = -2,
  29. MALLOC_FAILED = -1,
  30. OK = 0,
  31. SUCCESS = OK,
  32. } JNICtxResult;
  33. typedef struct JNICtx {
  34. JavaVM *jvm;
  35. int vmversion;
  36. pthread_key_t tls_key;
  37. void (*thread_dtr)(void *context);
  38. struct JNICtx *self;
  39. } JNICtx;
  40. typedef struct TLStore {
  41. JNIEnv* jni_env;
  42. JNICtx* context;
  43. } TLStore;
  44. int InitJNICtx(JavaVM* vm, JNICtx **jni_ctx);
  45. JNIEnv* GetJNIEnv(JNICtx* context);
  46. int LogJNIEnv(JNICtx* context, JNIEnv* env);
  47. #endif // JNICTX_H