ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
videoAndroid.h
Go to the documentation of this file.
1/*
2 * videoAndroid.h
3 * artoolkitX
4 *
5 * This file is part of artoolkitX.
6 *
7 * artoolkitX is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * artoolkitX is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2018 Realmax, Inc.
32 * Copyright 2015-2016 Daqri, LLC.
33 * Copyright 2014-2015 ARToolworks, Inc.
34 *
35 * Author(s): Philip Lamb
36 *
37 */
38
39#ifndef AR_VIDEO_ANDROID_H
40#define AR_VIDEO_ANDROID_H
41
42#include <ARX/ARVideo/video.h>
43#include <jni.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
50
51#define AR_VIDEO_ANDROID_FOCAL_LENGTH_DEFAULT 0.3 // Metres.
52
53//
54// At present, videoAndroid does not support native camera access, and depends on use of the
55// ar2VideoPush*Android functions to push incoming video frames.
56// Most of the video functionality on Android is handled in separate Android-specific classes.
57// For Java (JDK) Android apps, the classes are in ARBaseLib.
58// For Native (NDK) Android apps, the classes are in the 'CameraSurface' class (part of the example code).
59//
60
62AR2VideoParamAndroidT *ar2VideoOpenAsyncAndroid ( const char *config, void (*callback)(void *), void *userdata );
70int ar2VideoGetParamiAndroid ( AR2VideoParamAndroidT *vid, int paramName, int *value );
71int ar2VideoSetParamiAndroid ( AR2VideoParamAndroidT *vid, int paramName, int value );
72int ar2VideoGetParamdAndroid ( AR2VideoParamAndroidT *vid, int paramName, double *value );
73int ar2VideoSetParamdAndroid ( AR2VideoParamAndroidT *vid, int paramName, double value );
74int ar2VideoGetParamsAndroid ( AR2VideoParamAndroidT *vid, const int paramName, char **value );
75int ar2VideoSetParamsAndroid ( AR2VideoParamAndroidT *vid, const int paramName, const char *value );
77
79
80// JNI interface.
81jint ar2VideoPushInitAndroid(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jint width, jint height, const char *pixelFormat, jint camera_index, jint camera_face);
82jint ar2VideoPushAndroid1(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jbyteArray buf, jint bufSize);
83jint ar2VideoPushAndroid2(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj,
84 jobject buf0, jint buf0PixelStride, jint buf0RowStride,
85 jobject buf1, jint buf1PixelStride, jint buf1RowStride,
86 jobject buf2, jint buf2PixelStride, jint buf2RowStride,
87 jobject buf3, jint buf3PixelStride, jint buf3RowStride);
88jint ar2VideoPushFinalAndroid(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj);
89
90#ifdef __cplusplus
91}
92#endif
93#endif // AR_VIDEO_ANDROID_H
unsigned int ARUint32
Definition: ar.h:94
Definition: videoAndroidPrivate.h:74
void * userdata
Definition: videoAndroidPrivate.h:89
AR_PIXEL_FORMAT pixelFormat
Definition: videoAndroidPrivate.h:79
int width
Definition: videoAndroidPrivate.h:77
int height
Definition: videoAndroidPrivate.h:78
int camera_index
Definition: videoAndroidPrivate.h:76
int camera_face
Definition: videoAndroidPrivate.h:91
void(* callback)(void *)
Definition: videoAndroidPrivate.h:88
A structure which carries information about a video frame retrieved by the video library.
Definition: ar.h:148
Structure holding camera parameters, including image size, projection matrix and lens distortion para...
Definition: param.h:99
Values describing a list of video sources.
Definition: video.h:292
int ar2VideoCapStopAndroid(AR2VideoParamAndroidT *vid)
AR2VideoParamAndroidT * ar2VideoOpenAsyncAndroid(const char *config, void(*callback)(void *), void *userdata)
int ar2VideoGetIdAndroid(AR2VideoParamAndroidT *vid, ARUint32 *id0, ARUint32 *id1)
ARVideoSourceInfoListT * ar2VideoCreateSourceInfoListAndroid(const char *config_in)
int ar2VideoSetParamsAndroid(AR2VideoParamAndroidT *vid, const int paramName, const char *value)
int ar2VideoGetParamdAndroid(AR2VideoParamAndroidT *vid, int paramName, double *value)
AR2VideoBufferT * ar2VideoGetImageAndroid(AR2VideoParamAndroidT *vid)
int ar2VideoCapStartAndroid(AR2VideoParamAndroidT *vid)
int ar2VideoGetParamsAndroid(AR2VideoParamAndroidT *vid, const int paramName, char **value)
jint ar2VideoPushAndroid2(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jobject buf0, jint buf0PixelStride, jint buf0RowStride, jobject buf1, jint buf1PixelStride, jint buf1RowStride, jobject buf2, jint buf2PixelStride, jint buf2RowStride, jobject buf3, jint buf3PixelStride, jint buf3RowStride)
jint ar2VideoPushAndroid1(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jbyteArray buf, jint bufSize)
int ar2VideoGetParamiAndroid(AR2VideoParamAndroidT *vid, int paramName, int *value)
int ar2VideoGetSizeAndroid(AR2VideoParamAndroidT *vid, int *x, int *y)
int ar2VideoSetParamiAndroid(AR2VideoParamAndroidT *vid, int paramName, int value)
AR_PIXEL_FORMAT ar2VideoGetPixelFormatAndroid(AR2VideoParamAndroidT *vid)
jint ar2VideoPushInitAndroid(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jint width, jint height, const char *pixelFormat, jint camera_index, jint camera_face)
int ar2VideoDispOptionAndroid(void)
int ar2VideoGetCParamAsyncAndroid(AR2VideoParamAndroidT *vid, void(*callback)(const ARParam *, void *), void *userdata)
jint ar2VideoPushFinalAndroid(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj)
int ar2VideoSetParamdAndroid(AR2VideoParamAndroidT *vid, int paramName, double value)
int ar2VideoCloseAndroid(AR2VideoParamAndroidT *vid)