Files
VoelinClient/android/app/src/main/AndroidManifest.xml
T
selikhovandClaude Opus 5.5 1eabbb4704 Android: cameras in the Stream Studio through Camera2
The studio listed only the test pattern on Android. voelin-media gains a
camera provider hook (like the external screen capture): the app
registers Camera2, whose cameras the studio's picker lists first (front
ones first, with their YUV sizes and highest frame rate), and a camera
source opens one. CameraCapture.kt asks for the CAMERA permission when a
camera is first opened (the source shows why if it is refused), opens
the camera into an ImageReader (YUV_420_888) at the wished size or the
nearest one (16:9 first, 1280x720 by default) with a fitting frame-rate
range, and hands each frame's planes to Rust as direct buffers valid
during the call, with the clockwise turn that makes it upright for the
screen's current rotation (front cameras turn the other way).

Rust takes the planes as YuvPlanes: an upright planar or NV12 picture
goes to the studio's sink as it is, converted straight from the
camera's memory; NV21 (what most cameras give) and turned pictures are
gathered into I420 in a buffer each camera keeps, so a running camera
allocates nothing per frame. Errors after the start (permission refused,
camera taken by another app) go to the source's feed.

Front and back: a camera's default mirroring now follows the camera (a
back camera is not mirrored, what faces the user is), and the source
menu gains Switch camera, which moves a camera source to the next
camera (and its name with it, if it was named after the camera).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:17:13 +03:00

88 lines
4.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Voice, and capturing what the device plays while sharing the screen. -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- Camera sources of the Stream Studio; asked for when one is added. -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
<!--
Launchable apps are visible (Android 11+ package visibility): the
list of apps whose sound a screen share can carry, and their uids.
-->
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
</queries>
<!-- Slint renders with OpenGL ES. -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<!--
allowBackup=false: the database holds the TeamSpeak identity (a
private key) and the Keystore key of the saved passwords cannot be
restored on another device anyway.
-->
<application
android:name=".VoelinApp"
android:allowBackup="false"
android:hasCode="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Voelin">
<!--
The Rust UI runs in this NativeActivity (android.app.lib_name).
Configuration changes (rotation, keyboard, dark mode) are handled
by the native side instead of recreating the activity.
-->
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboard|keyboardHidden|navigation|uiMode|density|fontScale|locale|layoutDirection"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.app.lib_name"
android:value="voelin_android" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!--
"Share to Voelin": text and links go into the composer of
the current chat, files (pictures, videos, documents) are
uploaded to the current channel.
-->
<intent-filter android:label="@string/share_label">
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<!-- Keeps the microphone and the connection while in the background. -->
<service
android:name=".VoiceService"
android:exported="false"
android:foregroundServiceType="microphone" />
<!-- Holds the MediaProjection while the screen is shared. -->
<service
android:name=".ScreenCaptureService"
android:exported="false"
android:foregroundServiceType="mediaProjection" />
</application>
</manifest>