From cbee28aacfa95544f7eec1a6c3a869392b708ddb Mon Sep 17 00:00:00 2001
From: Dana <Dana_Lee1016@126.com>
Date: 星期二, 23 十二月 2025 17:04:48 +0800
Subject: [PATCH] 1.修改app名字,湖北video 2.修改获取h264文件列表,是否使用tfcard加这个参数
---
app/src/main/java/com/anyun/h264/H264EncodeService.java | 14 ++++++--------
app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java | 4 ++--
app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl | 2 +-
app/src/main/res/values/strings.xml | 2 +-
app/src/main/java/com/anyun/h264/H264EncodeService2.java | 22 ++++++++--------------
app/build.gradle | 2 +-
6 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 9fa237e..b629da8 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -15,7 +15,7 @@
minSdk 21
targetSdk 35
versionCode 1
- versionName "1.0"
+ versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl b/app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl
index 87f6348..fd338a9 100644
--- a/app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl
+++ b/app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl
@@ -32,7 +32,7 @@
* @param endTime 缁撴潫鏃堕棿锛堟牸寮忥細YYMMDDHHmmss锛孊CD缂栫爜鐨�6瀛楄妭瀛楃涓诧級
* @return 璧勬簮鍒楄〃锛堟牴鎹甁T/T 1076-2016琛�23瀹氫箟锛�
*/
- List<ResourceInfo> getResourceList(String startTime, String endTime);
+ List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard);
/**
* 璁剧疆姘村嵃淇℃伅
diff --git a/app/src/main/java/com/anyun/h264/H264EncodeService.java b/app/src/main/java/com/anyun/h264/H264EncodeService.java
index af647b2..a856be1 100644
--- a/app/src/main/java/com/anyun/h264/H264EncodeService.java
+++ b/app/src/main/java/com/anyun/h264/H264EncodeService.java
@@ -38,7 +38,6 @@
private H264FileTransmitter h264FileTransmitter; // H264鏂囦欢浼犺緭鍣�
private String outputFileDirectory; // H264鏂囦欢杈撳嚭鐩綍
private WatermarkInfo currentWatermarkInfo; // 褰撳墠姘村嵃淇℃伅
- private boolean currentUseTFCard = true; // 褰撳墠鏄惁浣跨敤TF鍗¢厤缃�
private static final int H264_FILE_RETENTION_DAYS = 1; // 鍙牴鎹渶姹傝皟鏁翠负3鎴�5澶�
// 澶氳繘绋嬫敮鎸侊細绗簩涓憚鍍忓ご鐨勬湇鍔¤繛鎺�
@@ -64,8 +63,8 @@
}
@Override
- public List<ResourceInfo> getResourceList(String startTime, String endTime) throws RemoteException {
- return H264EncodeService.this.getResourceList(startTime, endTime);
+ public List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard) throws RemoteException {
+ return H264EncodeService.this.getResourceList(startTime, endTime,useTFCard);
}
@Override
@@ -516,8 +515,7 @@
int framerate = config != null && config.framerate > 0 ? config.framerate : DEFAULT_FRAME_RATE;
h264Encoder.setEncoderParams(width, height, framerate, DEFAULT_BITRATE);
- // 淇濆瓨褰撳墠useTFCard閰嶇疆
-// currentUseTFCard = config.useTFCard;
+
// 鑾峰彇杈撳嚭鏂囦欢鐩綍锛堟牴鎹畊seTFCard閰嶇疆锛�
String outputDir = getOutputFileDirectory(config.useTFCard);
@@ -757,8 +755,8 @@
* @param endTime 缁撴潫鏃堕棿锛堟牸寮忥細YYMMDDHHmmss锛�
* @return 璧勬簮鍒楄〃
*/
- private List<ResourceInfo> getResourceList(String startTime, String endTime) {
- Timber.d("getResourceList called, startTime: %s, endTime: %s, useTFCard: %b", startTime, endTime, currentUseTFCard);
+ private List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard) {
+ Timber.d("getResourceList called, startTime: %s, endTime: %s, useTFCard: %b", startTime, endTime, useTFCard);
List<ResourceInfo> resourceList = new ArrayList<>();
@@ -772,7 +770,7 @@
return resourceList;
}
- if (currentUseTFCard) {
+ if (useTFCard) {
// 浣跨敤TF鍗★細鎵弿TF鍗′笂鐨刪264鏂囦欢澶癸紝鏍规嵁鏃ユ湡鑼冨洿杩囨护
String storagePath = FileUtil.getStoragePath(this, true);
if (storagePath == null || storagePath.trim().isEmpty()) {
diff --git a/app/src/main/java/com/anyun/h264/H264EncodeService2.java b/app/src/main/java/com/anyun/h264/H264EncodeService2.java
index 6644037..ea76ddb 100644
--- a/app/src/main/java/com/anyun/h264/H264EncodeService2.java
+++ b/app/src/main/java/com/anyun/h264/H264EncodeService2.java
@@ -33,8 +33,7 @@
private H264FileTransmitter h264FileTransmitter; // H264鏂囦欢浼犺緭鍣�
private String outputFileDirectory; // H264鏂囦欢杈撳嚭鐩綍
private WatermarkInfo currentWatermarkInfo; // 褰撳墠姘村嵃淇℃伅
- private boolean currentUseTFCard = false; // 褰撳墠鏄惁浣跨敤TF鍗¢厤缃�
-
+
// 榛樿缂栫爜鍙傛暟
private static final int DEFAULT_WIDTH = 640;
private static final int DEFAULT_HEIGHT = 480;
@@ -50,10 +49,10 @@
public int controlEncode(int action, String jsonConfig) throws RemoteException {
return H264EncodeService2.this.controlEncode(action, jsonConfig);
}
-
+
@Override
- public List<ResourceInfo> getResourceList(String startTime, String endTime) throws RemoteException {
- return H264EncodeService2.this.getResourceList(startTime, endTime);
+ public List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard) throws RemoteException {
+ return H264EncodeService2.this.getResourceList(startTime, endTime,useTFCard);
}
@Override
@@ -291,10 +290,6 @@
// 璁剧疆 Context锛堢敤浜庢竻鐞� TF 鍗℃枃浠讹級
h264Encoder.setContext(this);
- // 淇濆瓨褰撳墠useTFCard閰嶇疆
- currentUseTFCard = config != null && config.useTFCard;
-
- // 璁剧疆缂栫爜鍙傛暟锛堜娇鐢ㄩ厤缃腑鐨勫弬鏁帮級
// 璁剧疆缂栫爜鍙傛暟锛堜娇鐢ㄩ厤缃腑鐨勫弬鏁帮級
int width = config != null && config.width > 0 ? config.width : DEFAULT_WIDTH;
int height = config != null && config.height > 0 ? config.height : DEFAULT_HEIGHT;
@@ -363,8 +358,7 @@
// 璁剧疆 Context锛堢敤浜庢竻鐞� TF 鍗℃枃浠讹級
h264Encoder.setContext(this);
- // 淇濆瓨褰撳墠useTFCard閰嶇疆
- currentUseTFCard = config != null && config.useTFCard;
+
// 璁剧疆缂栫爜鍙傛暟锛堜娇鐢ㄩ厤缃腑鐨勫弬鏁帮級
int width = config != null && config.width > 0 ? config.width : DEFAULT_WIDTH;
@@ -602,8 +596,8 @@
/**
* 鑾峰彇璧勬簮鍒楄〃锛堟牴鎹甁T/T 1076-2016琛�23瀹氫箟锛�
*/
- private List<ResourceInfo> getResourceList(String startTime, String endTime) {
- Timber.d("getResourceList called (camera2), startTime: %s, endTime: %s, useTFCard: %b", startTime, endTime, currentUseTFCard);
+ private List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard) {
+ Timber.d("getResourceList called (camera2), startTime: %s, endTime: %s, useTFCard: %b", startTime, endTime, useTFCard);
List<ResourceInfo> resourceList = new ArrayList<>();
@@ -617,7 +611,7 @@
return resourceList;
}
- if (currentUseTFCard) {
+ if (useTFCard) {
// 浣跨敤TF鍗★細鎵弿TF鍗′笂鐨刪264鏂囦欢澶癸紝鏍规嵁鏃ユ湡鑼冨洿杩囨护
String storagePath = FileUtil.getStoragePath(this, true);
if (storagePath == null || storagePath.trim().isEmpty()) {
diff --git a/app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java b/app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java
index be12c39..5e6faeb 100644
--- a/app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java
+++ b/app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java
@@ -191,14 +191,14 @@
* @param endTime 缁撴潫鏃堕棿锛堟牸寮忥細YYMMDDHHmmss锛屼緥濡傦細240101235959锛�
* @return 璧勬簮鍒楄〃锛屽鏋滃け璐ヨ繑鍥瀗ull
*/
- public List<ResourceInfo> getResourceList(String startTime, String endTime) {
+ public List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard) {
if (!isServiceBound()) {
Log.e(TAG, "Service is not bound");
return null;
}
try {
- List<ResourceInfo> result = service.getResourceList(startTime, endTime);
+ List<ResourceInfo> result = service.getResourceList(startTime, endTime,useTFCard);
Log.d(TAG, "getResourceList returned " + (result != null ? result.size() : 0) + " resources");
return result;
} catch (RemoteException e) {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3de1a39..250852a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
<resources>
- <string name="app_name">My Application</string>
+ <string name="app_name">HuBeiVideo</string>
</resources>
\ No newline at end of file
--
Gitblit v1.8.0