8000 update · Android-for-Python/Camera4Kivy@481f13d · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit 481f13d

Browse files
committed
update
1 parent e466e58 commit 481f13d

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ Camera4Kivy
7575
* [Picamera](#picamera)
7676
* [AVFoundation](#avfoundation)
7777
- [Known Behavior](#known-behavior)
78-
* [Behavior: Android .mp4 Orientation](#behavior--android-mp4-orientation)
79-
* [Behavior: Android .jpg Orientation.](#behavior--android-jpg-orientation)
80-
* [Behavior: Android armeabi-v7a build installed on an arm64-v8a device](#behavior--android-armeabi-v7a-build-installed-on-an-arm64-v8a-device)
81-
* [Behavior: Android "No supported surface combination"](#behavior--android--no-supported-surface-combination-)
78+
* [Behavior: Android .mp4 Orientation](#behavior-android-mp4-orientation)
79+
* [Behavior: Android .jpg Orientation.](#behavior-android-jpg-orientation)
80+
* [Behavior: Android armeabi-v7a build installed on an arm64-v8a device](#behavior-android-armeabi-v7a-build-installed-on-an-arm64-v8a-device)
81+
* [Behavior: Android "No supported surface combination"](#behavior-android--no-supported-surface-combination-)
8282

8383
## Overview
8484

@@ -244,7 +244,11 @@ Object classification. Illustrates using a large Tensorflow Lite model, and writ
244244

245245
## Preview Widget
246246

247-
An app can have multiple `Preview` widgets, but only one can be connected to the physical camera unit at a time. A natural way to implement this is to add a preview widget to a screen's contents, then connect to the camera unit `on_enter` and disconnect `on_pre_leave`. Or if using a ModalView, Popup, or MDDialog use `on_open` and `on_pre_dismiss`. The C4K-Photo-Example illustrates this, the other examples simply connect the camera after `on_start()` and disconnect `on_stop()`.
247+
An app can have multiple `Preview` widgets instantiated, but only one can be connected to the physical camera unit at a time. A natural way to implement this is to add a Preview widget to a screen's contents, then connect to the camera unit `on_enter` and disconnect `on_pre_leave`. Or if using a ModalView, Popup, or MDDialog use `on_open` and `on_pre_dismiss`. The C4K-Photo-Example illustrates the screen case.
248+
249+
The other examples simply connect the camera **after** `on_start()` and disconnect `on_stop()`. The **after** `on_start` is required on Android; both for reliable camera function, and so that the camera is only connected after CAMERA permission has been granted.
250+
251+
There is one special case. For the **first** screen, Kivy calls `on_enter` before `on_start`. This violates the requirements described in the previous paragraph. For the **first screen only**, connect the camera after `on_start` and after CAMERA permission has been granted, and not from `on_enter`.
248252

249253
### Preview Widget Properties
250254

index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Camera4Kivy
7575
* [Picamera](https://github.com/Android-for-Python/Camera4Kivy#picamera)
7676
* [AVFoundation](https://github.com/Android-for-Python/Camera4Kivy#avfoundation)
7777
- [Known Behavior](https://github.com/Android-for-Python/Camera4Kivy#known-behavior)
78-
* [Behavior: Android .mp4 Orientation](https://github.com/Android-for-Python/Camera4Kivy#behavior--android-mp4-orientation)
79-
* [Behavior: Android .jpg Orientation.](https://github.com/Android-for-Python/Camera4Kivy#behavior--android-jpg-orientation)
80-
* [Behavior: Android armeabi-v7a build installed on an arm64-v8a device](https://github.com/Android-for-Python/Camera4Kivy#behavior--android-armeabi-v7a-build-installed-on-an-arm64-v8a-device)
81-
* [Behavior: Android "No supported surface combination"](https://github.com/Android-for-Python/Camera4Kivy#behavior--android--no-supported-surface-combination-)
78+
* [Behavior: Android .mp4 Orientation](https://github.com/Android-for-Python/Camera4Kivy#behavior-android-mp4-orientation)
79+
* [Behavior: Android .jpg Orientation.](https://github.com/Android-for-Python/Camera4Kivy#behavior-android-jpg-orientation)
80+
* [Behavior: Android armeabi-v7a build installed on an arm64-v8a device](https://github.com/Android-for-Python/Camera4Kivy#behavior-android-armeabi-v7a-build-installed-on-an-arm64-v8a-device)
81+
* [Behavior: Android "No supported surface combination"](https://github.com/Android-for-Python/Camera4Kivy#behavior-android--no-supported-surface-combination-)

0 commit comments

Comments
 (0)
0