-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DVR #68
base: dev
Are you sure you want to change the base?
DVR #68
Conversation
# Conflicts: # app/src/main/java/com/fpvout/digiview/MainActivity.java # app/src/main/java/com/fpvout/digiview/PerformancePreset.java # app/src/main/java/com/fpvout/digiview/VideoReaderExoplayer.java # app/src/main/java/usb/AndroidUSBOutputStream.java
# Conflicts: # app/build.gradle # app/src/main/java/com/fpvout/digiview/InputStreamDataSource.java # app/src/main/java/com/fpvout/digiview/MainActivity.java # app/src/main/java/com/fpvout/digiview/UsbMaskConnection.java # app/src/main/java/com/fpvout/digiview/VideoReaderExoplayer.java # app/src/main/java/usb/AndroidUSBInputStream.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments on how we could better integrate this :)
Great job !
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
|
||
<application | ||
android:allowBackup="false" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:largeHeap="true" | ||
android:requestLegacyExternalStorage="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be best to use scoped storage and shared directories :
https://developer.android.com/training/data-storage/shared/media
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mhh i know bad habit to use the old implementation ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for backwards compatibility I leave it as it is. we can change it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better change it before a release/merge: WRITE_EXTERNAL_STORAGE no longer provides write access when targeting Android 11 - even with 'android:requestLegacyExternalStorage'. Sdk level 11+ is required for updates starting November 2021. This could delay feature/bugfix rollouts until the dvr is reworked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok good to know! i will update that
app/src/main/java/com/fpvout/digiview/InputStreamDataSource.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/fpvout/digiview/VideoReaderExoplayer.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/fpvout/digiview/helpers/StreamDumper.java
Outdated
Show resolved
Hide resolved
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
|
||
<application | ||
android:allowBackup="false" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:largeHeap="true" | ||
android:requestLegacyExternalStorage="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better change it before a release/merge: WRITE_EXTERNAL_STORAGE no longer provides write access when targeting Android 11 - even with 'android:requestLegacyExternalStorage'. Sdk level 11+ is required for updates starting November 2021. This could delay feature/bugfix rollouts until the dvr is reworked.
private boolean zoomedIn; | ||
private final Context context; | ||
private PerformancePreset performancePreset = PerformancePreset.getPreset(PerformancePreset.PresetType.DEFAULT); | ||
static final String VideoZoomedIn = "VideoZoomedIn"; | ||
private final SharedPreferences sharedPreferences; | ||
private boolean streaming = false; | ||
|
||
private VideoPlayingListener videoPlayingListener = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listeners could be combined into one interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I kept them seperated so you can subscribe to an event in one place and to the other in another place (as you need to overide both methods when you implement it in a combined way )
Or maybe I just wasn't able to do it :p
videoReaderEventMessage.obj = eventCode; | ||
videoReaderEventListener.sendMessage(videoReaderEventMessage); | ||
} | ||
public interface VideoPlayingListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interfaces should go into their own files and might be combined.
@@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this file will mess with developers with a different environment, please consider removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry was a bit lazy and forget it. Normally android studio fixes itself ;-) We should add this file to the ignore list ;-)
@@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this file will mess with developers with a different environment, please consider removing it.
It is likely to be overwritten by a gradle build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry was a bit lazy and forget it. Normally android studio fixes itself ;-) We should add this file to the ignore list ;-)
streamDumper = new StreamDumper(activity, defaultFolder); | ||
} | ||
|
||
public static DVR getInstance(Activity context, boolean recordAmbientAudio, Handler updateAfterRecord, UsbMaskConnection connection){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the context in a singleton might lead to a memory leak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will change it . The thing is i wanted to make sure only one instance is used in the whole app.
File file = files[i]; | ||
if (file.getAbsolutePath().endsWith(".h264")) { | ||
File ambientAudio = new File(file.getAbsolutePath().replace(".h264", ".aac")); | ||
if (ambientAudio.exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider muxing even if the ambient audio is not existing, to at least have a useable video file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great idea !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can do that. No Problem 10 Mins of awesome sound ... you never know whats beeing recorded :D
# Conflicts: # app/build.gradle # app/src/main/java/com/fpvout/digiview/H264Extractor.java # app/src/main/java/com/fpvout/digiview/InputStreamBufferedDataSource.java # app/src/main/java/com/fpvout/digiview/InputStreamDataSource.java # app/src/main/java/com/fpvout/digiview/MainActivity.java # app/src/main/java/com/fpvout/digiview/PerformancePreset.java # app/src/main/java/com/fpvout/digiview/VideoReaderExoplayer.java # app/src/main/java/usb/AndroidUSBInputStream.java
Hey, I'm working on merging this with dev branch.
I will add more to the list if I encounter other things in the way. |
@jlucidar Any progress on merging this? I'm interested in using it. There are other apps similarly that have DVR, but this one has the best video latency. Also, is there a way to not grant microphone privilege and still record? I did a quick pull and rebuild with commenting out the line I also am getting an issue where it crashes on stopping the recording. I'm unable to have adb and the goggles connected at the same time to help debug. |
Hi @robertsmd, Haven't got the time to work on this project for a long time.
|
I had not had the time to complete the implementation as @jlucidar said it there are some issues that needs to be resolved first. |
this is a first version of a dvr recording with button and ambient audio. this will be updated soon