| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | // 设置 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; |
| | |
| | | // 设置 Context(用于清理 TF 卡文件) |
| | | h264Encoder.setContext(this); |
| | | |
| | | // 保存当前useTFCard配置 |
| | | currentUseTFCard = config != null && config.useTFCard; |
| | | |
| | | |
| | | // 设置编码参数(使用配置中的参数) |
| | | int width = config != null && config.width > 0 ? config.width : DEFAULT_WIDTH; |
| | |
| | | /** |
| | | * 获取资源列表(根据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<>(); |
| | | |
| | |
| | | return resourceList; |
| | | } |
| | | |
| | | if (currentUseTFCard) { |
| | | if (useTFCard) { |
| | | // 使用TF卡:扫描TF卡上的h264文件夹,根据日期范围过滤 |
| | | String storagePath = FileUtil.getStoragePath(this, true); |
| | | if (storagePath == null || storagePath.trim().isEmpty()) { |