gvr_api_jni.h 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This file is of the same format as file that generated by
  5. // base/android/jni_generator/jni_generator.py
  6. // For
  7. // com/google/vr/ndk/base/GvrApi
  8. // Local modification includes:
  9. // 1. Remove all implementaiton, only keep definition.
  10. // 2. Use absolute path instead of relative path.
  11. // 3. Removed all helper functions such as: Create.
  12. // 4. Removed external functions that don't have implementation in shim file.
  13. // 5. Changed RectF, Point, and PoseTracker to correct package name.
  14. // 6. Added function RegisterGvrApiNatives at the end of this file.
  15. #ifndef com_google_vr_ndk_base_GvrApi_JNI
  16. #define com_google_vr_ndk_base_GvrApi_JNI
  17. #include "base/android/jni_android.h"
  18. // ----------------------------------------------------------------------------
  19. // Native JNI methods
  20. // ----------------------------------------------------------------------------
  21. #include <jni.h>
  22. #include <atomic>
  23. #include <type_traits>
  24. #include "base/android/jni_generator/jni_generator_helper.h"
  25. #include "base/android/jni_int_wrapper.h"
  26. // Step 1: forward declarations.
  27. namespace {
  28. const char kGvrApiClassPath[] = "com/google/vr/ndk/base/GvrApi";
  29. // Leaking this jclass as we cannot use LazyInstance from some threads.
  30. std::atomic<jclass> g_GvrApi_clazz __attribute__((unused)) (nullptr);
  31. #define GvrApi_clazz(env) \
  32. base::android::LazyGetClass(env, kGvrApiClassPath, &g_GvrApi_clazz)
  33. } // namespace
  34. namespace GvrApi {
  35. // Step 2: method stubs.
  36. JNI_GENERATOR_EXPORT jlong
  37. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListCreate(
  38. JNIEnv* env,
  39. jobject jcaller,
  40. jlong nativeGvrContext);
  41. JNI_GENERATOR_EXPORT void
  42. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListDestroy(
  43. JNIEnv* env,
  44. jclass jcaller,
  45. jlong nativeBufferViewportList);
  46. JNI_GENERATOR_EXPORT jint
  47. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListGetSize(
  48. JNIEnv* env,
  49. jclass jcaller,
  50. jlong nativeBufferViewportList);
  51. JNI_GENERATOR_EXPORT void
  52. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListGetItem(
  53. JNIEnv* env,
  54. jclass jcaller,
  55. jlong nativeBufferViewportList,
  56. jint index,
  57. jlong nativeBufferViewport);
  58. JNI_GENERATOR_EXPORT void
  59. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListSetItem(
  60. JNIEnv* env,
  61. jclass jcaller,
  62. jlong nativeBufferViewportList,
  63. jint index,
  64. jlong nativeBufferViewport);
  65. JNI_GENERATOR_EXPORT jlong
  66. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportCreate(
  67. JNIEnv* env,
  68. jclass jcaller,
  69. jlong nativeGvrContext);
  70. JNI_GENERATOR_EXPORT void
  71. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportDestroy(
  72. JNIEnv* env,
  73. jclass jcaller,
  74. jlong nativeBufferViewport);
  75. JNI_GENERATOR_EXPORT void
  76. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetSourceUv(
  77. JNIEnv* env,
  78. jclass jcaller,
  79. jlong nativeBufferViewport,
  80. jobject out);
  81. JNI_GENERATOR_EXPORT void
  82. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceUv(
  83. JNIEnv* env,
  84. jclass jcaller,
  85. jlong nativeBufferViewport,
  86. jfloat left,
  87. jfloat top,
  88. jfloat right,
  89. jfloat bottom);
  90. JNI_GENERATOR_EXPORT void
  91. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetSourceFov(
  92. JNIEnv* env,
  93. jclass jcaller,
  94. jlong nativeBufferViewport,
  95. jobject out);
  96. JNI_GENERATOR_EXPORT void
  97. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceFov(
  98. JNIEnv* env,
  99. jclass jcaller,
  100. jlong nativeBufferViewport,
  101. jfloat left,
  102. jfloat top,
  103. jfloat right,
  104. jfloat bottom);
  105. JNI_GENERATOR_EXPORT void
  106. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetTransform(
  107. JNIEnv* env,
  108. jclass jcaller,
  109. jlong nativeBufferViewport,
  110. jfloatArray matrix);
  111. JNI_GENERATOR_EXPORT void
  112. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetTransform(
  113. JNIEnv* env,
  114. jclass jcaller,
  115. jlong nativeBufferViewport,
  116. jfloatArray matrix);
  117. JNI_GENERATOR_EXPORT jboolean
  118. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportEqual(JNIEnv* env,
  119. jclass jcaller,
  120. jlong nativeA,
  121. jlong nativeB);
  122. JNI_GENERATOR_EXPORT jint
  123. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetTargetEye(
  124. JNIEnv* env,
  125. jclass jcaller,
  126. jlong nativeBufferViewport);
  127. JNI_GENERATOR_EXPORT void
  128. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetTargetEye(
  129. JNIEnv* env,
  130. jclass jcaller,
  131. jlong nativeBufferViewport,
  132. jint eye);
  133. JNI_GENERATOR_EXPORT jint
  134. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetSourceBufferIndex(
  135. JNIEnv* env,
  136. jclass jcaller,
  137. jlong nativeBufferViewport);
  138. JNI_GENERATOR_EXPORT void
  139. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceBufferIndex(
  140. JNIEnv* env,
  141. jclass jcaller,
  142. jlong nativeBufferViewport,
  143. jint index);
  144. JNI_GENERATOR_EXPORT jint
  145. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetExternalSurfaceId(
  146. JNIEnv* env,
  147. jclass jcaller,
  148. jlong nativeBufferViewport);
  149. JNI_GENERATOR_EXPORT void
  150. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetExternalSurfaceId(
  151. JNIEnv* env,
  152. jclass jcaller,
  153. jlong nativeBufferViewport,
  154. jint id);
  155. JNI_GENERATOR_EXPORT void
  156. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetExternalSurface(
  157. JNIEnv* env,
  158. jclass jcaller,
  159. jlong nativeBufferViewport,
  160. jlong nativeExternalSurface);
  161. JNI_GENERATOR_EXPORT jint
  162. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetReprojection(
  163. JNIEnv* env,
  164. jclass jcaller,
  165. jlong nativeBufferViewport);
  166. JNI_GENERATOR_EXPORT void
  167. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetReprojection(
  168. JNIEnv* env,
  169. jclass jcaller,
  170. jlong nativeBufferViewport,
  171. jint reprojection);
  172. JNI_GENERATOR_EXPORT void
  173. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceLayer(
  174. JNIEnv* env,
  175. jclass jcaller,
  176. jlong nativeBufferViewport,
  177. jint layerIndex);
  178. JNI_GENERATOR_EXPORT jlong
  179. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecCreate(
  180. JNIEnv* env,
  181. jclass jcaller,
  182. jlong nativeGvrContext);
  183. JNI_GENERATOR_EXPORT void
  184. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecDestroy(
  185. JNIEnv* env,
  186. jclass jcaller,
  187. jlong nativeBufferSpec);
  188. JNI_GENERATOR_EXPORT void
  189. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecGetSize(
  190. JNIEnv* env,
  191. jclass jcaller,
  192. jlong nativeBufferSpec,
  193. jobject size);
  194. JNI_GENERATOR_EXPORT void
  195. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetSize(
  196. JNIEnv* env,
  197. jclass jcaller,
  198. jlong nativeBufferSpec,
  199. jint width,
  200. jint height);
  201. JNI_GENERATOR_EXPORT void
  202. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetColorFormat(
  203. JNIEnv* env,
  204. jclass jcaller,
  205. jlong nativeBufferSpec,
  206. jint format);
  207. JNI_GENERATOR_EXPORT void
  208. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetDepthStencilFormat(
  209. JNIEnv* env,
  210. jclass jcaller,
  211. jlong nativeBufferSpec,
  212. jint format);
  213. JNI_GENERATOR_EXPORT void
  214. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetMultiviewLayers(
  215. JNIEnv* env,
  216. jclass jcaller,
  217. jlong nativeBufferSpec,
  218. jint numLayers);
  219. JNI_GENERATOR_EXPORT jint
  220. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecGetSamples(
  221. JNIEnv* env,
  222. jclass jcaller,
  223. jlong nativeBufferSpec);
  224. JNI_GENERATOR_EXPORT void
  225. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetSamples(
  226. JNIEnv* env,
  227. jclass jcaller,
  228. jlong nativeBufferSpec,
  229. jint samples);
  230. JNI_GENERATOR_EXPORT jlong
  231. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceCreateWithListeners(
  232. JNIEnv* env,
  233. jclass jcaller,
  234. jlong nativeGvrContext,
  235. jobject surfaceListener,
  236. jobject frameListener,
  237. jobject handler);
  238. JNI_GENERATOR_EXPORT void
  239. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceDestroy(
  240. JNIEnv* env,
  241. jclass jcaller,
  242. jlong nativeBufferSpec);
  243. JNI_GENERATOR_EXPORT jint
  244. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceGetId(
  245. JNIEnv* env,
  246. jclass jcaller,
  247. jlong nativeBufferSpec);
  248. JNI_GENERATOR_EXPORT jobject
  249. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceGetSurface(
  250. JNIEnv* env,
  251. jclass jcaller,
  252. jlong nativeBufferSpec);
  253. JNI_GENERATOR_EXPORT jlong
  254. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainCreate(JNIEnv* env,
  255. jclass jcaller,
  256. jlong nativeContext,
  257. jlongArray specs);
  258. JNI_GENERATOR_EXPORT void
  259. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainDestroy(JNIEnv* env,
  260. jclass jcaller,
  261. jlong nativeContext);
  262. JNI_GENERATOR_EXPORT jint
  263. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainGetBufferCount(
  264. JNIEnv* env,
  265. jclass jcaller,
  266. jlong nativeSwapChain);
  267. JNI_GENERATOR_EXPORT void
  268. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainGetBufferSize(
  269. JNIEnv* env,
  270. jclass jcaller,
  271. jlong nativeSwapChain,
  272. jint bufferIndex,
  273. jobject size);
  274. JNI_GENERATOR_EXPORT void
  275. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainResizeBuffer(
  276. JNIEnv* env,
  277. jclass jcaller,
  278. jlong nativeSwapChain,
  279. jint bufferIndex,
  280. jint width,
  281. jint height);
  282. JNI_GENERATOR_EXPORT jlong
  283. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainAcquireFrame(
  284. JNIEnv* env,
  285. jclass jcaller,
  286. jlong nativeSwapChain);
  287. JNI_GENERATOR_EXPORT void
  288. Java_com_google_vr_ndk_base_GvrApi_nativeFrameBindBuffer(JNIEnv* env,
  289. jclass jcaller,
  290. jlong nativeFrame,
  291. jint bufferIndex);
  292. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeFrameUnbind(
  293. JNIEnv* env,
  294. jclass jcaller,
  295. jlong nativeFrame);
  296. JNI_GENERATOR_EXPORT jint
  297. Java_com_google_vr_ndk_base_GvrApi_nativeFrameGetFramebufferObject(
  298. JNIEnv* env,
  299. jclass jcaller,
  300. jlong nativeFrame,
  301. jint bufferIndex);
  302. JNI_GENERATOR_EXPORT void
  303. Java_com_google_vr_ndk_base_GvrApi_nativeFrameGetBufferSize(JNIEnv* env,
  304. jclass jcaller,
  305. jlong nativeFrame,
  306. jint bufferIndex,
  307. jobject size);
  308. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeFrameSubmit(
  309. JNIEnv* env,
  310. jclass jcaller,
  311. jlong nativeFrame,
  312. jlong nativeBufferViewportList,
  313. jfloatArray headSpaceFromStartSpace);
  314. JNI_GENERATOR_EXPORT jboolean
  315. Java_com_google_vr_ndk_base_GvrApi_nativeUsingDynamicLibrary(JNIEnv* env,
  316. jclass jcaller);
  317. JNI_GENERATOR_EXPORT jboolean
  318. Java_com_google_vr_ndk_base_GvrApi_nativeUsingShimLibrary(JNIEnv* env,
  319. jclass jcaller);
  320. JNI_GENERATOR_EXPORT void
  321. Java_com_google_vr_ndk_base_GvrApi_nativeSetApplicationState(JNIEnv* env,
  322. jclass jcaller,
  323. jclass classLoader,
  324. jobject context);
  325. JNI_GENERATOR_EXPORT void
  326. Java_com_google_vr_ndk_base_GvrApi_nativeSetDynamicLibraryLoadingEnabled(
  327. JNIEnv* env,
  328. jclass jcaller,
  329. jboolean enabled);
  330. JNI_GENERATOR_EXPORT jlong Java_com_google_vr_ndk_base_GvrApi_nativeCreate(
  331. JNIEnv* env,
  332. jobject jcaller,
  333. jclass classLoader,
  334. jobject context,
  335. jlong synchronizer,
  336. jint widthPixels,
  337. jint heightPixels,
  338. jfloat xDpi,
  339. jfloat yDpi,
  340. jobject optionalPoseTrackingForTesting);
  341. JNI_GENERATOR_EXPORT void
  342. Java_com_google_vr_ndk_base_GvrApi_nativeRequestContextSharing(
  343. JNIEnv* env,
  344. jobject jcaller,
  345. jlong nativeGvrContext,
  346. jobject eglListener);
  347. JNI_GENERATOR_EXPORT jint
  348. Java_com_google_vr_ndk_base_GvrApi_nativeGetError(JNIEnv* env,
  349. jobject jcaller,
  350. jlong nativeGvrContext);
  351. JNI_GENERATOR_EXPORT jint
  352. Java_com_google_vr_ndk_base_GvrApi_nativeClearError(JNIEnv* env,
  353. jobject jcaller,
  354. jlong nativeGvrContext);
  355. JNI_GENERATOR_EXPORT jstring
  356. Java_com_google_vr_ndk_base_GvrApi_nativeGetErrorString(JNIEnv* env,
  357. jclass jcaller,
  358. jint errorCode);
  359. JNI_GENERATOR_EXPORT jlong
  360. Java_com_google_vr_ndk_base_GvrApi_nativeGetUserPrefs(JNIEnv* env,
  361. jobject jcaller,
  362. jlong nativeGvrContext);
  363. JNI_GENERATOR_EXPORT jint
  364. Java_com_google_vr_ndk_base_GvrApi_nativeUserPrefsGetControllerHandedness(
  365. JNIEnv* env,
  366. jclass jcaller,
  367. jlong nativeUserPrefs);
  368. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativePause(
  369. JNIEnv* env,
  370. jobject jcaller,
  371. jlong nativeGvrContext);
  372. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeResume(
  373. JNIEnv* env,
  374. jobject jcaller,
  375. jlong nativeGvrContext);
  376. JNI_GENERATOR_EXPORT void
  377. Java_com_google_vr_ndk_base_GvrApi_nativeReleaseGvrContext(
  378. JNIEnv* env,
  379. jobject jcaller,
  380. jlong nativeGvrContext);
  381. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeInitializeGl(
  382. JNIEnv* env,
  383. jobject jcaller,
  384. jlong nativeGvrContext);
  385. JNI_GENERATOR_EXPORT void
  386. Java_com_google_vr_ndk_base_GvrApi_nativeOnSurfaceCreatedReprojectionThread(
  387. JNIEnv* env,
  388. jobject jcaller,
  389. jlong nativeGvrContext);
  390. JNI_GENERATOR_EXPORT void
  391. Java_com_google_vr_ndk_base_GvrApi_nativeOnSurfaceChangedReprojectionThread(
  392. JNIEnv* env,
  393. jobject jcaller,
  394. jlong nativeGvrContext);
  395. JNI_GENERATOR_EXPORT void
  396. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecommendedBufferViewports(
  397. JNIEnv* env,
  398. jobject jcaller,
  399. jlong nativeGvrContext,
  400. jlong nativeBufferViewportList);
  401. JNI_GENERATOR_EXPORT void
  402. Java_com_google_vr_ndk_base_GvrApi_nativeGetScreenBufferViewports(
  403. JNIEnv* env,
  404. jobject jcaller,
  405. jlong nativeGvrContext,
  406. jlong nativeBufferViewportList);
  407. JNI_GENERATOR_EXPORT void
  408. Java_com_google_vr_ndk_base_GvrApi_nativeGetMaximumEffectiveRenderTargetSize(
  409. JNIEnv* env,
  410. jobject jcaller,
  411. jlong nativeGvrContext,
  412. jobject size);
  413. JNI_GENERATOR_EXPORT void
  414. Java_com_google_vr_ndk_base_GvrApi_nativeGetScreenTargetSize(
  415. JNIEnv* env,
  416. jobject jcaller,
  417. jlong nativeGvrContext,
  418. jobject size);
  419. JNI_GENERATOR_EXPORT void
  420. Java_com_google_vr_ndk_base_GvrApi_nativeDistortToScreen(
  421. JNIEnv* env,
  422. jobject jcaller,
  423. jlong nativeGvrContext,
  424. jint textureId,
  425. jlong nativeBufferViewportList,
  426. jfloatArray headSpaceFromStartSpace,
  427. jlong timeNs);
  428. JNI_GENERATOR_EXPORT void
  429. Java_com_google_vr_ndk_base_GvrApi_nativeSetDefaultFramebufferActive(
  430. JNIEnv* env,
  431. jobject jcaller,
  432. jlong nativeGvrContext);
  433. JNI_GENERATOR_EXPORT jobject
  434. Java_com_google_vr_ndk_base_GvrApi_nativeRenderReprojectionThread(
  435. JNIEnv* env,
  436. jobject jcaller,
  437. jlong nativeGvrContext);
  438. JNI_GENERATOR_EXPORT void
  439. Java_com_google_vr_ndk_base_GvrApi_nativeOnPauseReprojectionThread(
  440. JNIEnv* env,
  441. jobject jcaller,
  442. jlong nativeGvrContext);
  443. JNI_GENERATOR_EXPORT void
  444. Java_com_google_vr_ndk_base_GvrApi_nativeGetHeadSpaceFromStartSpaceRotation(
  445. JNIEnv* env,
  446. jobject jcaller,
  447. jlong nativeGvrContext,
  448. jfloatArray outRotation,
  449. jlong timeNs);
  450. JNI_GENERATOR_EXPORT void
  451. Java_com_google_vr_ndk_base_GvrApi_nativeGetHeadSpaceFromStartSpaceTransform(
  452. JNIEnv* env,
  453. jobject jcaller,
  454. jlong nativeGvrContext,
  455. jfloatArray outTransform,
  456. jlong timeNs);
  457. JNI_GENERATOR_EXPORT void
  458. Java_com_google_vr_ndk_base_GvrApi_nativeSetIgnoreManualPauseResumeTracker(
  459. JNIEnv* env,
  460. jobject jcaller,
  461. jlong nativeGvrContext,
  462. jboolean shouldIgnore);
  463. JNI_GENERATOR_EXPORT void
  464. Java_com_google_vr_ndk_base_GvrApi_nativePauseTracking(JNIEnv* env,
  465. jobject jcaller,
  466. jlong nativeGvrContext);
  467. JNI_GENERATOR_EXPORT jbyteArray
  468. Java_com_google_vr_ndk_base_GvrApi_nativePauseTrackingGetState(
  469. JNIEnv* env,
  470. jobject jcaller,
  471. jlong nativeGvrContext);
  472. JNI_GENERATOR_EXPORT void
  473. Java_com_google_vr_ndk_base_GvrApi_nativeResumeTracking(JNIEnv* env,
  474. jobject jcaller,
  475. jlong nativeGvrContext);
  476. JNI_GENERATOR_EXPORT void
  477. Java_com_google_vr_ndk_base_GvrApi_nativeResumeTrackingSetState(
  478. JNIEnv* env,
  479. jobject jcaller,
  480. jlong nativeGvrContext,
  481. jbyteArray trackerStateBytes);
  482. JNI_GENERATOR_EXPORT void
  483. Java_com_google_vr_ndk_base_GvrApi_nativeResetTracking(JNIEnv* env,
  484. jobject jcaller,
  485. jlong nativeGvrContext);
  486. JNI_GENERATOR_EXPORT void
  487. Java_com_google_vr_ndk_base_GvrApi_nativeRecenterTracking(
  488. JNIEnv* env,
  489. jobject jcaller,
  490. jlong nativeGvrContext);
  491. JNI_GENERATOR_EXPORT void
  492. Java_com_google_vr_ndk_base_GvrApi_nativeGetEyeFromHeadMatrix(
  493. JNIEnv* env,
  494. jobject jcaller,
  495. jlong nativeGvrContext,
  496. jint eye,
  497. jfloatArray out);
  498. JNI_GENERATOR_EXPORT jintArray
  499. Java_com_google_vr_ndk_base_GvrApi_nativeGetWindowBounds(
  500. JNIEnv* env,
  501. jobject jcaller,
  502. jlong nativeGvrContext);
  503. JNI_GENERATOR_EXPORT jfloatArray
  504. Java_com_google_vr_ndk_base_GvrApi_nativeComputeDistortedPoint(
  505. JNIEnv* env,
  506. jobject jcaller,
  507. jlong nativeGvrContext,
  508. jint eyeType,
  509. jfloatArray uvIn);
  510. JNI_GENERATOR_EXPORT jboolean
  511. Java_com_google_vr_ndk_base_GvrApi_nativeSetDefaultViewerProfile(
  512. JNIEnv* env,
  513. jobject jcaller,
  514. jlong nativeGvrContext,
  515. jstring viewerProfileUri);
  516. JNI_GENERATOR_EXPORT jstring
  517. Java_com_google_vr_ndk_base_GvrApi_nativeGetViewerVendor(
  518. JNIEnv* env,
  519. jobject jcaller,
  520. jlong nativeGvrContext);
  521. JNI_GENERATOR_EXPORT jstring
  522. Java_com_google_vr_ndk_base_GvrApi_nativeGetViewerModel(JNIEnv* env,
  523. jobject jcaller,
  524. jlong nativeGvrContext);
  525. JNI_GENERATOR_EXPORT jint
  526. Java_com_google_vr_ndk_base_GvrApi_nativeGetViewerType(JNIEnv* env,
  527. jobject jcaller,
  528. jlong nativeGvrContext);
  529. JNI_GENERATOR_EXPORT jboolean
  530. Java_com_google_vr_ndk_base_GvrApi_nativeSetAsyncReprojectionEnabled(
  531. JNIEnv* env,
  532. jobject jcaller,
  533. jlong nativeGvrContext,
  534. jboolean enabled);
  535. JNI_GENERATOR_EXPORT jboolean
  536. Java_com_google_vr_ndk_base_GvrApi_nativeGetAsyncReprojectionEnabled(
  537. JNIEnv* env,
  538. jobject jcaller,
  539. jlong nativeGvrContext);
  540. JNI_GENERATOR_EXPORT jboolean
  541. Java_com_google_vr_ndk_base_GvrApi_nativeIsFeatureSupported(
  542. JNIEnv* env,
  543. jobject jcaller,
  544. jlong nativeGvrContext,
  545. jint feature);
  546. JNI_GENERATOR_EXPORT void
  547. Java_com_google_vr_ndk_base_GvrApi_nativeReconnectSensors(
  548. JNIEnv* env,
  549. jobject jcaller,
  550. jlong nativeGvrContext);
  551. JNI_GENERATOR_EXPORT void
  552. Java_com_google_vr_ndk_base_GvrApi_nativeSetIdleListener(JNIEnv* env,
  553. jobject jcaller,
  554. jlong nativeGvrContext,
  555. jobject idleListener);
  556. JNI_GENERATOR_EXPORT jboolean
  557. Java_com_google_vr_ndk_base_GvrApi_nativeSetViewerParams(
  558. JNIEnv* env,
  559. jobject jcaller,
  560. jlong nativeGvrContext,
  561. jbyteArray serializedViewerParams);
  562. JNI_GENERATOR_EXPORT void
  563. Java_com_google_vr_ndk_base_GvrApi_nativeSetDisplayMetrics(
  564. JNIEnv* env,
  565. jobject jcaller,
  566. jlong nativeGvrContext,
  567. jint widthPixels,
  568. jint heightPixels,
  569. jfloat xDpi,
  570. jfloat yDpi);
  571. JNI_GENERATOR_EXPORT jfloat
  572. Java_com_google_vr_ndk_base_GvrApi_nativeGetBorderSizeMeters(
  573. JNIEnv* env,
  574. jobject jcaller,
  575. jlong nativeGvrContext);
  576. JNI_GENERATOR_EXPORT void
  577. Java_com_google_vr_ndk_base_GvrApi_nativeSetSurfaceSize(
  578. JNIEnv* env,
  579. jobject jcaller,
  580. jlong nativeGvrContext,
  581. jint surfaceWidthPixels,
  582. jint surfaceHeightPixels);
  583. JNI_GENERATOR_EXPORT void
  584. Java_com_google_vr_ndk_base_GvrApi_nativeSetLensOffset(JNIEnv* env,
  585. jobject jcaller,
  586. jlong nativeGvrContext,
  587. jfloat x,
  588. jfloat y,
  589. jfloat rotation);
  590. JNI_GENERATOR_EXPORT void
  591. Java_com_google_vr_ndk_base_GvrApi_nativeDumpDebugData(JNIEnv* env,
  592. jobject jcaller,
  593. jlong nativeGvrContext);
  594. JNI_GENERATOR_EXPORT jboolean
  595. Java_com_google_vr_ndk_base_GvrApi_nativeUsingVrDisplayService(
  596. JNIEnv* env,
  597. jobject jcaller,
  598. jlong nativeGvrContext);
  599. JNI_GENERATOR_EXPORT jlong
  600. Java_com_google_vr_ndk_base_GvrApi_nativeCreateEvent(JNIEnv* env, jclass clazz);
  601. JNI_GENERATOR_EXPORT jlong
  602. Java_com_google_vr_ndk_base_GvrApi_nativeCreateValue(JNIEnv* env, jclass clazz);
  603. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeDestroyEvent(
  604. JNIEnv* env,
  605. jclass clazz,
  606. jlong native_object);
  607. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeDestroyValue(
  608. JNIEnv* env,
  609. jclass clazz,
  610. jlong native_object);
  611. JNI_GENERATOR_EXPORT jlong
  612. Java_com_google_vr_ndk_base_GvrApi_nativeGetCurrentProperties(
  613. JNIEnv* env,
  614. jobject object,
  615. jlong native_object);
  616. JNI_GENERATOR_EXPORT jlong
  617. Java_com_google_vr_ndk_base_GvrApi_nativeGetEventFlags(JNIEnv* env,
  618. jclass clazz,
  619. jlong native_object);
  620. JNI_GENERATOR_EXPORT jlong
  621. Java_com_google_vr_ndk_base_GvrApi_nativeGetEventTimestamp(JNIEnv* env,
  622. jclass clazz,
  623. jlong native_object);
  624. JNI_GENERATOR_EXPORT jint
  625. Java_com_google_vr_ndk_base_GvrApi_nativeGetEventType(JNIEnv* env,
  626. jclass clazz,
  627. jlong native_object);
  628. JNI_GENERATOR_EXPORT jboolean
  629. Java_com_google_vr_ndk_base_GvrApi_nativeGetProperty(JNIEnv* env,
  630. jclass clazz,
  631. jlong native_properties,
  632. jint property_key,
  633. jlong native_value);
  634. JNI_GENERATOR_EXPORT jlong
  635. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecenterEventFlags(
  636. JNIEnv* env,
  637. jclass clazz,
  638. jlong native_object);
  639. JNI_GENERATOR_EXPORT void
  640. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecenterEventStartSpaceFromTrackingSpaceTransform(
  641. JNIEnv* env,
  642. jclass clazz,
  643. jlong native_object,
  644. jfloatArray rotation_out_array);
  645. JNI_GENERATOR_EXPORT jint
  646. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecenterEventType(
  647. JNIEnv* env,
  648. jclass clazz,
  649. jlong native_object);
  650. JNI_GENERATOR_EXPORT jboolean
  651. Java_com_google_vr_ndk_base_GvrApi_nativePollEvent(JNIEnv* env,
  652. jobject object,
  653. jlong native_object,
  654. jlong event_out);
  655. JNI_GENERATOR_EXPORT jlong
  656. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsFlags(JNIEnv* env,
  657. jclass clazz,
  658. jlong native_object);
  659. JNI_GENERATOR_EXPORT jfloat
  660. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsFloat(JNIEnv* env,
  661. jclass clazz,
  662. jlong native_object);
  663. JNI_GENERATOR_EXPORT jint
  664. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsInt(JNIEnv* env,
  665. jclass clazz,
  666. jlong native_object);
  667. JNI_GENERATOR_EXPORT void Java_com_google_vr_ndk_base_GvrApi_nativeValueAsMat4f(
  668. JNIEnv* env,
  669. jclass clazz,
  670. jlong native_object,
  671. jfloatArray mat4_out_array);
  672. JNI_GENERATOR_EXPORT jlong
  673. Java_com_google_vr_ndk_base_GvrApi_nativeValueGetFlags(JNIEnv* env,
  674. jclass clazz,
  675. jlong native_object);
  676. // Step 3: RegisterNatives.
  677. static const JNINativeMethod kMethodsGvrApi[] = {
  678. {"nativeBufferViewportListCreate",
  679. "("
  680. "J"
  681. ")"
  682. "J",
  683. reinterpret_cast<void*>(
  684. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListCreate)},
  685. {"nativeBufferViewportListDestroy",
  686. "("
  687. "J"
  688. ")"
  689. "V",
  690. reinterpret_cast<void*>(
  691. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListDestroy)},
  692. {"nativeBufferViewportListGetSize",
  693. "("
  694. "J"
  695. ")"
  696. "I",
  697. reinterpret_cast<void*>(
  698. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListGetSize)},
  699. {"nativeBufferViewportListGetItem",
  700. "("
  701. "J"
  702. "I"
  703. "J"
  704. ")"
  705. "V",
  706. reinterpret_cast<void*>(
  707. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListGetItem)},
  708. {"nativeBufferViewportListSetItem",
  709. "("
  710. "J"
  711. "I"
  712. "J"
  713. ")"
  714. "V",
  715. reinterpret_cast<void*>(
  716. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportListSetItem)},
  717. {"nativeBufferViewportCreate",
  718. "("
  719. "J"
  720. ")"
  721. "J",
  722. reinterpret_cast<void*>(
  723. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportCreate)},
  724. {"nativeBufferViewportDestroy",
  725. "("
  726. "J"
  727. ")"
  728. "V",
  729. reinterpret_cast<void*>(
  730. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportDestroy)},
  731. {"nativeBufferViewportGetSourceUv",
  732. "("
  733. "J"
  734. "Landroid/graphics/RectF;"
  735. ")"
  736. "V",
  737. reinterpret_cast<void*>(
  738. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetSourceUv)},
  739. {"nativeBufferViewportSetSourceUv",
  740. "("
  741. "J"
  742. "F"
  743. "F"
  744. "F"
  745. "F"
  746. ")"
  747. "V",
  748. reinterpret_cast<void*>(
  749. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceUv)},
  750. {"nativeBufferViewportGetSourceFov",
  751. "("
  752. "J"
  753. "Landroid/graphics/RectF;"
  754. ")"
  755. "V",
  756. reinterpret_cast<void*>(
  757. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetSourceFov)},
  758. {"nativeBufferViewportSetSourceFov",
  759. "("
  760. "J"
  761. "F"
  762. "F"
  763. "F"
  764. "F"
  765. ")"
  766. "V",
  767. reinterpret_cast<void*>(
  768. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceFov)},
  769. {"nativeBufferViewportGetTransform",
  770. "("
  771. "J"
  772. "[F"
  773. ")"
  774. "V",
  775. reinterpret_cast<void*>(
  776. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetTransform)},
  777. {"nativeBufferViewportSetTransform",
  778. "("
  779. "J"
  780. "[F"
  781. ")"
  782. "V",
  783. reinterpret_cast<void*>(
  784. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetTransform)},
  785. {"nativeBufferViewportEqual",
  786. "("
  787. "J"
  788. "J"
  789. ")"
  790. "Z",
  791. reinterpret_cast<void*>(
  792. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportEqual)},
  793. {"nativeBufferViewportGetTargetEye",
  794. "("
  795. "J"
  796. ")"
  797. "I",
  798. reinterpret_cast<void*>(
  799. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetTargetEye)},
  800. {"nativeBufferViewportSetTargetEye",
  801. "("
  802. "J"
  803. "I"
  804. ")"
  805. "V",
  806. reinterpret_cast<void*>(
  807. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetTargetEye)},
  808. {"nativeBufferViewportGetSourceBufferIndex",
  809. "("
  810. "J"
  811. ")"
  812. "I",
  813. reinterpret_cast<void*>(
  814. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetSourceBufferIndex)},
  815. {"nativeBufferViewportSetSourceBufferIndex",
  816. "("
  817. "J"
  818. "I"
  819. ")"
  820. "V",
  821. reinterpret_cast<void*>(
  822. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceBufferIndex)},
  823. {"nativeBufferViewportGetExternalSurfaceId",
  824. "("
  825. "J"
  826. ")"
  827. "I",
  828. reinterpret_cast<void*>(
  829. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetExternalSurfaceId)},
  830. {"nativeBufferViewportSetExternalSurfaceId",
  831. "("
  832. "J"
  833. "I"
  834. ")"
  835. "V",
  836. reinterpret_cast<void*>(
  837. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetExternalSurfaceId)},
  838. {"nativeBufferViewportSetExternalSurface",
  839. "("
  840. "J"
  841. "J"
  842. ")"
  843. "V",
  844. reinterpret_cast<void*>(
  845. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetExternalSurface)},
  846. {"nativeBufferViewportGetReprojection",
  847. "("
  848. "J"
  849. ")"
  850. "I",
  851. reinterpret_cast<void*>(
  852. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportGetReprojection)},
  853. {"nativeBufferViewportSetReprojection",
  854. "("
  855. "J"
  856. "I"
  857. ")"
  858. "V",
  859. reinterpret_cast<void*>(
  860. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetReprojection)},
  861. {"nativeBufferViewportSetSourceLayer",
  862. "("
  863. "J"
  864. "I"
  865. ")"
  866. "V",
  867. reinterpret_cast<void*>(
  868. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceLayer)},
  869. {"nativeBufferSpecCreate",
  870. "("
  871. "J"
  872. ")"
  873. "J",
  874. reinterpret_cast<void*>(
  875. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecCreate)},
  876. {"nativeBufferSpecDestroy",
  877. "("
  878. "J"
  879. ")"
  880. "V",
  881. reinterpret_cast<void*>(
  882. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecDestroy)},
  883. {"nativeBufferSpecGetSize",
  884. "("
  885. "J"
  886. "Landroid/graphics/Point;"
  887. ")"
  888. "V",
  889. reinterpret_cast<void*>(
  890. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecGetSize)},
  891. {"nativeBufferSpecSetSize",
  892. "("
  893. "J"
  894. "I"
  895. "I"
  896. ")"
  897. "V",
  898. reinterpret_cast<void*>(
  899. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetSize)},
  900. {"nativeBufferSpecSetColorFormat",
  901. "("
  902. "J"
  903. "I"
  904. ")"
  905. "V",
  906. reinterpret_cast<void*>(
  907. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetColorFormat)},
  908. {"nativeBufferSpecSetDepthStencilFormat",
  909. "("
  910. "J"
  911. "I"
  912. ")"
  913. "V",
  914. reinterpret_cast<void*>(
  915. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetDepthStencilFormat)},
  916. {"nativeBufferSpecSetMultiviewLayers",
  917. "("
  918. "J"
  919. "I"
  920. ")"
  921. "V",
  922. reinterpret_cast<void*>(
  923. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetMultiviewLayers)},
  924. {"nativeBufferSpecGetSamples",
  925. "("
  926. "J"
  927. ")"
  928. "I",
  929. reinterpret_cast<void*>(
  930. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecGetSamples)},
  931. {"nativeBufferSpecSetSamples",
  932. "("
  933. "J"
  934. "I"
  935. ")"
  936. "V",
  937. reinterpret_cast<void*>(
  938. Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetSamples)},
  939. {"nativeExternalSurfaceCreateWithListeners",
  940. "("
  941. "J"
  942. "Ljava/lang/Runnable;"
  943. "Ljava/lang/Runnable;"
  944. "Landroid/os/Handler;"
  945. ")"
  946. "J",
  947. reinterpret_cast<void*>(
  948. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceCreateWithListeners)},
  949. {"nativeExternalSurfaceDestroy",
  950. "("
  951. "J"
  952. ")"
  953. "V",
  954. reinterpret_cast<void*>(
  955. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceDestroy)},
  956. {"nativeExternalSurfaceGetId",
  957. "("
  958. "J"
  959. ")"
  960. "I",
  961. reinterpret_cast<void*>(
  962. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceGetId)},
  963. {"nativeExternalSurfaceGetSurface",
  964. "("
  965. "J"
  966. ")"
  967. "Landroid/view/Surface;",
  968. reinterpret_cast<void*>(
  969. Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceGetSurface)},
  970. {"nativeSwapChainCreate",
  971. "("
  972. "J"
  973. "[J"
  974. ")"
  975. "J",
  976. reinterpret_cast<void*>(
  977. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainCreate)},
  978. {"nativeSwapChainDestroy",
  979. "("
  980. "J"
  981. ")"
  982. "V",
  983. reinterpret_cast<void*>(
  984. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainDestroy)},
  985. {"nativeSwapChainGetBufferCount",
  986. "("
  987. "J"
  988. ")"
  989. "I",
  990. reinterpret_cast<void*>(
  991. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainGetBufferCount)},
  992. {"nativeSwapChainGetBufferSize",
  993. "("
  994. "J"
  995. "I"
  996. "Landroid/graphics/Point;"
  997. ")"
  998. "V",
  999. reinterpret_cast<void*>(
  1000. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainGetBufferSize)},
  1001. {"nativeSwapChainResizeBuffer",
  1002. "("
  1003. "J"
  1004. "I"
  1005. "I"
  1006. "I"
  1007. ")"
  1008. "V",
  1009. reinterpret_cast<void*>(
  1010. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainResizeBuffer)},
  1011. {"nativeSwapChainAcquireFrame",
  1012. "("
  1013. "J"
  1014. ")"
  1015. "J",
  1016. reinterpret_cast<void*>(
  1017. Java_com_google_vr_ndk_base_GvrApi_nativeSwapChainAcquireFrame)},
  1018. {"nativeFrameBindBuffer",
  1019. "("
  1020. "J"
  1021. "I"
  1022. ")"
  1023. "V",
  1024. reinterpret_cast<void*>(
  1025. Java_com_google_vr_ndk_base_GvrApi_nativeFrameBindBuffer)},
  1026. {"nativeFrameUnbind",
  1027. "("
  1028. "J"
  1029. ")"
  1030. "V",
  1031. reinterpret_cast<void*>(
  1032. Java_com_google_vr_ndk_base_GvrApi_nativeFrameUnbind)},
  1033. {"nativeFrameGetFramebufferObject",
  1034. "("
  1035. "J"
  1036. "I"
  1037. ")"
  1038. "I",
  1039. reinterpret_cast<void*>(
  1040. Java_com_google_vr_ndk_base_GvrApi_nativeFrameGetFramebufferObject)},
  1041. {"nativeFrameGetBufferSize",
  1042. "("
  1043. "J"
  1044. "I"
  1045. "Landroid/graphics/Point;"
  1046. ")"
  1047. "V",
  1048. reinterpret_cast<void*>(
  1049. Java_com_google_vr_ndk_base_GvrApi_nativeFrameGetBufferSize)},
  1050. {"nativeFrameSubmit",
  1051. "("
  1052. "J"
  1053. "J"
  1054. "[F"
  1055. ")"
  1056. "V",
  1057. reinterpret_cast<void*>(
  1058. Java_com_google_vr_ndk_base_GvrApi_nativeFrameSubmit)},
  1059. {"nativeUsingDynamicLibrary",
  1060. "("
  1061. ")"
  1062. "Z",
  1063. reinterpret_cast<void*>(
  1064. Java_com_google_vr_ndk_base_GvrApi_nativeUsingDynamicLibrary)},
  1065. {"nativeUsingShimLibrary",
  1066. "("
  1067. ")"
  1068. "Z",
  1069. reinterpret_cast<void*>(
  1070. Java_com_google_vr_ndk_base_GvrApi_nativeUsingShimLibrary)},
  1071. {"nativeSetApplicationState",
  1072. "("
  1073. "Ljava/lang/ClassLoader;"
  1074. "Landroid/content/Context;"
  1075. ")"
  1076. "V",
  1077. reinterpret_cast<void*>(
  1078. Java_com_google_vr_ndk_base_GvrApi_nativeSetApplicationState)},
  1079. {"nativeSetDynamicLibraryLoadingEnabled",
  1080. "("
  1081. "Z"
  1082. ")"
  1083. "V",
  1084. reinterpret_cast<void*>(
  1085. Java_com_google_vr_ndk_base_GvrApi_nativeSetDynamicLibraryLoadingEnabled)},
  1086. {"nativeCreate",
  1087. "("
  1088. "Ljava/lang/ClassLoader;"
  1089. "Landroid/content/Context;"
  1090. "J"
  1091. "I"
  1092. "I"
  1093. "F"
  1094. "F"
  1095. "Lcom/google/vr/ndk/base/GvrApi$PoseTracker;"
  1096. ")"
  1097. "J",
  1098. reinterpret_cast<void*>(Java_com_google_vr_ndk_base_GvrApi_nativeCreate)},
  1099. {"nativeRequestContextSharing",
  1100. "("
  1101. "J"
  1102. "Lcom/google/vr/cardboard/EglReadyListener;"
  1103. ")"
  1104. "V",
  1105. reinterpret_cast<void*>(
  1106. Java_com_google_vr_ndk_base_GvrApi_nativeRequestContextSharing)},
  1107. {"nativeGetError",
  1108. "("
  1109. "J"
  1110. ")"
  1111. "I",
  1112. reinterpret_cast<void*>(
  1113. Java_com_google_vr_ndk_base_GvrApi_nativeGetError)},
  1114. {"nativeClearError",
  1115. "("
  1116. "J"
  1117. ")"
  1118. "I",
  1119. reinterpret_cast<void*>(
  1120. Java_com_google_vr_ndk_base_GvrApi_nativeClearError)},
  1121. {"nativeGetErrorString",
  1122. "("
  1123. "I"
  1124. ")"
  1125. "Ljava/lang/String;",
  1126. reinterpret_cast<void*>(
  1127. Java_com_google_vr_ndk_base_GvrApi_nativeGetErrorString)},
  1128. {"nativeGetUserPrefs",
  1129. "("
  1130. "J"
  1131. ")"
  1132. "J",
  1133. reinterpret_cast<void*>(
  1134. Java_com_google_vr_ndk_base_GvrApi_nativeGetUserPrefs)},
  1135. {"nativeUserPrefsGetControllerHandedness",
  1136. "("
  1137. "J"
  1138. ")"
  1139. "I",
  1140. reinterpret_cast<void*>(
  1141. Java_com_google_vr_ndk_base_GvrApi_nativeUserPrefsGetControllerHandedness)},
  1142. {"nativePause",
  1143. "("
  1144. "J"
  1145. ")"
  1146. "V",
  1147. reinterpret_cast<void*>(Java_com_google_vr_ndk_base_GvrApi_nativePause)},
  1148. {"nativeResume",
  1149. "("
  1150. "J"
  1151. ")"
  1152. "V",
  1153. reinterpret_cast<void*>(Java_com_google_vr_ndk_base_GvrApi_nativeResume)},
  1154. {"nativeReleaseGvrContext",
  1155. "("
  1156. "J"
  1157. ")"
  1158. "V",
  1159. reinterpret_cast<void*>(
  1160. Java_com_google_vr_ndk_base_GvrApi_nativeReleaseGvrContext)},
  1161. {"nativeInitializeGl",
  1162. "("
  1163. "J"
  1164. ")"
  1165. "V",
  1166. reinterpret_cast<void*>(
  1167. Java_com_google_vr_ndk_base_GvrApi_nativeInitializeGl)},
  1168. {"nativeOnSurfaceCreatedReprojectionThread",
  1169. "("
  1170. "J"
  1171. ")"
  1172. "V",
  1173. reinterpret_cast<void*>(
  1174. Java_com_google_vr_ndk_base_GvrApi_nativeOnSurfaceCreatedReprojectionThread)},
  1175. {"nativeOnSurfaceChangedReprojectionThread",
  1176. "("
  1177. "J"
  1178. ")"
  1179. "V",
  1180. reinterpret_cast<void*>(
  1181. Java_com_google_vr_ndk_base_GvrApi_nativeOnSurfaceChangedReprojectionThread)},
  1182. {"nativeGetRecommendedBufferViewports",
  1183. "("
  1184. "J"
  1185. "J"
  1186. ")"
  1187. "V",
  1188. reinterpret_cast<void*>(
  1189. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecommendedBufferViewports)},
  1190. {"nativeGetScreenBufferViewports",
  1191. "("
  1192. "J"
  1193. "J"
  1194. ")"
  1195. "V",
  1196. reinterpret_cast<void*>(
  1197. Java_com_google_vr_ndk_base_GvrApi_nativeGetScreenBufferViewports)},
  1198. {"nativeGetMaximumEffectiveRenderTargetSize",
  1199. "("
  1200. "J"
  1201. "Landroid/graphics/Point;"
  1202. ")"
  1203. "V",
  1204. reinterpret_cast<void*>(
  1205. Java_com_google_vr_ndk_base_GvrApi_nativeGetMaximumEffectiveRenderTargetSize)},
  1206. {"nativeGetScreenTargetSize",
  1207. "("
  1208. "J"
  1209. "Landroid/graphics/Point;"
  1210. ")"
  1211. "V",
  1212. reinterpret_cast<void*>(
  1213. Java_com_google_vr_ndk_base_GvrApi_nativeGetScreenTargetSize)},
  1214. {"nativeDistortToScreen",
  1215. "("
  1216. "J"
  1217. "I"
  1218. "J"
  1219. "[F"
  1220. "J"
  1221. ")"
  1222. "V",
  1223. reinterpret_cast<void*>(
  1224. Java_com_google_vr_ndk_base_GvrApi_nativeDistortToScreen)},
  1225. {"nativeSetDefaultFramebufferActive",
  1226. "("
  1227. "J"
  1228. ")"
  1229. "V",
  1230. reinterpret_cast<void*>(
  1231. Java_com_google_vr_ndk_base_GvrApi_nativeSetDefaultFramebufferActive)},
  1232. {"nativeRenderReprojectionThread",
  1233. "("
  1234. "J"
  1235. ")"
  1236. "Landroid/graphics/Point;",
  1237. reinterpret_cast<void*>(
  1238. Java_com_google_vr_ndk_base_GvrApi_nativeRenderReprojectionThread)},
  1239. {"nativeOnPauseReprojectionThread",
  1240. "("
  1241. "J"
  1242. ")"
  1243. "V",
  1244. reinterpret_cast<void*>(
  1245. Java_com_google_vr_ndk_base_GvrApi_nativeOnPauseReprojectionThread)},
  1246. {"nativeGetHeadSpaceFromStartSpaceRotation",
  1247. "("
  1248. "J"
  1249. "[F"
  1250. "J"
  1251. ")"
  1252. "V",
  1253. reinterpret_cast<void*>(
  1254. Java_com_google_vr_ndk_base_GvrApi_nativeGetHeadSpaceFromStartSpaceRotation)},
  1255. {"nativeGetHeadSpaceFromStartSpaceTransform",
  1256. "("
  1257. "J"
  1258. "[F"
  1259. "J"
  1260. ")"
  1261. "V",
  1262. reinterpret_cast<void*>(
  1263. Java_com_google_vr_ndk_base_GvrApi_nativeGetHeadSpaceFromStartSpaceTransform)},
  1264. {"nativeSetIgnoreManualPauseResumeTracker",
  1265. "("
  1266. "J"
  1267. "Z"
  1268. ")"
  1269. "V",
  1270. reinterpret_cast<void*>(
  1271. Java_com_google_vr_ndk_base_GvrApi_nativeSetIgnoreManualPauseResumeTracker)},
  1272. {"nativePauseTracking",
  1273. "("
  1274. "J"
  1275. ")"
  1276. "V",
  1277. reinterpret_cast<void*>(
  1278. Java_com_google_vr_ndk_base_GvrApi_nativePauseTracking)},
  1279. {"nativePauseTrackingGetState",
  1280. "("
  1281. "J"
  1282. ")"
  1283. "[B",
  1284. reinterpret_cast<void*>(
  1285. Java_com_google_vr_ndk_base_GvrApi_nativePauseTrackingGetState)},
  1286. {"nativeResumeTracking",
  1287. "("
  1288. "J"
  1289. ")"
  1290. "V",
  1291. reinterpret_cast<void*>(
  1292. Java_com_google_vr_ndk_base_GvrApi_nativeResumeTracking)},
  1293. {"nativeResumeTrackingSetState",
  1294. "("
  1295. "J"
  1296. "[B"
  1297. ")"
  1298. "V",
  1299. reinterpret_cast<void*>(
  1300. Java_com_google_vr_ndk_base_GvrApi_nativeResumeTrackingSetState)},
  1301. {"nativeResetTracking",
  1302. "("
  1303. "J"
  1304. ")"
  1305. "V",
  1306. reinterpret_cast<void*>(
  1307. Java_com_google_vr_ndk_base_GvrApi_nativeResetTracking)},
  1308. {"nativeRecenterTracking",
  1309. "("
  1310. "J"
  1311. ")"
  1312. "V",
  1313. reinterpret_cast<void*>(
  1314. Java_com_google_vr_ndk_base_GvrApi_nativeRecenterTracking)},
  1315. {"nativeGetEyeFromHeadMatrix",
  1316. "("
  1317. "J"
  1318. "I"
  1319. "[F"
  1320. ")"
  1321. "V",
  1322. reinterpret_cast<void*>(
  1323. Java_com_google_vr_ndk_base_GvrApi_nativeGetEyeFromHeadMatrix)},
  1324. {"nativeGetWindowBounds",
  1325. "("
  1326. "J"
  1327. ")"
  1328. "[I",
  1329. reinterpret_cast<void*>(
  1330. Java_com_google_vr_ndk_base_GvrApi_nativeGetWindowBounds)},
  1331. {"nativeComputeDistortedPoint",
  1332. "("
  1333. "J"
  1334. "I"
  1335. "[F"
  1336. ")"
  1337. "[F",
  1338. reinterpret_cast<void*>(
  1339. Java_com_google_vr_ndk_base_GvrApi_nativeComputeDistortedPoint)},
  1340. {"nativeSetDefaultViewerProfile",
  1341. "("
  1342. "J"
  1343. "Ljava/lang/String;"
  1344. ")"
  1345. "Z",
  1346. reinterpret_cast<void*>(
  1347. Java_com_google_vr_ndk_base_GvrApi_nativeSetDefaultViewerProfile)},
  1348. {"nativeGetViewerVendor",
  1349. "("
  1350. "J"
  1351. ")"
  1352. "Ljava/lang/String;",
  1353. reinterpret_cast<void*>(
  1354. Java_com_google_vr_ndk_base_GvrApi_nativeGetViewerVendor)},
  1355. {"nativeGetViewerModel",
  1356. "("
  1357. "J"
  1358. ")"
  1359. "Ljava/lang/String;",
  1360. reinterpret_cast<void*>(
  1361. Java_com_google_vr_ndk_base_GvrApi_nativeGetViewerModel)},
  1362. {"nativeGetViewerType",
  1363. "("
  1364. "J"
  1365. ")"
  1366. "I",
  1367. reinterpret_cast<void*>(
  1368. Java_com_google_vr_ndk_base_GvrApi_nativeGetViewerType)},
  1369. {"nativeSetAsyncReprojectionEnabled",
  1370. "("
  1371. "J"
  1372. "Z"
  1373. ")"
  1374. "Z",
  1375. reinterpret_cast<void*>(
  1376. Java_com_google_vr_ndk_base_GvrApi_nativeSetAsyncReprojectionEnabled)},
  1377. {"nativeGetAsyncReprojectionEnabled",
  1378. "("
  1379. "J"
  1380. ")"
  1381. "Z",
  1382. reinterpret_cast<void*>(
  1383. Java_com_google_vr_ndk_base_GvrApi_nativeGetAsyncReprojectionEnabled)},
  1384. {"nativeIsFeatureSupported",
  1385. "("
  1386. "J"
  1387. "I"
  1388. ")"
  1389. "Z",
  1390. reinterpret_cast<void*>(
  1391. Java_com_google_vr_ndk_base_GvrApi_nativeIsFeatureSupported)},
  1392. {"nativeReconnectSensors",
  1393. "("
  1394. "J"
  1395. ")"
  1396. "V",
  1397. reinterpret_cast<void*>(
  1398. Java_com_google_vr_ndk_base_GvrApi_nativeReconnectSensors)},
  1399. {"nativeSetIdleListener",
  1400. "("
  1401. "J"
  1402. "Lcom/google/vr/ndk/base/GvrApi$IdleListener;"
  1403. ")"
  1404. "V",
  1405. reinterpret_cast<void*>(
  1406. Java_com_google_vr_ndk_base_GvrApi_nativeSetIdleListener)},
  1407. {"nativeSetViewerParams",
  1408. "("
  1409. "J"
  1410. "[B"
  1411. ")"
  1412. "Z",
  1413. reinterpret_cast<void*>(
  1414. Java_com_google_vr_ndk_base_GvrApi_nativeSetViewerParams)},
  1415. {"nativeSetDisplayMetrics",
  1416. "("
  1417. "J"
  1418. "I"
  1419. "I"
  1420. "F"
  1421. "F"
  1422. ")"
  1423. "V",
  1424. reinterpret_cast<void*>(
  1425. Java_com_google_vr_ndk_base_GvrApi_nativeSetDisplayMetrics)},
  1426. {"nativeGetBorderSizeMeters",
  1427. "("
  1428. "J"
  1429. ")"
  1430. "F",
  1431. reinterpret_cast<void*>(
  1432. Java_com_google_vr_ndk_base_GvrApi_nativeGetBorderSizeMeters)},
  1433. {"nativeSetSurfaceSize",
  1434. "("
  1435. "J"
  1436. "I"
  1437. "I"
  1438. ")"
  1439. "V",
  1440. reinterpret_cast<void*>(
  1441. Java_com_google_vr_ndk_base_GvrApi_nativeSetSurfaceSize)},
  1442. {"nativeSetLensOffset",
  1443. "("
  1444. "J"
  1445. "F"
  1446. "F"
  1447. "F"
  1448. ")"
  1449. "V",
  1450. reinterpret_cast<void*>(
  1451. Java_com_google_vr_ndk_base_GvrApi_nativeSetLensOffset)},
  1452. {"nativeDumpDebugData",
  1453. "("
  1454. "J"
  1455. ")"
  1456. "V",
  1457. reinterpret_cast<void*>(
  1458. Java_com_google_vr_ndk_base_GvrApi_nativeDumpDebugData)},
  1459. {"nativeUsingVrDisplayService",
  1460. "("
  1461. "J"
  1462. ")"
  1463. "Z",
  1464. reinterpret_cast<void*>(
  1465. Java_com_google_vr_ndk_base_GvrApi_nativeUsingVrDisplayService)},
  1466. {"nativeCreateEvent",
  1467. "("
  1468. ")"
  1469. "J",
  1470. reinterpret_cast<void*>(
  1471. Java_com_google_vr_ndk_base_GvrApi_nativeCreateEvent)},
  1472. {"nativeCreateValue",
  1473. "("
  1474. ")"
  1475. "J",
  1476. reinterpret_cast<void*>(
  1477. Java_com_google_vr_ndk_base_GvrApi_nativeCreateValue)},
  1478. {"nativeDestroyEvent",
  1479. "("
  1480. "J"
  1481. ")"
  1482. "V",
  1483. reinterpret_cast<void*>(
  1484. Java_com_google_vr_ndk_base_GvrApi_nativeDestroyEvent)},
  1485. {"nativeDestroyValue",
  1486. "("
  1487. "J"
  1488. ")"
  1489. "V",
  1490. reinterpret_cast<void*>(
  1491. Java_com_google_vr_ndk_base_GvrApi_nativeDestroyValue)},
  1492. {"nativeGetCurrentProperties",
  1493. "("
  1494. "J"
  1495. ")"
  1496. "J",
  1497. reinterpret_cast<void*>(
  1498. Java_com_google_vr_ndk_base_GvrApi_nativeGetCurrentProperties)},
  1499. {"nativeGetEventFlags",
  1500. "("
  1501. "J"
  1502. ")"
  1503. "J",
  1504. reinterpret_cast<void*>(
  1505. Java_com_google_vr_ndk_base_GvrApi_nativeGetEventFlags)},
  1506. {"nativeGetEventTimestamp",
  1507. "("
  1508. "J"
  1509. ")"
  1510. "J",
  1511. reinterpret_cast<void*>(
  1512. Java_com_google_vr_ndk_base_GvrApi_nativeGetEventTimestamp)},
  1513. {"nativeGetEventType",
  1514. "("
  1515. "J"
  1516. ")"
  1517. "I",
  1518. reinterpret_cast<void*>(
  1519. Java_com_google_vr_ndk_base_GvrApi_nativeGetEventType)},
  1520. {"nativeGetProperty",
  1521. "("
  1522. "J"
  1523. "I"
  1524. "J"
  1525. ")"
  1526. "Z",
  1527. reinterpret_cast<void*>(
  1528. Java_com_google_vr_ndk_base_GvrApi_nativeGetProperty)},
  1529. {"nativeGetRecenterEventFlags",
  1530. "("
  1531. "J"
  1532. ")"
  1533. "J",
  1534. reinterpret_cast<void*>(
  1535. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecenterEventFlags)},
  1536. {"nativeGetRecenterEventStartSpaceFromTrackingSpaceTransform",
  1537. "("
  1538. "J"
  1539. "[F"
  1540. ")"
  1541. "V",
  1542. reinterpret_cast<void*>(
  1543. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecenterEventStartSpaceFromTrackingSpaceTransform)},
  1544. {"nativeGetRecenterEventType",
  1545. "("
  1546. "J"
  1547. ")"
  1548. "I",
  1549. reinterpret_cast<void*>(
  1550. Java_com_google_vr_ndk_base_GvrApi_nativeGetRecenterEventType)},
  1551. {"nativePollEvent",
  1552. "("
  1553. "J"
  1554. "J"
  1555. ")"
  1556. "Z",
  1557. reinterpret_cast<void*>(
  1558. Java_com_google_vr_ndk_base_GvrApi_nativePollEvent)},
  1559. {"nativeValueAsFlags",
  1560. "("
  1561. "J"
  1562. ")"
  1563. "J",
  1564. reinterpret_cast<void*>(
  1565. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsFlags)},
  1566. {"nativeValueAsFloat",
  1567. "("
  1568. "J"
  1569. ")"
  1570. "F",
  1571. reinterpret_cast<void*>(
  1572. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsFloat)},
  1573. {"nativeValueAsInt",
  1574. "("
  1575. "J"
  1576. ")"
  1577. "I",
  1578. reinterpret_cast<void*>(
  1579. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsInt)},
  1580. {"nativeValueAsMat4f",
  1581. "("
  1582. "J"
  1583. "[F"
  1584. ")"
  1585. "V",
  1586. reinterpret_cast<void*>(
  1587. Java_com_google_vr_ndk_base_GvrApi_nativeValueAsMat4f)},
  1588. {"nativeValueGetFlags",
  1589. "("
  1590. "J"
  1591. ")"
  1592. "J",
  1593. reinterpret_cast<void*>(
  1594. Java_com_google_vr_ndk_base_GvrApi_nativeValueGetFlags)},
  1595. };
  1596. static bool RegisterNativesImpl(JNIEnv* env) {
  1597. if (base::android::IsSelectiveJniRegistrationEnabled(env))
  1598. return true;
  1599. const int kMethodsGvrApiSize = std::extent<decltype(kMethodsGvrApi)>();
  1600. if (env->RegisterNatives(GvrApi_clazz(env), kMethodsGvrApi,
  1601. kMethodsGvrApiSize) < 0) {
  1602. jni_generator::HandleRegistrationError(env, GvrApi_clazz(env), __FILE__);
  1603. return false;
  1604. }
  1605. return true;
  1606. }
  1607. static bool RegisterGvrApiNatives(JNIEnv* env) {
  1608. return RegisterNativesImpl(env);
  1609. }
  1610. } // namespace GvrApi
  1611. #endif // com_google_vr_ndk_base_GvrApi_JNI