From 3c2194940ca57b45b66a6344ad67e9c9f0b861bd Mon Sep 17 00:00:00 2001
From: Dana <Dana_Lee1016@126.com>
Date: 星期四, 29 一月 2026 13:28:18 +0800
Subject: [PATCH] 1.修改水印 usb
---
app/src/main/java/com/safeluck/floatwindow/util/VideoFileUtils.java | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/app/src/main/java/com/safeluck/floatwindow/util/VideoFileUtils.java b/app/src/main/java/com/safeluck/floatwindow/util/VideoFileUtils.java
index d9b0128..9738b2e 100644
--- a/app/src/main/java/com/safeluck/floatwindow/util/VideoFileUtils.java
+++ b/app/src/main/java/com/safeluck/floatwindow/util/VideoFileUtils.java
@@ -67,9 +67,16 @@
* 鐢熸垚瑙嗛鏂囦欢鍚嶏紙鏃跺垎绉�.mp4锛�
* @return 鏂囦欢鍚嶏紝渚嬪锛�143025.mp4
*/
- public static String generateVideoFileName() {
+ public static String generateVideoFileName(int usbCamId) {
SimpleDateFormat timeFormat = new SimpleDateFormat("HHmmss", Locale.getDefault());
- return timeFormat.format(new Date()) + ".mp4";
+ if (usbCamId==2){
+ return timeFormat.format(new Date()) + "_P2.mp4";
+ }else if (usbCamId==1){
+ return timeFormat.format(new Date()) + "_P1.mp4";
+ }else{
+ return timeFormat.format(new Date()) + ".mp4";
+ }
+
}
/**
@@ -78,24 +85,24 @@
* @param tfCardFlag 0-鍐呴儴瀛樺偍锛�1-澶栭儴瀛樺偍
* @return 瀹屾暣鐨勬枃浠惰矾寰�
*/
- public static File getVideoFile(Context context, int tfCardFlag) {
+ public static File getVideoFile(Context context, int tfCardFlag,int usbCameraId) {
File dateDir = getVideoDirectory(context, tfCardFlag);
if (dateDir == null) {
return null;
}
- String fileName = generateVideoFileName();
+ String fileName = generateVideoFileName(usbCameraId);
return new File(dateDir, fileName);
}
/**
- * 鑾峰彇瑙嗛鏂囦欢璺緞瀛楃涓�
+ * 鑾峰彇瑙嗛鏂囦欢璺緞瀛楃涓� 鍙兘鑾峰彇鍒板唴閮ㄧ浉鏈烘枃浠剁殑璺緞
* @param context 涓婁笅鏂�
* @param tfCardFlag 0-鍐呴儴瀛樺偍锛�1-澶栭儴瀛樺偍
* @return 鏂囦欢璺緞瀛楃涓�
*/
public static String getVideoFilePath(Context context, int tfCardFlag) {
- File file = getVideoFile(context, tfCardFlag);
+ File file = getVideoFile(context, tfCardFlag,0);
return file != null ? file.getAbsolutePath() : null;
}
}
--
Gitblit v1.8.0