1.修改app名字,湖北video
2.修改获取h264文件列表,是否使用tfcard加这个参数
6个文件已修改
42 ■■■■■ 已修改文件
app/build.gradle 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/anyun/h264/H264EncodeService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/anyun/h264/H264EncodeService2.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/values/strings.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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"
    }
app/src/main/aidl/com/anyun/h264/IH264EncodeService.aidl
@@ -32,7 +32,7 @@
     * @param endTime 结束时间(格式:YYMMDDHHmmss,BCD编码的6字节字符串)
     * @return 资源列表(根据JT/T 1076-2016表23定义)
     */
    List<ResourceInfo> getResourceList(String startTime, String endTime);
    List<ResourceInfo> getResourceList(String startTime, String endTime,boolean useTFCard);
    
    /**
     * 设置水印信息
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;
            
            // 获取输出文件目录(根据useTFCard配置)
            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卡上的h264文件夹,根据日期范围过滤
                String storagePath = FileUtil.getStoragePath(this, true);
                if (storagePath == null || storagePath.trim().isEmpty()) {
app/src/main/java/com/anyun/h264/H264EncodeService2.java
@@ -33,7 +33,6 @@
    private H264FileTransmitter h264FileTransmitter; // H264文件传输器
    private String outputFileDirectory; // H264文件输出目录
    private WatermarkInfo currentWatermarkInfo; // 当前水印信息
    private boolean currentUseTFCard = false; // 当前是否使用TF卡配置
    
    // 默认编码参数
    private static final int DEFAULT_WIDTH = 640;
@@ -52,8 +51,8 @@
        }
        
        @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 @@
    /**
     * 获取资源列表(根据JT/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卡上的h264文件夹,根据日期范围过滤
                String storagePath = FileUtil.getStoragePath(this, true);
                if (storagePath == null || storagePath.trim().isEmpty()) {
app/src/main/java/com/anyun/h264/service/H264EncodeServiceClient.java
@@ -191,14 +191,14 @@
     * @param endTime 结束时间(格式:YYMMDDHHmmss,例如:240101235959)
     * @return 资源列表,如果失败返回null
     */
    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) {
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>