Skip to content

Commit

Permalink
[Android] native window handle
Browse files Browse the repository at this point in the history
1. release native window handle when initializing same surface.
2. remove duplicated expose function.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
  • Loading branch information
jaeyun-jung authored and myungjoo committed Nov 11, 2020
1 parent 3db5433 commit 1ebfc74
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
Expand Up @@ -611,9 +611,9 @@ gst_native_surface_init (JNIEnv * env, jobject thiz, jobject surface)
if (data->native_window == new_native_window) {
nns_logd ("New native window is the same as the previous one %p",
data->native_window);
ANativeWindow_release (new_native_window);
if (data->video_sink) {
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion android/example_app/nnstreamer-multi/jni/nnstreamer-jni.c
Expand Up @@ -609,9 +609,9 @@ gst_native_surface_init (JNIEnv * env, jobject thiz, jobject surface)
if (data->native_window == new_native_window) {
nns_logd ("New native window is the same as the previous one %p",
data->native_window);
ANativeWindow_release (new_native_window);
if (data->video_sink) {
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
}
return;
}
Expand Down
Expand Up @@ -636,10 +636,10 @@ gst_native_surface_init(JNIEnv *env, jobject thiz, jobject surface)
{
nns_logd("New native window is the same as the previous one %p",
data->native_window);
ANativeWindow_release (new_native_window);
if (data->video_sink)
{
gst_video_overlay_expose(GST_VIDEO_OVERLAY(data->video_sink));
gst_video_overlay_expose(GST_VIDEO_OVERLAY(data->video_sink));
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion android/example_app/nnstreamer-ssd/jni/nnstreamer-jni.c
Expand Up @@ -609,9 +609,9 @@ gst_native_surface_init (JNIEnv * env, jobject thiz, jobject surface)
if (data->native_window == new_native_window) {
nns_logd ("New native window is the same as the previous one %p",
data->native_window);
ANativeWindow_release (new_native_window);
if (data->video_sink) {
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
}
return;
}
Expand Down
6 changes: 0 additions & 6 deletions android/example_app/nnstreamer-ssd/res/layout/main.xml
Expand Up @@ -28,9 +28,3 @@
android:layout_centerInParent="true" />

</RelativeLayout>






6 changes: 3 additions & 3 deletions android/multi_device_shared_lib/jni/NNStreamerMultiDevice.c
Expand Up @@ -566,8 +566,8 @@ append_description (gchar * old, gchar * str, const gchar * color)
}

/**
* @brief set description
* 0: Default ( Camera )
* @brief set description
* 0: Default ( Camera )
* 1: Face Detection
* 2: Hand Detection
* 3: Pose Estimation
Expand Down Expand Up @@ -904,9 +904,9 @@ gst_native_surface_init (JNIEnv * env, jobject thiz, jobject surface)
if (data->native_window == new_native_window) {
GST_DEBUG ("New native window is the same as the previous one %p",
data->native_window);
ANativeWindow_release (new_native_window);
if (data->video_sink) {
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
gst_video_overlay_expose (GST_VIDEO_OVERLAY (data->video_sink));
}
return;
} else {
Expand Down

0 comments on commit 1ebfc74

Please sign in to comment.