Skip to content
Open
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
68 changes: 36 additions & 32 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin)
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin)
}

android {
namespace = "com.pedro.streamer"
compileSdk = 36
namespace = "com.pedro.streamer"
compileSdk = 35

defaultConfig {
applicationId = "com.pedro.streamer"
minSdk = 16
targetSdk = 36
versionCode = project.version.toString().replace(".", "").toInt()
versionName = project.version.toString()
multiDexEnabled = true
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
defaultConfig {
applicationId = "com.pedro.streamer"
minSdk = 21
targetSdk = 35
versionCode = libs.versions.versionCode.get().toInt()
versionName = libs.versions.versionName.get()
multiDexEnabled = true
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
buildConfig = true
viewBinding = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
buildFeatures {
buildConfig = true
}
}

dependencies {
implementation(project(":library"))
implementation(project(":extra-sources"))
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.multidex)
implementation(project(":library"))
implementation(project(":extra-sources"))
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.multidex)
implementation(libs.firebase.crashlytics.buildtools)
implementation(libs.eventbus)
implementation(libs.recyclerview)
}
158 changes: 95 additions & 63 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,77 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />

<!--needed by background Rtp service to keep service alive-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!--Optional for play store-->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<!-- Android 14 background compatibility-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<!-- This is only to allow compile extra-sources modules in app with min version 16. Never do it-->
<uses-sdk tools:overrideLibrary="
com.pedro.extrasources,
com.serenegiant.uvccamera,
androidx.core.ktx,androidx.core,
androidx.annotation.experimental,
androidx.media3.*,
androidx.camera.*" />
<!--needed by background Rtp service to keep service alive-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!--Optional for play store-->
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<!-- Android 14 background compatibility-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

<application
android:name=".App"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name="com.pedro.streamer.MainActivity"
<!-- This is only to allow compile extra-sources modules in app with min version 16. Never do it-->
<uses-sdk tools:overrideLibrary="
com.pedro.extrasources,
com.serenegiant.uvccamera,
androidx.core.ktx,androidx.core,
androidx.annotation.experimental,
androidx.media3.*,
androidx.camera.*" />

<application
android:name=".App"
android:allowBackup="true"
android:icon="@drawable/hohem_icon"
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.MAIN"/>
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity
android:name="com.pedro.streamer.MainActivity"
android:exported="true"
android:label="@string/app_name">
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.VIEW"/>-->
<!-- <action android:name="android.intent.action.MAIN"/>-->

<!-- <category android:name="android.intent.category.LAUNCHER"/>-->
<!-- </intent-filter>-->
</activity>

<activity
android:name="com.pedro.streamer.oldapi.OldApiActivity"
android:label="@string/old_api" />

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.pedro.streamer.file.FromFileActivity"
android:label="@string/from_file" />

<activity
android:name="com.pedro.streamer.oldapi.OldApiActivity"
android:label="@string/old_api"
/>
<activity
android:name="com.pedro.streamer.screen.ScreenActivity"
android:label="@string/display" />

<activity
android:name="com.pedro.streamer.file.FromFileActivity"
android:label="@string/from_file"
/>
<!-- <activity
android:name="com.pedro.streamer.rotation.RotationActivity"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:exported="true"
android:label="@string/hohem_live"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />

<activity
android:name="com.pedro.streamer.screen.ScreenActivity"
android:label="@string/display"
/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>-->

<activity android:name="com.pedro.streamer.rotation.RotationActivity"
android:label="@string/rotation_rtmp"
android:screenOrientation="fullSensor"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
tools:ignore="DiscouragedApi" />
<activity
android:name="com.pedro.streamer.rotation.CameraActivity"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:exported="true"
android:label="@string/camera_live"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />

<service android:name="com.pedro.streamer.screen.ScreenService"
android:foregroundServiceType="mediaProjection|microphone|camera"
/>
</application>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<service
android:name="com.pedro.streamer.screen.ScreenService"
android:foregroundServiceType="mediaProjection|microphone|camera" />
</application>
</manifest>
Binary file added app/src/main/ic_hohem-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/java/com/pedro/streamer/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class MainActivity : AppCompatActivity() {
activities.add(
ActivityLink(
Intent(this, RotationActivity::class.java),
getString(R.string.rotation_rtmp), VERSION_CODES.LOLLIPOP
getString(R.string.camera_live), VERSION_CODES.LOLLIPOP
)
)
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/pedro/streamer/file/FromFileActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class FromFileActivity : AppCompatActivity(), ConnectChecker,
bRecord.setOnClickListener {
if (genericFromFile.isRecording) {
genericFromFile.stopRecord()
bRecord.setImageResource(R.drawable.record_icon)
bRecord.setImageResource(R.drawable.ic_record_start)
PathUtils.updateGallery(this, recordPath)
if (!genericFromFile.isStreaming) ScreenOrientation.unlockScreen(this)
} else if (genericFromFile.isStreaming || prepare()) {
Expand All @@ -135,10 +135,10 @@ class FromFileActivity : AppCompatActivity(), ConnectChecker,
if (!folder.exists()) folder.mkdir()
val sdf = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault())
recordPath = "${folder.absolutePath}/${sdf.format(Date())}.mp4"
bRecord.setImageResource(R.drawable.pause_icon)
bRecord.setImageResource(R.drawable.ic_record_pause)
genericFromFile.startRecord(recordPath) { status ->
if (status == RecordController.Status.RECORDING) {
bRecord.setImageResource(R.drawable.stop_icon)
bRecord.setImageResource(R.drawable.ic_record_stop)
}
}
ScreenOrientation.lockScreen(this)
Expand All @@ -165,7 +165,7 @@ class FromFileActivity : AppCompatActivity(), ConnectChecker,
genericFromFile.stopAudioDevice()
if (genericFromFile.isRecording) {
genericFromFile.stopRecord()
bRecord.setImageResource(R.drawable.record_icon)
bRecord.setImageResource(R.drawable.ic_record_start)
}
if (genericFromFile.isStreaming) {
genericFromFile.stopStream()
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/pedro/streamer/oldapi/OldApiActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ class OldApiActivity : AppCompatActivity(), ConnectChecker, TextureView.SurfaceT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
if (genericCamera1.isRecording) {
genericCamera1.stopRecord()
bRecord.setImageResource(R.drawable.record_icon)
bRecord.setImageResource(R.drawable.ic_record_start)
PathUtils.updateGallery(this, recordPath)
if (!genericCamera1.isStreaming) ScreenOrientation.unlockScreen(this)
} else if (genericCamera1.isStreaming || prepare()) {
val folder = PathUtils.getRecordPath()
if (!folder.exists()) folder.mkdir()
val sdf = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault())
recordPath = "${folder.absolutePath}/${sdf.format(Date())}.mp4"
bRecord.setImageResource(R.drawable.pause_icon)
bRecord.setImageResource(R.drawable.ic_record_pause)
genericCamera1.startRecord(recordPath) { status ->
if (status == RecordController.Status.RECORDING) {
bRecord.setImageResource(R.drawable.stop_icon)
bRecord.setImageResource(R.drawable.ic_record_stop)
}
}
ScreenOrientation.lockScreen(this)
Expand Down Expand Up @@ -180,7 +180,7 @@ class OldApiActivity : AppCompatActivity(), ConnectChecker, TextureView.SurfaceT
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && genericCamera1.isRecording) {
genericCamera1.stopRecord()
bRecord.setBackgroundResource(R.drawable.record_icon)
bRecord.setBackgroundResource(R.drawable.ic_record_start)
PathUtils.updateGallery(this, recordPath)
}
if (genericCamera1.isStreaming) {
Expand Down
Loading