Dana
3 天以前 de7368d08258b80af017bc3a0ac891b314f01e36
app/src/main/java/com/safeluck/floatwindow/FloatingService.java
@@ -198,7 +198,7 @@
    private void startMedia(MediaArgu media) {
        if (media == null) {
            Timber.w("startMedia: media is null");
            notifyCallback(1, -1, "MediaArgu is null");
            notifyCallback(1, -1, "MediaArgu is null",1);
            return;
        }
@@ -210,7 +210,7 @@
                    p2Service.startMedia(media);
                } catch (RemoteException e) {
                    Timber.e(e, "startMedia forward to P2 failed");
                    notifyCallback(1, -3, "启动P2服务失败: " + e.getMessage());
                    notifyCallback(1, -3, "启动P2服务失败: " + e.getMessage(),2);
                }
            } else {
                // 等待连接完成后执行
@@ -232,7 +232,7 @@
                usbCameraPushManager.startPush(media);
            } else {
                Timber.w("推流仅支持USB摄像头");
                notifyCallback(1, -4, "推流仅支持USB摄像头");
                notifyCallback(1, -4, "推流仅支持USB摄像头",1);
            }
        } else {
            // 录像
@@ -353,10 +353,12 @@
     * @param type 类型:0-录像 1-推流 2-文件名类型等
     * @param errCode 错误码:0-成功,其他为错误码
     * @param message 消息内容
     * @param cameraId 0-android camera 1-P1 usb 2-P2 usb
     */
    private void notifyCallback(int type, int errCode, String message) {
    private void notifyCallback(int type, int errCode, String message,int cameraId) {
        ResponseVO response = new ResponseVO();
        response.setType(type);
        response.setCameraId(cameraId);
        response.setErrCode(errCode);
        response.setMessage(message);
        notifyCallback(response);