Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
msandroidcamera2
Commits
6f3a944c
Commit
6f3a944c
authored
Dec 04, 2019
by
Sylvain Berfini
🎩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed invalid context for camera state callbacks
parent
6a406c83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
android-camera2-capture.cpp
android-camera2-capture.cpp
+6
-3
No files found.
android-camera2-capture.cpp
View file @
6f3a944c
...
...
@@ -313,8 +313,9 @@ static void android_camera2_capture_destroy_preview(AndroidCamera2Context *d) {
static
void
android_camera2_capture_open_camera
(
AndroidCamera2Context
*
d
)
{
ms_message
(
"[Camera2 Capture] Opening camera"
);
d
->
deviceStateCallbacks
.
context
=
d
;
d
->
deviceStateCallbacks
.
onDisconnected
=
android_camera2_capture_device_on_disconnected
;
d
->
deviceStateCallbacks
.
onError
=
android_camera2_capture_device_on_error
;
d
->
deviceStateCallbacks
.
onError
=
android_camera2_capture_device_on_error
;
if
(
!
d
->
device
)
{
ms_error
(
"[Camera2 Capture] Can't open camera, no device selected"
);
...
...
@@ -769,14 +770,14 @@ static int android_camera2_capture_set_surface_texture(MSFilter *f, void *arg) {
ms_filter_lock
(
f
);
ms_message
(
"[Camera2 Capture] New native window
id
ptr is %p, current one is %p"
,
nativeWindowId
,
d
->
nativeWindowId
);
ms_message
(
"[Camera2 Capture] New native window ptr is %p, current one is %p"
,
nativeWindowId
,
d
->
nativeWindowId
);
if
(
id
==
0
)
{
if
(
d
->
nativeWindowId
)
{
android_camera2_capture_stop
(
d
);
env
->
DeleteGlobalRef
(
d
->
nativeWindowId
);
d
->
nativeWindowId
=
nullptr
;
}
}
else
if
(
nativeWindowId
!=
d
->
nativeWindowId
)
{
}
else
if
(
!
env
->
IsSameObject
(
d
->
nativeWindowId
,
nativeWindowId
)
)
{
if
(
d
->
nativeWindowId
)
{
android_camera2_capture_stop
(
d
);
env
->
DeleteGlobalRef
(
d
->
nativeWindowId
);
...
...
@@ -790,6 +791,8 @@ static int android_camera2_capture_set_surface_texture(MSFilter *f, void *arg) {
if
(
d
->
previewSize
.
width
!=
0
&&
d
->
previewSize
.
height
!=
0
)
{
ms_filter_notify
(
f
,
MS_CAMERA_PREVIEW_SIZE_CHANGED
,
&
d
->
previewSize
);
}
}
else
{
ms_message
(
"[Camera2 Capture] New native window is the same as the current one, skipping..."
);
}
ms_filter_unlock
(
f
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment