Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:

- name: Set up Android SDK
uses: android-actions/setup-android@v4
with:
# The action's default is "tools platform-tools", but the obsolete "tools"
# package has been removed from Google's SDK repository and now fails with
# "Failed to find package 'tools'". Gradle/AGP fetch what else they need.
packages: platform-tools

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci-pull-request-merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:

- name: Set up Android SDK
uses: android-actions/setup-android@v4
with:
# The action's default is "tools platform-tools", but the obsolete "tools"
# package has been removed from Google's SDK repository and now fails with
# "Failed to find package 'tools'". Gradle/AGP fetch what else they need.
packages: platform-tools

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
Expand Down
1 change: 1 addition & 0 deletions Consolation/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.hardware.usb.UsbDevice
import android.os.Build
import android.os.SystemClock
import android.media.AudioAttributes
import android.media.AudioDeviceInfo
Expand Down Expand Up @@ -109,7 +110,13 @@ class UsbCaptureAudioLoop(

val inputCapture: AudioRecord? = try {
AudioRecord.Builder()
.setContext(appContext)
.apply {
// setContext() is API 31+. Below that AudioRecord uses the process context,
// which is what appContext is anyway, so there is nothing to substitute.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
setContext(appContext)
}
}
.setAudioSource(MediaRecorder.AudioSource.UNPROCESSED)
.setAudioFormat(
AudioFormat.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ interface UsbVideoPreviewBackend : PreviewRenderer {
fun setRotation(degrees: Int)
fun setFlip(horizontal: Boolean, vertical: Boolean)

/**
* Full preview transform for backends that render into a SurfaceView, where
* the View system cannot rotate or mirror the content: rotation in degrees,
* mirror flags, zoom scale, pan in NDC units (-1..1 across the surface), and the
* fit-to-screen content box as a fraction of the surface ([fitScaleX], [fitScaleY] <= 1).
*/
fun setPreviewTransform(
rotationDegrees: Int,
flipHorizontal: Boolean,
flipVertical: Boolean,
scale: Float,
panXNdc: Float,
panYNdc: Float,
fitScaleX: Float,
fitScaleY: Float,
) = Unit

fun dispose()

/**
Expand Down
Loading
Loading