PageRenderTime 23ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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/****************************************************************************************
17 ** File Name : hdmicec_def.h
18 **
19 ** Description : Function prototypes , common structures, macros for hdmicec jni implement
20 **
21 ** Author : Faywong <faywong@marvell.com>
22 **
23 ****************************************************************************************/
24
25
26#ifndef JNICTX_H
27#define JNICTX_H
28
29#include "jni.h"
30
31typedef enum JNICtxResult {
32    UNKNOW_ERROR = -3,
33    BAD_PARAMETER = -2,
34    MALLOC_FAILED = -1,
35    OK = 0,
36    SUCCESS = OK,
37} JNICtxResult;
38
39typedef struct JNICtx {
40    JavaVM *jvm;
41    int vmversion;
42    pthread_key_t tls_key;
43    void (*thread_dtr)(void *context);
44    struct JNICtx *self;
45} JNICtx;
46
47typedef struct TLStore {
48    JNIEnv* jni_env;
49    JNICtx* context;
50} TLStore;
51
52int InitJNICtx(JavaVM* vm, JNICtx **jni_ctx);
53JNIEnv* GetJNIEnv(JNICtx* context);
54int LogJNIEnv(JNICtx* context, JNIEnv* env);
55
56#endif  // JNICTX_H