디스플레이 2번 연결 해제 및 연결 시 죽는 이슈 보강.
근거리 화면 PIP <-> 2번 표시 전환 처리.
This commit is contained in:
parent
54da4aae79
commit
600e6c5007
@ -497,6 +497,21 @@ JNIEXPORT void JNICALL Java_com_tutpro_baresip_plus_BaresipService_baresipStart(
|
||||
|
||||
char start_error[64] = "";
|
||||
|
||||
/* Added by ritoseo */
|
||||
{
|
||||
char kernel_version[256] = {0 };
|
||||
FILE *fp = fopen("/proc/version", "rt");
|
||||
if(fp) {
|
||||
fgets(kernel_version, sizeof(kernel_version), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
if(strstr(kernel_version, "ritoseo-UBT18RK3588RT") == NULL) {
|
||||
exit(100);
|
||||
}
|
||||
}
|
||||
/********************/
|
||||
|
||||
JavaVM *javaVM = g_ctx.javaVM;
|
||||
|
||||
jclass clz = (*env)->GetObjectClass(env, instance);
|
||||
|
@ -75,7 +75,7 @@ static void renderer_destroy(struct vidisp_st *st)
|
||||
|
||||
static void renderer_destroy_self(struct vidisp_st *st)
|
||||
{
|
||||
LOGD("At renderer_destroy_self() on thread %li\n", (long)pthread_self());
|
||||
LOGW("At renderer_destroy_self() on thread %li\n", (long)pthread_self());
|
||||
|
||||
if (st->display != EGL_NO_DISPLAY) {
|
||||
eglMakeCurrent(st->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
@ -872,13 +872,31 @@ int opengles_display_self(
|
||||
err = eglSwapBuffers(st->display, st->surface);
|
||||
if (!err) {
|
||||
LOGW("[SELF] eglSwapBuffers() returned error %s\n", egl_error(eglGetError()));
|
||||
renderer_destroy_self(st);
|
||||
mem_deref(st->vf);
|
||||
|
||||
err = context_initialize_self(st);
|
||||
err = vidframe_alloc(&st->vf, VID_FMT_RGB565, &frame->size);
|
||||
glDeleteTextures(1, &st->texture_id);
|
||||
st->texture_id = 0;
|
||||
int8_t isDisplayActive = 1;
|
||||
if(ANativeWindow_getWidth(st->window) < 0 || ANativeWindow_getHeight(st->window) < 0) {
|
||||
isDisplayActive = 0;
|
||||
//st->window = NULL;
|
||||
}
|
||||
if(isDisplayActive == 0 && window_self && ANativeWindow_getWidth(window_self) > 0 && ANativeWindow_getHeight(window_self) > 0) {
|
||||
isDisplayActive = 1;
|
||||
st->window = window_self;
|
||||
}
|
||||
if(!window_self) {
|
||||
//st->window = NULL;
|
||||
isDisplayActive = 0;
|
||||
}
|
||||
//LOGW("[SELF] Trace [%s:%d] ANativeWindow_getWidth : %d\n", __FILE__, __LINE__, ANativeWindow_getWidth(st->window));
|
||||
if(isDisplayActive) {
|
||||
//st->window = window_self;
|
||||
renderer_destroy_self(st);
|
||||
mem_deref(st->vf);
|
||||
|
||||
err = context_initialize_self(st);
|
||||
err = vidframe_alloc(&st->vf, VID_FMT_RGB565, &frame->size);
|
||||
glDeleteTextures(1, &st->texture_id);
|
||||
st->texture_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
@ -939,14 +957,15 @@ JNIEXPORT void JNICALL Java_com_tutpro_baresip_plus_VideoView_set_1surfaceSelf(
|
||||
w = ANativeWindow_getWidth(window_self);
|
||||
h = ANativeWindow_getHeight(window_self);
|
||||
if ((w != window_width_self) || (h != window_height_self)) {
|
||||
LOGI("[SELF] Got new windowSelf %p with w/h = %d/%d", window_self, w, h);
|
||||
LOGW("[SELF] Got new windowSelf %p with w/h = %d/%d", window_self, w, h);
|
||||
window_width_self = w;
|
||||
window_height_self = h;
|
||||
resize_self = true;
|
||||
}
|
||||
} else {
|
||||
LOGI("[SELF] Releasing windowSelf");
|
||||
LOGW("[SELF] Releasing windowSelf");
|
||||
ANativeWindow_release(window_self);
|
||||
window_self = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -883,14 +883,22 @@ class BaresipService: Service() {
|
||||
|
||||
if(call != null) {
|
||||
if(camera2 == "plugin") {
|
||||
BaresipService.cameraFront = false; // Contents Input
|
||||
call.setVideoSource(false)
|
||||
} else {
|
||||
BaresipService.cameraFront = true; // Camera Input
|
||||
call.setVideoSource(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(BaresipService.cameraFront) {
|
||||
Utils.propertySet("sys.ritosip.media.input", "camera")
|
||||
} else {
|
||||
Utils.propertySet("sys.ritosip.media.input", "content")
|
||||
}
|
||||
|
||||
delay(100) // 1초마다 실행
|
||||
|
||||
val now = LocalDateTime.now()
|
||||
|
@ -227,6 +227,12 @@ object Config {
|
||||
config = "${config}video_size " +
|
||||
"${BaresipService.videoSize.width}x${BaresipService.videoSize.height}\n"
|
||||
|
||||
/* Added by ritoseo */
|
||||
config = "${config}video_bitrate 4000000\n"
|
||||
config = "${config}rtp_video_tos 184\n"
|
||||
config = "${config}rtp_bandwidth 512-4096\n"
|
||||
/********************/
|
||||
|
||||
if (Utils.supportedCameras(ctx).isNotEmpty()) {
|
||||
config = "${config}module avformat.so\n"
|
||||
config = "${config}module selfview.so\n"
|
||||
|
@ -1334,7 +1334,11 @@ class MainActivity : AppCompatActivity() {
|
||||
presentationView?.addView(videoView.standbyView)
|
||||
} catch(e : java.lang.Exception) {
|
||||
}
|
||||
videoView.standbyView.bringToFront()
|
||||
if(isCallExist()) {
|
||||
videoView.surfaceSelfView.bringToFront()
|
||||
} else {
|
||||
videoView.standbyView.bringToFront()
|
||||
}
|
||||
presentation?.show()
|
||||
}
|
||||
}
|
||||
|
@ -95,16 +95,16 @@ class VideoView(val context: Context) {
|
||||
inner class SurfaceHolderCallbackSelf: SurfaceHolder.Callback {
|
||||
|
||||
override fun surfaceCreated(holder: SurfaceHolder) {
|
||||
Log.d(TAG, "SurfaceSelf created")
|
||||
Log.w(TAG, "SurfaceSelf created")
|
||||
}
|
||||
|
||||
override fun surfaceChanged(holder: SurfaceHolder, format: Int, w: Int, h: Int) {
|
||||
Log.d(TAG, "SurfaceSelf changed")
|
||||
Log.w(TAG, "SurfaceSelf changed")
|
||||
set_surfaceSelf(holder.surface)
|
||||
}
|
||||
|
||||
override fun surfaceDestroyed(holder: SurfaceHolder) {
|
||||
Log.d(TAG, "SurfaceSelf destroyed")
|
||||
Log.w(TAG, "SurfaceSelf destroyed")
|
||||
set_surfaceSelf(null)
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_weight="1"
|
||||
android:text="TextView"
|
||||
android:text=""
|
||||
android:textAlignment="viewEnd"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="24sp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user