Video preview on android with Qt app

Анцев Александр
Mon, Aug 15, 2016 11:25 AM

Hello!

I'm trying to build an app for android with GUI written on Qt. Now I'm working on video preview. What i've done already:

  1. Build OpenH264 lib.
  2. Build pjsip with video support.
  3. Copy PjCamera.java and PjCameraInfo.java into my app folder (src\org\pjsip).

The problem is that pjsip unable to find class name PjCamera from JVM. I have this debug log:
.............
I/pjsua  (16412): 22:52:38.159 android_jni_de  ..Android JNI sound library initialized
I/pjsua  (16412): 22:52:38.162          pjlib  ..select() I/O Queue created (0xb861b48c)
I/pjsua  (16412): 22:52:38.182    pjsua_vid.c  ..Initializing video subsystem..
I/pjsua  (16412): 22:52:38.183  openh264.cpp  ...OpenH264 codec initialized
I/pjsua  (16412): 22:52:38.183  opengl_dev.c  ...OpenGL device initialized
I/pjsua  (16412): 22:52:38.184  android_dev.c  ...[JNI] Unable to find class 'PjCamera'
.............

And when I'm trying to create preview video program crashes. (I'm not sure that I'm creating video preview with correct device and maybe this is another error).
My code:
vidPrev = new VideoPreview(PJMEDIA_VID_DEFAULT_RENDER_DEV);
VideoPreviewOpParam param;
vidPrev->start(param); // <--  crash here
VideoWindow prev = vidPrev->getVideoWindow();

Crash log:
I/pjsua  (16412): 22:52:39.511    pjsua_vid.c !Starting preview for cap_dev=-2, show=1
I/pjsua  (16412): 22:52:39.511    pjsua_vid.c  .Creating video window: type=preview, cap_id=-2, rend_id=-2
I/pjsua  (16412): 22:52:39.511    pjsua_vid.c  ..Window 0: destroying..
I/pjsua  (16412): 22:52:39.511      media.cpp  pjsua_vid_preview_start(devId, &prm) error: Invalid video device (PJMEDIA_EVID_INVDEV) (status=520004) [../src/pjsua2/media.cpp:1185]
F/libc    (16412): Fatal signal 6 (SIGABRT), code -6 in tid 16638 (QtThread)
I/DEBUG  (  288): pid: 16412, tid: 16638, name: QtThread  >>> org.qtproject.example <<<
D/InputDispatcher(  984): Focus left window: 16412
E/lowmemorykiller(  255): Error writing /proc/16412/oom_score_adj; errno=22
I/Zygote  (  317): Process 16412 exited due to signal (6)
I/ActivityManager(  984): Process org.qtproject.example (pid 16412)(adj 1) has died.(63,298)

Does anybody faced with such error before?

--
С уважением,
Александр Анцев

Hello! I'm trying to build an app for android with GUI written on Qt. Now I'm working on video preview. What i've done already: 1. Build OpenH264 lib. 2. Build pjsip with video support. 3. Copy PjCamera.java and PjCameraInfo.java into my app folder (src\org\pjsip\). The problem is that pjsip unable to find class name PjCamera from JVM. I have this debug log: ............. I/pjsua (16412): 22:52:38.159 android_jni_de ..Android JNI sound library initialized I/pjsua (16412): 22:52:38.162 pjlib ..select() I/O Queue created (0xb861b48c) I/pjsua (16412): 22:52:38.182 pjsua_vid.c ..Initializing video subsystem.. I/pjsua (16412): 22:52:38.183 openh264.cpp ...OpenH264 codec initialized I/pjsua (16412): 22:52:38.183 opengl_dev.c ...OpenGL device initialized I/pjsua (16412): 22:52:38.184 android_dev.c ...[JNI] Unable to find class 'PjCamera' ............. And when I'm trying to create preview video program crashes. (I'm not sure that I'm creating video preview with correct device and maybe this is another error). My code: vidPrev = new VideoPreview(PJMEDIA_VID_DEFAULT_RENDER_DEV); VideoPreviewOpParam param; vidPrev->start(param); // <-- crash here VideoWindow prev = vidPrev->getVideoWindow(); Crash log: I/pjsua (16412): 22:52:39.511 pjsua_vid.c !Starting preview for cap_dev=-2, show=1 I/pjsua (16412): 22:52:39.511 pjsua_vid.c .Creating video window: type=preview, cap_id=-2, rend_id=-2 I/pjsua (16412): 22:52:39.511 pjsua_vid.c ..Window 0: destroying.. I/pjsua (16412): 22:52:39.511 media.cpp pjsua_vid_preview_start(devId, &prm) error: Invalid video device (PJMEDIA_EVID_INVDEV) (status=520004) [../src/pjsua2/media.cpp:1185] F/libc (16412): Fatal signal 6 (SIGABRT), code -6 in tid 16638 (QtThread) I/DEBUG ( 288): pid: 16412, tid: 16638, name: QtThread >>> org.qtproject.example <<< D/InputDispatcher( 984): Focus left window: 16412 E/lowmemorykiller( 255): Error writing /proc/16412/oom_score_adj; errno=22 I/Zygote ( 317): Process 16412 exited due to signal (6) I/ActivityManager( 984): Process org.qtproject.example (pid 16412)(adj 1) has died.(63,298) Does anybody faced with such error before? -- С уважением, Александр Анцев
Анцев Александр
Tue, Aug 16, 2016 7:07 PM

Hello!

The problem with finding PjCamera class is solved.
PjClass is searched in "pjproject-2.5.5\pjmedia\src\pjmedia-videodev\android_dev.c" file in jni_init_ids() function. This function is normally called in thread which loaded this lib, so this function have access to class loader and everything is working fine, But when you starting use Qt for GUI, QApplication is started in its own thread and the system class loader is available from this context, so jni_init_ids() can't find PjCamera with FindClass.
The simplest solution is find PjCamera in JNI_OnLoad() function, defined in "pjproject-2.5.5\pjlib\src\pj\os_core_unix.c" and cache the results. This function is called when library is loaded and class loader is available.
To do so the two things should be done:

  1. Move some code from jni_init_ids() to JNI_OnLoad().
  2. use __android_log_print instead of PJ_LOG macro (because log facility is not inited at this point).

I've made a patch (git diff), hope it will be usefull.

15.08.2016, 14:26, "Анцев Александр" a.antsev@yandex.ru:

Hello!

I'm trying to build an app for android with GUI written on Qt. Now I'm working on video preview. What i've done already:

  1. Build OpenH264 lib.
  2. Build pjsip with video support.
  3. Copy PjCamera.java and PjCameraInfo.java into my app folder (src\org\pjsip).

The problem is that pjsip unable to find class name PjCamera from JVM. I have this debug log:
.............
I/pjsua (16412): 22:52:38.159 android_jni_de ..Android JNI sound library initialized
I/pjsua (16412): 22:52:38.162 pjlib ..select() I/O Queue created (0xb861b48c)
I/pjsua (16412): 22:52:38.182 pjsua_vid.c ..Initializing video subsystem..
I/pjsua (16412): 22:52:38.183 openh264.cpp ...OpenH264 codec initialized
I/pjsua (16412): 22:52:38.183 opengl_dev.c ...OpenGL device initialized
I/pjsua (16412): 22:52:38.184 android_dev.c ...[JNI] Unable to find class 'PjCamera'
.............

And when I'm trying to create preview video program crashes. (I'm not sure that I'm creating video preview with correct device and maybe this is another error).
My code:
    vidPrev = new VideoPreview(PJMEDIA_VID_DEFAULT_RENDER_DEV);
    VideoPreviewOpParam param;
    vidPrev->start(param); // <-- crash here
    VideoWindow prev = vidPrev->getVideoWindow();

Crash log:
I/pjsua (16412): 22:52:39.511 pjsua_vid.c !Starting preview for cap_dev=-2, show=1
I/pjsua (16412): 22:52:39.511 pjsua_vid.c .Creating video window: type=preview, cap_id=-2, rend_id=-2
I/pjsua (16412): 22:52:39.511 pjsua_vid.c ..Window 0: destroying..
I/pjsua (16412): 22:52:39.511 media.cpp pjsua_vid_preview_start(devId, &prm) error: Invalid video device (PJMEDIA_EVID_INVDEV) (status=520004) [../src/pjsua2/media.cpp:1185]
F/libc (16412): Fatal signal 6 (SIGABRT), code -6 in tid 16638 (QtThread)
I/DEBUG ( 288): pid: 16412, tid: 16638, name: QtThread >>> org.qtproject.example <<<
D/InputDispatcher( 984): Focus left window: 16412
E/lowmemorykiller( 255): Error writing /proc/16412/oom_score_adj; errno=22
I/Zygote ( 317): Process 16412 exited due to signal (6)
I/ActivityManager( 984): Process org.qtproject.example (pid 16412)(adj 1) has died.(63,298)

Does anybody faced with such error before?

--
С уважением,
Александр Анцев


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
С уважением,
Александр Анцев

Hello! The problem with finding PjCamera class is solved. PjClass is searched in "pjproject-2.5.5\pjmedia\src\pjmedia-videodev\android_dev.c" file in jni_init_ids() function. This function is normally called in thread which loaded this lib, so this function have access to class loader and everything is working fine, But when you starting use Qt for GUI, QApplication is started in its own thread and the system class loader is available from this context, so jni_init_ids() can't find PjCamera with FindClass. The simplest solution is find PjCamera in JNI_OnLoad() function, defined in "pjproject-2.5.5\pjlib\src\pj\os_core_unix.c" and cache the results. This function is called when library is loaded and class loader is available. To do so the two things should be done: 1. Move some code from jni_init_ids() to JNI_OnLoad(). 2. use __android_log_print instead of PJ_LOG macro (because log facility is not inited at this point). I've made a patch (git diff), hope it will be usefull. 15.08.2016, 14:26, "Анцев Александр" <a.antsev@yandex.ru>: > Hello! > > I'm trying to build an app for android with GUI written on Qt. Now I'm working on video preview. What i've done already: > 1. Build OpenH264 lib. > 2. Build pjsip with video support. > 3. Copy PjCamera.java and PjCameraInfo.java into my app folder (src\org\pjsip\). > > The problem is that pjsip unable to find class name PjCamera from JVM. I have this debug log: > ............. > I/pjsua (16412): 22:52:38.159 android_jni_de ..Android JNI sound library initialized > I/pjsua (16412): 22:52:38.162 pjlib ..select() I/O Queue created (0xb861b48c) > I/pjsua (16412): 22:52:38.182 pjsua_vid.c ..Initializing video subsystem.. > I/pjsua (16412): 22:52:38.183 openh264.cpp ...OpenH264 codec initialized > I/pjsua (16412): 22:52:38.183 opengl_dev.c ...OpenGL device initialized > I/pjsua (16412): 22:52:38.184 android_dev.c ...[JNI] Unable to find class 'PjCamera' > ............. > > And when I'm trying to create preview video program crashes. (I'm not sure that I'm creating video preview with correct device and maybe this is another error). > My code: >     vidPrev = new VideoPreview(PJMEDIA_VID_DEFAULT_RENDER_DEV); >     VideoPreviewOpParam param; >     vidPrev->start(param); // <-- crash here >     VideoWindow prev = vidPrev->getVideoWindow(); > > Crash log: > I/pjsua (16412): 22:52:39.511 pjsua_vid.c !Starting preview for cap_dev=-2, show=1 > I/pjsua (16412): 22:52:39.511 pjsua_vid.c .Creating video window: type=preview, cap_id=-2, rend_id=-2 > I/pjsua (16412): 22:52:39.511 pjsua_vid.c ..Window 0: destroying.. > I/pjsua (16412): 22:52:39.511 media.cpp pjsua_vid_preview_start(devId, &prm) error: Invalid video device (PJMEDIA_EVID_INVDEV) (status=520004) [../src/pjsua2/media.cpp:1185] > F/libc (16412): Fatal signal 6 (SIGABRT), code -6 in tid 16638 (QtThread) > I/DEBUG ( 288): pid: 16412, tid: 16638, name: QtThread >>> org.qtproject.example <<< > D/InputDispatcher( 984): Focus left window: 16412 > E/lowmemorykiller( 255): Error writing /proc/16412/oom_score_adj; errno=22 > I/Zygote ( 317): Process 16412 exited due to signal (6) > I/ActivityManager( 984): Process org.qtproject.example (pid 16412)(adj 1) has died.(63,298) > > Does anybody faced with such error before? > > -- > С уважением, > Александр Анцев > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- С уважением, Александр Анцев
Анцев Александр
Sun, Aug 21, 2016 11:32 AM

Hello!

Next problem I'm faced with is creating video preview failed with error PJMEDIA_EVID_BADFORMAT, because my cam using NV21/1920x1080 by default:
I/pjsua  (17818): 02:23:22.910    vid_port.c  ..Opening device Front camera [Android] for capture: format=NV21, size=1920x1080 @15:1 fps
I/pjsua  (17818): 02:23:22.910    vid_port.c  ..Closing Front camera..
I/pjsua  (17818): 02:23:22.910    pjsua_vid.c  ..Window 0: destroying..
I/pjsua  (17818): 02:23:22.910      media.cpp  pjsua_vid_preview_start(devId, &prm) error: Bad or invalid video device format

I tried to specify supported format:

//front cam has index == 1
int camIdx = 1;

//checking formats untill getting YV12/640x480
VideoDevInfo devInfo = ep->vidDevManager().getDevInfo(camIdx);
MediaFormatVector fmtVec = devInfo.fmt;
MediaFormatVideo *fmt;
for (int i = 0; i < fmtVec.size(); i++) {
    fmt = (MediaFormatVideo*)fmtVec.at(i);
    if (fmt->height == 480 && fmt->width == 640 && fmt->id == PJMEDIA_FORMAT_I420)
        break;
}

//creating VideoPreview
vidPrev = new VideoPreview(camIdx);

//setting format
VideoPreviewOpParam param;
param.format = *fmt;

//starting VideoPreview
vidPrev->start(param);

But I was surprised when video preview ignored my settings and continued using  NV21/1920x1080. After reading pjsip's sources I found out that pjsua2 Media API is incomplete, VideoPreviewOpParam converts into pjsua_vid_preview_param with error and pjsua_vid_preview_param ignored later.
I rewrited Media API (diff attached to this e-mail)  and was able to create preview:
I/pjsua  ( 7501): 02:43:33.566    vid_port.c  ..Opening device OpenGL renderer [OpenGL] for render: format=I420, size=640x480 @15:1 fps
I/pjsua  ( 7501): 02:43:33.566 android_opengl  ..Re-initializing OpenGL due to format change
I/pjsua  ( 7501): 02:43:33.566 android_opengl  ..Android OpenGL ES renderer successfully created
I/pjsua  ( 7501): 02:43:33.566    vid_port.c  ..Device OpenGL renderer [OpenGL] opened: format=I420, size=640x480 @15:1 fps
I/pjsua  ( 7501): 02:43:33.566    pjsua_vid.c  ..preview window id 0 created for cap_dev=1 rend_dev=-2
I/pjsua  ( 7501): 02:43:33.566    pjsua_vid.c  ..Window 0 created
I/pjsua  ( 7501): 02:43:33.566 android_opengl  .Starting Android opengl stream
I/pjsua  ( 7501): 02:43:33.566  android_dev.c  .Starting Android camera stream

The current problem - I don't see preview video on screen, VideoWindow getInfo().isNative says that it is not native window, but when I'm tring setPos() or Show() I'm getting this error:
I/pjsua  (12855): 03:02:48.615      media.cpp  pjsua_vid_win_set_show(winId, show) error: Invalid or unsupported video capability (PJMEDIA_EVID_INVCAP) (status=520008) [../src/pjsua2/media.cpp:1071]

What I'm doing wrong?

16.08.2016, 22:08, "Анцев Александр" a.antsev@yandex.ru:

Hello!

The problem with finding PjCamera class is solved.
PjClass is searched in "pjproject-2.5.5\pjmedia\src\pjmedia-videodev\android_dev.c" file in jni_init_ids() function. This function is normally called in thread which loaded this lib, so this function have access to class loader and everything is working fine, But when you starting use Qt for GUI, QApplication is started in its own thread and the system class loader is available from this context, so jni_init_ids() can't find PjCamera with FindClass.
The simplest solution is find PjCamera in JNI_OnLoad() function, defined in "pjproject-2.5.5\pjlib\src\pj\os_core_unix.c" and cache the results. This function is called when library is loaded and class loader is available.
To do so the two things should be done:

  1. Move some code from jni_init_ids() to JNI_OnLoad().
  2. use __android_log_print instead of PJ_LOG macro (because log facility is not inited at this point).

I've made a patch (git diff), hope it will be usefull.

15.08.2016, 14:26, "Анцев Александр" a.antsev@yandex.ru:

 Hello!

 I'm trying to build an app for android with GUI written on Qt. Now I'm working on video preview. What i've done already:
 1. Build OpenH264 lib.
 2. Build pjsip with video support.
 3. Copy PjCamera.java and PjCameraInfo.java into my app folder (src\org\pjsip).

 The problem is that pjsip unable to find class name PjCamera from JVM. I have this debug log:
 .............
 I/pjsua (16412): 22:52:38.159 android_jni_de ..Android JNI sound library initialized
 I/pjsua (16412): 22:52:38.162 pjlib ..select() I/O Queue created (0xb861b48c)
 I/pjsua (16412): 22:52:38.182 pjsua_vid.c ..Initializing video subsystem..
 I/pjsua (16412): 22:52:38.183 openh264.cpp ...OpenH264 codec initialized
 I/pjsua (16412): 22:52:38.183 opengl_dev.c ...OpenGL device initialized
 I/pjsua (16412): 22:52:38.184 android_dev.c ...[JNI] Unable to find class 'PjCamera'
 .............

 And when I'm trying to create preview video program crashes. (I'm not sure that I'm creating video preview with correct device and maybe this is another error).
 My code:
     vidPrev = new VideoPreview(PJMEDIA_VID_DEFAULT_RENDER_DEV);
     VideoPreviewOpParam param;
     vidPrev->start(param); // <-- crash here
     VideoWindow prev = vidPrev->getVideoWindow();

 Crash log:
 I/pjsua (16412): 22:52:39.511 pjsua_vid.c !Starting preview for cap_dev=-2, show=1
 I/pjsua (16412): 22:52:39.511 pjsua_vid.c .Creating video window: type=preview, cap_id=-2, rend_id=-2
 I/pjsua (16412): 22:52:39.511 pjsua_vid.c ..Window 0: destroying..
 I/pjsua (16412): 22:52:39.511 media.cpp pjsua_vid_preview_start(devId, &prm) error: Invalid video device (PJMEDIA_EVID_INVDEV) (status=520004) [../src/pjsua2/media.cpp:1185]
 F/libc (16412): Fatal signal 6 (SIGABRT), code -6 in tid 16638 (QtThread)
 I/DEBUG ( 288): pid: 16412, tid: 16638, name: QtThread >>> org.qtproject.example <<<
 D/InputDispatcher( 984): Focus left window: 16412
 E/lowmemorykiller( 255): Error writing /proc/16412/oom_score_adj; errno=22
 I/Zygote ( 317): Process 16412 exited due to signal (6)
 I/ActivityManager( 984): Process org.qtproject.example (pid 16412)(adj 1) has died.(63,298)

 Does anybody faced with such error before?

 --
 С уважением,
 Александр Анцев

 _______________________________________________
 Visit our blog: http://blog.pjsip.org

 pjsip mailing list
 pjsip@lists.pjsip.org
 http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
С уважением,
Александр Анцев
,


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
С уважением,
Александр Анцев

Hello! Next problem I'm faced with is creating video preview failed with error PJMEDIA_EVID_BADFORMAT, because my cam using NV21/1920x1080 by default: I/pjsua (17818): 02:23:22.910 vid_port.c ..Opening device Front camera [Android] for capture: format=NV21, size=1920x1080 @15:1 fps I/pjsua (17818): 02:23:22.910 vid_port.c ..Closing Front camera.. I/pjsua (17818): 02:23:22.910 pjsua_vid.c ..Window 0: destroying.. I/pjsua (17818): 02:23:22.910 media.cpp pjsua_vid_preview_start(devId, &prm) error: Bad or invalid video device format I tried to specify supported format: //front cam has index == 1 int camIdx = 1; //checking formats untill getting YV12/640x480 VideoDevInfo devInfo = ep->vidDevManager().getDevInfo(camIdx); MediaFormatVector fmtVec = devInfo.fmt; MediaFormatVideo *fmt; for (int i = 0; i < fmtVec.size(); i++) { fmt = (MediaFormatVideo*)fmtVec.at(i); if (fmt->height == 480 && fmt->width == 640 && fmt->id == PJMEDIA_FORMAT_I420) break; } //creating VideoPreview vidPrev = new VideoPreview(camIdx); //setting format VideoPreviewOpParam param; param.format = *fmt; //starting VideoPreview vidPrev->start(param); But I was surprised when video preview ignored my settings and continued using NV21/1920x1080. After reading pjsip's sources I found out that pjsua2 Media API is incomplete, VideoPreviewOpParam converts into pjsua_vid_preview_param with error and pjsua_vid_preview_param ignored later. I rewrited Media API (diff attached to this e-mail) and was able to create preview: I/pjsua ( 7501): 02:43:33.566 vid_port.c ..Opening device OpenGL renderer [OpenGL] for render: format=I420, size=640x480 @15:1 fps I/pjsua ( 7501): 02:43:33.566 android_opengl ..Re-initializing OpenGL due to format change I/pjsua ( 7501): 02:43:33.566 android_opengl ..Android OpenGL ES renderer successfully created I/pjsua ( 7501): 02:43:33.566 vid_port.c ..Device OpenGL renderer [OpenGL] opened: format=I420, size=640x480 @15:1 fps I/pjsua ( 7501): 02:43:33.566 pjsua_vid.c ..preview window id 0 created for cap_dev=1 rend_dev=-2 I/pjsua ( 7501): 02:43:33.566 pjsua_vid.c ..Window 0 created I/pjsua ( 7501): 02:43:33.566 android_opengl .Starting Android opengl stream I/pjsua ( 7501): 02:43:33.566 android_dev.c .Starting Android camera stream The current problem - I don't see preview video on screen, VideoWindow getInfo().isNative says that it is not native window, but when I'm tring setPos() or Show() I'm getting this error: I/pjsua (12855): 03:02:48.615 media.cpp pjsua_vid_win_set_show(winId, show) error: Invalid or unsupported video capability (PJMEDIA_EVID_INVCAP) (status=520008) [../src/pjsua2/media.cpp:1071] What I'm doing wrong? 16.08.2016, 22:08, "Анцев Александр" <a.antsev@yandex.ru>: > Hello! > > The problem with finding PjCamera class is solved. > PjClass is searched in "pjproject-2.5.5\pjmedia\src\pjmedia-videodev\android_dev.c" file in jni_init_ids() function. This function is normally called in thread which loaded this lib, so this function have access to class loader and everything is working fine, But when you starting use Qt for GUI, QApplication is started in its own thread and the system class loader is available from this context, so jni_init_ids() can't find PjCamera with FindClass. > The simplest solution is find PjCamera in JNI_OnLoad() function, defined in "pjproject-2.5.5\pjlib\src\pj\os_core_unix.c" and cache the results. This function is called when library is loaded and class loader is available. > To do so the two things should be done: > 1. Move some code from jni_init_ids() to JNI_OnLoad(). > 2. use __android_log_print instead of PJ_LOG macro (because log facility is not inited at this point). > > I've made a patch (git diff), hope it will be usefull. > > 15.08.2016, 14:26, "Анцев Александр" <a.antsev@yandex.ru>: >>  Hello! >> >>  I'm trying to build an app for android with GUI written on Qt. Now I'm working on video preview. What i've done already: >>  1. Build OpenH264 lib. >>  2. Build pjsip with video support. >>  3. Copy PjCamera.java and PjCameraInfo.java into my app folder (src\org\pjsip\). >> >>  The problem is that pjsip unable to find class name PjCamera from JVM. I have this debug log: >>  ............. >>  I/pjsua (16412): 22:52:38.159 android_jni_de ..Android JNI sound library initialized >>  I/pjsua (16412): 22:52:38.162 pjlib ..select() I/O Queue created (0xb861b48c) >>  I/pjsua (16412): 22:52:38.182 pjsua_vid.c ..Initializing video subsystem.. >>  I/pjsua (16412): 22:52:38.183 openh264.cpp ...OpenH264 codec initialized >>  I/pjsua (16412): 22:52:38.183 opengl_dev.c ...OpenGL device initialized >>  I/pjsua (16412): 22:52:38.184 android_dev.c ...[JNI] Unable to find class 'PjCamera' >>  ............. >> >>  And when I'm trying to create preview video program crashes. (I'm not sure that I'm creating video preview with correct device and maybe this is another error). >>  My code: >>      vidPrev = new VideoPreview(PJMEDIA_VID_DEFAULT_RENDER_DEV); >>      VideoPreviewOpParam param; >>      vidPrev->start(param); // <-- crash here >>      VideoWindow prev = vidPrev->getVideoWindow(); >> >>  Crash log: >>  I/pjsua (16412): 22:52:39.511 pjsua_vid.c !Starting preview for cap_dev=-2, show=1 >>  I/pjsua (16412): 22:52:39.511 pjsua_vid.c .Creating video window: type=preview, cap_id=-2, rend_id=-2 >>  I/pjsua (16412): 22:52:39.511 pjsua_vid.c ..Window 0: destroying.. >>  I/pjsua (16412): 22:52:39.511 media.cpp pjsua_vid_preview_start(devId, &prm) error: Invalid video device (PJMEDIA_EVID_INVDEV) (status=520004) [../src/pjsua2/media.cpp:1185] >>  F/libc (16412): Fatal signal 6 (SIGABRT), code -6 in tid 16638 (QtThread) >>  I/DEBUG ( 288): pid: 16412, tid: 16638, name: QtThread >>> org.qtproject.example <<< >>  D/InputDispatcher( 984): Focus left window: 16412 >>  E/lowmemorykiller( 255): Error writing /proc/16412/oom_score_adj; errno=22 >>  I/Zygote ( 317): Process 16412 exited due to signal (6) >>  I/ActivityManager( 984): Process org.qtproject.example (pid 16412)(adj 1) has died.(63,298) >> >>  Does anybody faced with such error before? >> >>  -- >>  С уважением, >>  Александр Анцев >> >>  _______________________________________________ >>  Visit our blog: http://blog.pjsip.org >> >>  pjsip mailing list >>  pjsip@lists.pjsip.org >>  http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- > С уважением, > Александр Анцев > , > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- С уважением, Александр Анцев