| 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
46 extern "C" {
47#endif
48
49 typedef struct _AR2VideoParamAndroidT AR2VideoParamAndroidT;
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
61 int ar2VideoDispOptionAndroid ( void );
62 AR2VideoParamAndroidT *ar2VideoOpenAsyncAndroid ( const char *config, void (*callback)(void *), void *userdata );
63 int ar2VideoCloseAndroid ( AR2VideoParamAndroidT *vid );
64 int ar2VideoGetIdAndroid ( AR2VideoParamAndroidT *vid, ARUint32 *id0, ARUint32 *id1 );
65 int ar2VideoGetSizeAndroid ( AR2VideoParamAndroidT *vid, int *x,int *y );
66AR_PIXEL_FORMAT ar2VideoGetPixelFormatAndroid ( AR2VideoParamAndroidT *vid );
67 AR2VideoBufferT *ar2VideoGetImageAndroid ( AR2VideoParamAndroidT *vid );
68 int ar2VideoCapStartAndroid ( AR2VideoParamAndroidT *vid );
69 int ar2VideoCapStopAndroid ( AR2VideoParamAndroidT *vid );
70 int ar2VideoGetParamiAndroid ( AR2VideoParamAndroidT *vid, int paramName, int *value );
71 int ar2VideoSetParamiAndroid ( AR2VideoParamAndroidT *vid, int paramName, int value );
72 int ar2VideoGetParamdAndroid ( AR2VideoParamAndroidT *vid, int paramName, double *value );
73 int ar2VideoSetParamdAndroid ( AR2VideoParamAndroidT *vid, int paramName, double value );
74 int ar2VideoGetParamsAndroid ( AR2VideoParamAndroidT *vid, const int paramName, char **value );
75 int ar2VideoSetParamsAndroid ( AR2VideoParamAndroidT *vid, const int paramName, const char *value );
76 ARVideoSourceInfoListT *ar2VideoCreateSourceInfoListAndroid(const char *config_in);
77
78 int ar2VideoGetCParamAsyncAndroid (AR2VideoParamAndroidT *vid, void (*callback)(const ARParam *, void *), void *userdata);
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
ARUint32
unsigned int ARUint32
Definition: ar.h:94
_AR2VideoParamAndroidT
Definition: videoAndroidPrivate.h:63
_AR2VideoParamAndroidT::userdata
void * userdata
Definition: videoAndroidPrivate.h:78
_AR2VideoParamAndroidT::pixelFormat
AR_PIXEL_FORMAT pixelFormat
Definition: videoAndroidPrivate.h:68
_AR2VideoParamAndroidT::width
int width
Definition: videoAndroidPrivate.h:66
_AR2VideoParamAndroidT::height
int height
Definition: videoAndroidPrivate.h:67
_AR2VideoParamAndroidT::camera_index
int camera_index
Definition: videoAndroidPrivate.h:65
_AR2VideoParamAndroidT::callback
void(* callback)(void *)
Definition: videoAndroidPrivate.h:77
AR2VideoBufferT
A structure which carries information about a video frame retrieved by the video library.
Definition: ar.h:148
ARParam
Structure holding camera parameters, including image size, projection matrix and lens distortion para...
Definition: param.h:99
ARVideoSourceInfoListT
Values describing a list of video sources.
Definition: video.h:297
video.h
ar2VideoCapStopAndroid
int ar2VideoCapStopAndroid(AR2VideoParamAndroidT *vid)
ar2VideoOpenAsyncAndroid
AR2VideoParamAndroidT * ar2VideoOpenAsyncAndroid(const char *config, void(*callback)(void *), void *userdata)
ar2VideoGetIdAndroid
int ar2VideoGetIdAndroid(AR2VideoParamAndroidT *vid, ARUint32 *id0, ARUint32 *id1)
ar2VideoCreateSourceInfoListAndroid
ARVideoSourceInfoListT * ar2VideoCreateSourceInfoListAndroid(const char *config_in)
ar2VideoSetParamsAndroid
int ar2VideoSetParamsAndroid(AR2VideoParamAndroidT *vid, const int paramName, const char *value)
ar2VideoGetParamdAndroid
int ar2VideoGetParamdAndroid(AR2VideoParamAndroidT *vid, int paramName, double *value)
ar2VideoGetImageAndroid
AR2VideoBufferT * ar2VideoGetImageAndroid(AR2VideoParamAndroidT *vid)
ar2VideoCapStartAndroid
int ar2VideoCapStartAndroid(AR2VideoParamAndroidT *vid)
ar2VideoGetParamsAndroid
int ar2VideoGetParamsAndroid(AR2VideoParamAndroidT *vid, const int paramName, char **value)
ar2VideoPushAndroid2
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)
ar2VideoPushAndroid1
jint ar2VideoPushAndroid1(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jbyteArray buf, jint bufSize)
ar2VideoGetParamiAndroid
int ar2VideoGetParamiAndroid(AR2VideoParamAndroidT *vid, int paramName, int *value)
ar2VideoGetSizeAndroid
int ar2VideoGetSizeAndroid(AR2VideoParamAndroidT *vid, int *x, int *y)
ar2VideoSetParamiAndroid
int ar2VideoSetParamiAndroid(AR2VideoParamAndroidT *vid, int paramName, int value)
ar2VideoGetPixelFormatAndroid
AR_PIXEL_FORMAT ar2VideoGetPixelFormatAndroid(AR2VideoParamAndroidT *vid)
ar2VideoPushInitAndroid
jint ar2VideoPushInitAndroid(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj, jint width, jint height, const char *pixelFormat, jint camera_index, jint camera_face)
ar2VideoDispOptionAndroid
int ar2VideoDispOptionAndroid(void)
ar2VideoGetCParamAsyncAndroid
int ar2VideoGetCParamAsyncAndroid(AR2VideoParamAndroidT *vid, void(*callback)(const ARParam *, void *), void *userdata)
ar2VideoPushFinalAndroid
jint ar2VideoPushFinalAndroid(AR2VideoParamAndroidT *vid, C_JNIEnv *env, jobject obj)
ar2VideoSetParamdAndroid
int ar2VideoSetParamdAndroid(AR2VideoParamAndroidT *vid, int paramName, double value)
ar2VideoCloseAndroid
int ar2VideoCloseAndroid(AR2VideoParamAndroidT *vid)