云执法小微版 v1.0.0版本的 MD5 值为:dfa1ab09653b3256f84dafdbda8bb96c
以下内容为反编译后的 kedamedia.java 源代码,内容仅作参考
package com.kedacom.webrtcsdk.sdkmanager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.graphics.Bitmap;
import android.hardware.usb.UsbDevice;
import android.media.AudioManager;
import android.media.projection.MediaProjection;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.view.View;
import androidx.media3.exoplayer.DefaultLoadControl;
import androidx.media3.extractor.metadata.icy.IcyHeaders;
import androidx.vectordrawable.graphics.drawable.PathInterpolatorCompat;
import com.kedacom.chinamobile.BuildConfig;
import com.kedacom.webrtc.AudioTrack;
import com.kedacom.webrtc.Camera1Enumerator;
import com.kedacom.webrtc.Camera2Enumerator;
import com.kedacom.webrtc.CameraEnumerator;
import com.kedacom.webrtc.CameraVideoCapturer;
import com.kedacom.webrtc.ExternalUVCCapturer;
import com.kedacom.webrtc.ExternalVideoCapturer;
import com.kedacom.webrtc.FileVideoCapturer;
import com.kedacom.webrtc.Logging;
import com.kedacom.webrtc.PeerConnection;
import com.kedacom.webrtc.PeerConnectionFactory;
import com.kedacom.webrtc.RendererCommon;
import com.kedacom.webrtc.ScreenCapturerAndroid;
import com.kedacom.webrtc.SessionDescription;
import com.kedacom.webrtc.SurfaceViewRenderer;
import com.kedacom.webrtc.TextureViewRenderer;
import com.kedacom.webrtc.VideoCapturer;
import com.kedacom.webrtc.VideoSink;
import com.kedacom.webrtc.VideoTrack;
import com.kedacom.webrtc.log.Log4jUtils;
import com.kedacom.webrtc.log.LogcatHelper;
import com.kedacom.webrtc.manager.AppRTCAudioManager;
import com.kedacom.webrtc.manager.PeerConnectionClient;
import com.kedacom.webrtc.pc.PeerManager;
import com.kedacom.webrtc.pc.TaskActor;
import com.kedacom.webrtc.pc.inter.PeerConnectionParameters;
import com.kedacom.webrtc.pc.inter.SignalingParameters;
import com.kedacom.webrtc.pc.sink.ProxyVideoSinkLocal;
import com.kedacom.webrtc.pc.sink.ProxyVideoSinkRemote;
import com.kedacom.webrtc.utils.ClogSDKCallback;
import com.kedacom.webrtc.utils.CommUtils;
import com.kedacom.webrtc.utils.ObjJudge;
import com.kedacom.webrtc.utils.SettingIni;
import com.kedacom.webrtcsdk.EventNotify.CameraNotifyImp;
import com.kedacom.webrtcsdk.EventNotify.PcInfoNotifyImp;
import com.kedacom.webrtcsdk.EventNotify.RemoteVideoSinkEvent;
import com.kedacom.webrtcsdk.EventNotify.SdpInfoNotiFyImp;
import com.kedacom.webrtcsdk.MediaInstance;
import com.kedacom.webrtcsdk.NMediaWebsocket;
import com.kedacom.webrtcsdk.PeerConnManager;
import com.kedacom.webrtcsdk.PlatformManger;
import com.kedacom.webrtcsdk.PlatformWebsocket;
import com.kedacom.webrtcsdk.RemoteViewShow;
import com.kedacom.webrtcsdk.SinglePeerCon;
import com.kedacom.webrtcsdk.callback.WebrtcCallback;
import com.kedacom.webrtcsdk.component.AndroidPhone;
import com.kedacom.webrtcsdk.component.BlackList;
import com.kedacom.webrtcsdk.component.Constantsdef;
import com.kedacom.webrtcsdk.component.MCDecoderAudio;
import com.kedacom.webrtcsdk.component.OkHttpDownUtil;
import com.kedacom.webrtcsdk.component.ShareDataUtils;
import com.kedacom.webrtcsdk.component.TimeOutCheck;
import com.kedacom.webrtcsdk.config.ConfigParam;
import com.kedacom.webrtcsdk.events.AudioRecordError;
import com.kedacom.webrtcsdk.events.AudioTrackError;
import com.kedacom.webrtcsdk.events.CallBack;
import com.kedacom.webrtcsdk.events.CheckSleepThread;
import com.kedacom.webrtcsdk.events.PcEvents;
import com.kedacom.webrtcsdk.events.PlatformHB;
import com.kedacom.webrtcsdk.events.SDPCallbackEvent;
import com.kedacom.webrtcsdk.events.SdpEvent;
import com.kedacom.webrtcsdk.events.WakeLock;
import com.kedacom.webrtcsdk.events.WsShortLinkEvent;
import com.kedacom.webrtcsdk.nMrtc.DescribeInfo;
import com.kedacom.webrtcsdk.nMrtc.WebSocketManagerImp;
import com.kedacom.webrtcsdk.nMrtc.nMrtcMsg;
import com.kedacom.webrtcsdk.struct.BitmapInfo;
import com.kedacom.webrtcsdk.struct.CmdType;
import com.kedacom.webrtcsdk.struct.CommVAParam;
import com.kedacom.webrtcsdk.struct.DownLoadReq;
import com.kedacom.webrtcsdk.struct.DownLoadResult;
import com.kedacom.webrtcsdk.struct.EnableStream;
import com.kedacom.webrtcsdk.struct.MultiConferenceAddReq;
import com.kedacom.webrtcsdk.struct.MultiConferenceRemoveReq;
import com.kedacom.webrtcsdk.struct.MultiConferenceStartReq;
import com.kedacom.webrtcsdk.struct.MultiConferenceStopReq;
import com.kedacom.webrtcsdk.struct.NMSStreamCtrlParam;
import com.kedacom.webrtcsdk.struct.PlatformUserInfo;
import com.kedacom.webrtcsdk.struct.ResponseToPlatForm;
import com.kedacom.webrtcsdk.struct.SFUModeMembersReq;
import com.kedacom.webrtcsdk.struct.SFUModeStartReq;
import com.kedacom.webrtcsdk.struct.SFUModeStopReq;
import com.kedacom.webrtcsdk.struct.SFUParam;
import com.kedacom.webrtcsdk.struct.SsrcReport;
import com.kedacom.webrtcsdk.struct.SwapViewParam;
import com.kedacom.webrtcsdk.struct.ThirdReqParam;
import com.kedacom.webrtcsdk.struct.VADefaultConfig;
import com.kedacom.webrtcsdk.struct.WSDevJoinUpMagReqParam;
import com.kedacom.webrtcsdk.struct.WSResponse;
import com.kedacom.webrtcsdk.struct.WSServerConfig;
import com.kedacom.webrtcsdk.struct.WSVideoAuidoReqParam;
import com.kedacom.webrtcsdk.struct.WebrtcAppRecOperate;
import com.kedacom.webrtcsdk.struct.WebrtcAppTranscode;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
import okhttp3.Response;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.Configurator;
public class kedamedia {
private static final int SHORTLINK_DELAY_S = 60;
private static final int SHORTLINK_DELAY_SEEMAP_HISDOWN = 1800;
private static final int SHORTLINK_DELAY_SEEMAP_S = 30;
private static final String WEBRTC_CONFIG = "[WEBRTC_CONFIG] ";
private static String appName;
private Bitmap g_bmp;
private int g_bmpHeight;
private int g_bmpWidth;
private int g_xPos;
private int g_yPos;
private PeerConnectionParameters peerConnectionParameters;
public WebrtcCallback.CompletionCallbackWith selfcallback;
private String szExtraUrl;
private String szHostUrl;
private int videoHeight;
private int videoWidth;
private static Map<String, WebrtcCallback.CompletionCallbackWith> callbackWithMap = new HashMap();
private static kedamedia instance = null;
public static final ExecutorService executor = TaskActor.executor;
private static String videoFileAsCamera = null;
private static Vector<String> reqIdMapNullresourceId = new Vector<>();
private static boolean isConnectPlatfrom = false;
private static boolean isKdcHacked = false;
private static boolean isplatformreq = false;
private static boolean issxt = false;
private static MultiConferenceStartReq g_startReq = null;
private static CmdType g_cmdType = CmdType.VIDEO_CALL;
private static SFUModeStartReq g_startReq_SFU = null;
private static ThirdReqParam sThirdReqParam = null;
private String maxVideoBitrate = VADefaultConfig.VIDEO_MAX_BITRATE;
private boolean enableEnc = false;
private String qpValue = VADefaultConfig.QP_VALUE;
private final int[] mwaitInt = {0};
private final int[] mstopInt = {0};
private Map<String, PeerConnManager> mPeerConnManagerMap = new HashMap();
private Map<String, NMediaWebsocket> mNMediaWebsocketMap = new HashMap();
private Map<String, WsShortLinkEvent> mWsShortLinkEventMap = new HashMap();
private PlatformManger platformManger = null;
private InputStream m_streamCertificate = null;
private List<String> conference_callees = new LinkedList();
private VideoCapturer screenCapturer = null;
private Constantsdef.CapturerSource currentCapSource = Constantsdef.CapturerSource.CAPTURER_CAMERA;
public String start_flag = "_start_transcode";
public String stop_flag = "_stop_transcode";
public Map<String, Bitmap> saveBitmap = new HashMap();
public View remoteView = null;
public ProxyVideoSinkRemote remoteSink = null;
public int startRequestType = 6;
public enum LogLevel {
TRACE,
DEBUG,
INFO,
ERROR,
FATAL
}
private kedamedia(Context context, String str) {
if (context != null) {
appName = context.getApplicationInfo().processName;
}
ConfigParam.setContext(context);
if (str != null && !str.equals("")) {
MediaInstance.getMediaManager().setGlobalLogPath(str);
Log4jUtils.getInstance(str, appName);
Log4jUtils.getInstance().debug(str);
}
if (str == null || str.equals("")) {
Log4jUtils.getInstance(null, appName);
}
if (context == null) {
Log4jUtils.getInstance().error("context is null");
return;
}
MediaInstance.getMediaManager().setAppContext(context);
Log4jUtils.getInstance().info(AndroidPhone.getInstance(MediaInstance.getMediaManager().getAppContext()).getInfo());
Log4jUtils.getInstance().info(AndroidPhone.getInstance(MediaInstance.getMediaManager().getAppContext()).isH264H265EncoderSuppport());
Log4jUtils.getInstance().info("kedacomrtc BUILD_TYPE:release VERSION_CODE:24011013 VERSION_NAME:240110-133637.");
}
private void ConnectPeerInternal(boolean z, String str, PeerConnection.DegradationPreference degradationPreference, boolean z2, boolean z3, String str2, String str3) {
VideoCapturer videoCapturer;
MediaInstance.getMediaManager().getPeerConnectionClient();
if (PeerConnectionClient.getCommSource().getFactory() == null) {
PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
options.networkIgnoreMask = 0;
options.disableEncryption = z;
options.nativeLogLevel = setNativeLogLevel();
options.isVoice = z3;
options.isKdcHacked = isKdcHacked;
MediaInstance.getMediaManager().getPeerConnectionClient().createPeerConnectionFactory(options, new AudioRecordError(), new AudioTrackError());
}
LinkedList linkedList = new LinkedList();
String str4 = "";
if (z2) {
if (!ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_EXTRA_STUN_IP).equals("")) {
str4 = String.format("stun:%s:%d", ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_EXTRA_STUN_IP), Integer.valueOf(ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_EXTRA_STUN_PORT, BuildConfig.STUN_PORT)));
linkedList.add(new PeerConnection.IceServer(str4));
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("--stun configure: " + str4);
}
} else if (isplatformreq) {
if (!ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.PLATFORM_NMWS_STUN_IP).equals("")) {
str4 = String.format("stun:%s:%d", ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.PLATFORM_NMWS_STUN_IP), Integer.valueOf(ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.PLATFORM_NMWS_STUN_PORT, BuildConfig.STUN_PORT)));
linkedList.add(new PeerConnection.IceServer(str4));
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.debug("platform --stun configure: " + str4);
}
} else if (!ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_STUN_IP).equals("")) {
str4 = String.format("stun:%s:%d", ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_STUN_IP), Integer.valueOf(ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_STUN_PORT, BuildConfig.STUN_PORT)));
linkedList.add(new PeerConnection.IceServer(str4));
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.debug("--stun configure: " + str4);
}
Logger log4jUtils4 = Log4jUtils.getInstance();
log4jUtils4.debug("stun configure: " + str4 + " useExtraUrl=" + z2);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (peerConnManager == null) {
Logger log4jUtils5 = Log4jUtils.getInstance();
log4jUtils5.warn("peerConnManager is null and requestid:" + str);
return;
}
RemoteViewShow remoteViewShow = peerConnManager.getRemoteViewShow();
if (g_cmdType == CmdType.VIDEO_CALL) {
if (remoteViewShow == null) {
Logger log4jUtils6 = Log4jUtils.getInstance();
log4jUtils6.warn("remoteViewShow is null and requestid:" + str);
}
if (remoteViewShow != null && remoteViewShow.getRemoteProxySink() != null) {
Logger log4jUtils7 = Log4jUtils.getInstance();
log4jUtils7.debug("size: " + remoteViewShow.getRemoteProxySink().size());
}
}
peerConnManager.setSignalingParameters(new SignalingParameters(linkedList));
if (this.peerConnectionParameters.reqType == 9) {
videoCapturer = MediaInstance.getMediaManager().getScreenCapturer();
} else {
MediaInstance.getMediaManager().getLocalProxyVideoSink().requestId = str;
videoCapturer = MediaInstance.getMediaManager().getVideoCapturer();
}
MediaInstance.getMediaManager().getPeerConnectionClient().createPeerConnection(str, degradationPreference, MediaInstance.getMediaManager().getLocalProxyVideoSink(), remoteViewShow != null ? remoteViewShow.getRemoteProxySink() : null, videoCapturer, peerConnManager.getSignalingParameters(), str2, str3);
}
private void closePeerConnectInternal(final String str, final int i) {
executor.execute(new Runnable() {
@Override
public final void run() {
kedamedia.this.m436x512a77cf(str, i);
}
});
}
private void closeShow(String str, int i) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (peerConnManager == null) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("peerConnManager is null and requestid:" + str);
return;
}
int size = this.mPeerConnManagerMap.size();
if (size == 1 || i == 0 || 5 == i || 6 == i || 8 == i) {
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).release();
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).release();
}
MediaInstance.getMediaManager().setPipRenderer(null);
Log4jUtils.getInstance().debug("release pipRenderer");
}
MediaInstance.getMediaManager().getLocalProxyVideoSink().setTarget(null);
SinglePeerCon.setStartVAReqParam(null);
SinglePeerCon.setStartreqid(null);
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.debug("size:" + size);
}
if (peerConnManager.getRemoteViewShow() == null) {
return;
}
Map<String, View> remoteSurView = peerConnManager.getRemoteViewShow().getRemoteSurView();
List<ProxyVideoSinkRemote> remoteProxySink = peerConnManager.getRemoteViewShow().getRemoteProxySink();
if (remoteProxySink != null) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote : remoteProxySink) {
proxyVideoSinkRemote.setTarget(null);
}
}
Logger log4jUtils3 = Log4jUtils.getInstance();
StringBuilder sb = new StringBuilder("--remoteViewlist Size=");
sb.append(ObjJudge.isNull(remoteSurView) ? "empty" : Integer.valueOf(remoteSurView.size()));
log4jUtils3.debug(sb.toString());
if (remoteSurView != null) {
for (Map.Entry<String, View> entry : remoteSurView.entrySet()) {
if (!ObjJudge.isNull(entry.getValue())) {
Logger log4jUtils4 = Log4jUtils.getInstance();
log4jUtils4.debug(" -----item release: key=" + entry.getKey() + " val=" + entry.getValue());
if (entry.getValue() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) entry.getValue()).release();
} else if (entry.getValue() instanceof TextureViewRenderer) {
((TextureViewRenderer) entry.getValue()).release();
}
}
}
}
peerConnManager.getRemoteViewShow().setRemoteSurView(null);
}
private VideoCapturer createCameraCapturer(CameraEnumerator cameraEnumerator, WebrtcCallback.CompletionCallbackWith completionCallbackWith, String str) {
String[] deviceNames = cameraEnumerator.getDeviceNames();
Log4jUtils.getInstance().debug(DescribeInfo.CAM_LOOKING_FOR_FRONT);
for (String str2 : deviceNames) {
if (cameraEnumerator.isFrontFacing(str2)) {
Log4jUtils.getInstance().debug(DescribeInfo.CAM_CREATE_FRONT_CAP);
CameraVideoCapturer createCapturer = cameraEnumerator.createCapturer(str2, new CameraNotifyImp(completionCallbackWith, str));
if (createCapturer != null) {
return createCapturer;
}
}
}
Log4jUtils.getInstance().debug(DescribeInfo.CAM_LOOKING_FOR_OTHER);
for (String str3 : deviceNames) {
if (!cameraEnumerator.isFrontFacing(str3)) {
Log4jUtils.getInstance().debug(DescribeInfo.CAM_CREATE_OTHER_CAP);
CameraVideoCapturer createCapturer2 = cameraEnumerator.createCapturer(str3, new CameraNotifyImp(completionCallbackWith, str));
if (createCapturer2 != null) {
return createCapturer2;
}
}
}
return null;
}
private NMediaWebsocket createShortNMediaLink(String str, String str2, String str3, int i, int i2, boolean z, boolean z2, boolean z3, boolean z4) {
WSServerConfig serverConfig;
String str4;
if (z3) {
serverConfig = ConfigParam.getServerConfig(true);
} else {
serverConfig = ConfigParam.getServerConfig(false);
}
if (!ObjJudge.isNull(serverConfig.getSzServerIP()) && ((ObjJudge.isNull(serverConfig.getSzServerIP()) || !serverConfig.getSzServerIP().isEmpty()) && serverConfig.getnServerPort() != 0)) {
str4 = serverConfig.getisWssServer() ? String.format("wss://%s:%d", serverConfig.getSzServerIP(), Integer.valueOf(serverConfig.getnServerPort())) : String.format("ws://%s:%d", serverConfig.getSzServerIP(), Integer.valueOf(serverConfig.getnServerPort()));
} else {
Log4jUtils.getInstance().error("nmedia url err");
str4 = "0.0.0.0:8081";
}
if (z4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("reqestid:" + str + " url=" + str4 + " resourceid:" + str2 + " operType:" + i + " ptzctrl:" + i2);
} else {
Logger conference = Log4jUtils.getConference();
conference.debug("reqestid:" + str + " url=" + str4 + " resourceid:" + str2 + " operType:" + i + " ptzctrl:" + i2);
}
NMediaWebsocket nMediaWebsocket = new NMediaWebsocket(new WebSocketManagerImp(MediaInstance.getMediaManager().getAppContext(), str4, 10, str), z4);
nMediaWebsocket.getWebst().strMsg = str3;
nMediaWebsocket.getNmediaevent().setKeepSingleWs(z);
nMediaWebsocket.getNotifyImp().setStreamopertype(i);
nMediaWebsocket.getNotifyImp().setStreamPtz(i2);
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
this.mWsShortLinkEventMap.put(str2, new WsShortLinkEvent(nMediaWebsocket));
if (z2) {
nMediaWebsocket.connectNMWebsocket(this.m_streamCertificate);
}
return nMediaWebsocket;
}
private VideoCapturer createVideoCapturer(final WebrtcCallback.CompletionCallbackWith completionCallbackWith, final String str) {
boolean z;
VideoCapturer videoCapturer;
ApplicationInfo applicationInfo = MediaInstance.getMediaManager().getAppContext().getApplicationInfo();
if (applicationInfo != null) {
int i = applicationInfo.targetSdkVersion;
int i2 = Build.VERSION.SDK_INT;
Log4jUtils.getInstance().debug("USB_DEVICES targetSdkVersion= " + i + " androidSdkversion=" + i2);
if (!isKdcHacked && ((i <= 27 && i2 > 27) || i2 <= 27)) {
ExternalUVCCapturer externalUVCCapturer = new ExternalUVCCapturer(MediaInstance.getMediaManager().getAppContext(), new ExternalUVCCapturer.UsbCameraStatusistener() {
@Override
public final void onUsbCameraStatus(VideoCapturer videoCapturer2, boolean z2) {
kedamedia.this.m437x8469d14a(completionCallbackWith, str, videoCapturer2, z2);
}
});
List<UsbDevice> deviceList = externalUVCCapturer.getUSBMonitor().getDeviceList();
if (deviceList.size() >= 1) {
Log4jUtils.getInstance().debug("ExternalUVCCapturer usbDevicesSize=" + deviceList.size());
for (UsbDevice usbDevice : deviceList) {
Log4jUtils.getInstance().debug("USB_DEVICES " + usbDevice);
String productName = usbDevice.getProductName();
if (productName != null && (productName.contains("camera") || productName.contains("Camera"))) {
return externalUVCCapturer;
}
}
}
}
}
String str2 = videoFileAsCamera;
if (str2 != null) {
try {
videoCapturer = new FileVideoCapturer(str2);
z = false;
} catch (IOException unused) {
Log4jUtils.getInstance().warn("Failed to open video file for emulated camera");
z = true;
videoCapturer = null;
}
Log4jUtils.getInstance().info("[WEBRTC_CONFIG] videoFileAsCamera:" + videoFileAsCamera);
} else {
videoCapturer = null;
z = false;
}
if (z || videoFileAsCamera == null) {
if (ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_IS_KDC_HACKED, false)) {
return new ExternalVideoCapturer();
}
boolean sharedBooleanData = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.CAMERA_PREFERENCE, VADefaultConfig.VIDEO_CAMERA);
Log4jUtils.getInstance().info("[WEBRTC_CONFIG] useCamera2:" + sharedBooleanData);
if (Camera2Enumerator.isSupported(MediaInstance.getMediaManager().getAppContext()) && sharedBooleanData) {
Log4jUtils.getInstance().debug(DescribeInfo.CAM_USING_CAMERA2);
videoCapturer = createCameraCapturer(new Camera2Enumerator(MediaInstance.getMediaManager().getAppContext()), completionCallbackWith, str);
} else {
Log4jUtils.getInstance().debug(DescribeInfo.CAM_USING_CAMERA1);
videoCapturer = createCameraCapturer(new Camera1Enumerator(true), completionCallbackWith, str);
}
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", "createVideoCapturer requestid:" + str + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "{\"request_id\":\"" + str + "\",\"video_file\":\"" + videoFileAsCamera + "\",\"file_failed\":\"" + z + "\"}", "200", "success").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (videoCapturer == null) {
return null;
}
return videoCapturer;
}
private void disconnecMapWs(int i, final String str) {
new TimeOutCheck(i * 1000, new TimeOutCheck.TimeOutNotify() {
@Override
public void onTimeOut() {
NMediaWebsocket nMediaWebsocket = (NMediaWebsocket) kedamedia.this.mNMediaWebsocketMap.get(str);
if (nMediaWebsocket == null) {
return;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("disconnectWs ..." + str);
nMediaWebsocket.closeNMWebsocket();
if (kedamedia.callbackWithMap.get(str) != null) {
WSResponse wSResponse = new WSResponse();
wSResponse.setnError(-1);
wSResponse.setSzRequestID(str);
wSResponse.setSzErrorDescribe("ws callback timeout");
((WebrtcCallback.CompletionCallbackWith) kedamedia.callbackWithMap.get(str)).onResult(wSResponse);
kedamedia.callbackWithMap.remove(str);
}
}
}).start();
}
private void disconnectWs(final NMediaWebsocket nMediaWebsocket, final String str) {
new TimeOutCheck(PathInterpolatorCompat.MAX_NUM_POINTS, new TimeOutCheck.TimeOutNotify() {
@Override
public void onTimeOut() {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("callback size disconnectWs ...requestid=" + str);
if (!ObjJudge.isNull(nMediaWebsocket)) {
nMediaWebsocket.closeNMWebsocket();
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.debug("disconnectWs closeNMWebsocket requestid=" + str);
return;
}
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.debug("disconnectWs ws is null requestid=" + str);
}
}).start();
}
public static kedamedia getInstance(Context context, String str) {
MediaInstance.getMediaManager().setGlobalLogPath(str);
if (instance == null) {
synchronized (kedamedia.class) {
if (instance == null) {
instance = new kedamedia(context, str);
}
if (!CheckSleepThread.isRunning() && MediaInstance.getMediaManager().getCheckSleep() == null) {
MediaInstance.getMediaManager().setCheckSleep(new CheckSleepThread());
MediaInstance.getMediaManager().getCheckSleep().start();
}
}
}
return instance;
}
public static Level getLogLevel(String str) {
return Log4jUtils.getLoggerLevel(str);
}
public static String[] getLoggersName() {
return Log4jUtils.getLoggersName();
}
public static String getSDKInfo() {
return "24011013";
}
private String msgManager(int i, WSVideoAuidoReqParam wSVideoAuidoReqParam) {
if (wSVideoAuidoReqParam != null) {
if (1 == i || 3 == i || 7 == i) {
return nMrtcMsg.startLive(wSVideoAuidoReqParam, isplatformreq, MediaInstance.getMediaManager().getAppContext());
}
if (i == 0 || 5 == i || 6 == i || 8 == i || 9 == i) {
return nMrtcMsg.startVideoCall(wSVideoAuidoReqParam, isplatformreq, MediaInstance.getMediaManager().getAppContext());
}
if (4 == i || 2 == i) {
return nMrtcMsg.startAudioCall(wSVideoAuidoReqParam, isplatformreq, MediaInstance.getMediaManager().getAppContext());
}
}
return null;
}
public void onAudioManagerDevicesChanged(AppRTCAudioManager.AudioDevice audioDevice, Set<AppRTCAudioManager.AudioDevice> set) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("onAudioManagerDevicesChanged: " + set + ", selected: " + audioDevice);
}
private boolean peerClose(String str, int i) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("---reqId=" + str + " requestType=" + i);
if (new File(Log4jUtils.RTC_SET_INI).exists()) {
try {
if (Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "isrecord", "0")).intValue() > 0) {
MediaInstance.getMediaManager().getPeerConnectionClient().stopRecordEnStream();
MediaInstance.getMediaManager().getPeerConnectionClient().stopRecordDeStream();
}
} catch (IOException e) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.info(" IniSetting:" + e.toString());
}
}
closeShow(str, i);
closePeerConnectInternal(str, i);
MediaInstance.getMediaManager().removeMulti(str);
for (Map.Entry<String, Boolean> entry : MediaInstance.getMediaManager().getReqId_Multi().entrySet()) {
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.debug("peerClose item key=" + entry.getKey() + " val=" + entry.getValue());
}
return true;
}
private void peerConnect(PeerConnManager peerConnManager, PeerConnection.DegradationPreference degradationPreference, int i, int i2, int i3, WebrtcCallback.CompletionCallbackWith completionCallbackWith, boolean z, String str, String str2, boolean z2, boolean z3, boolean z4) {
boolean z5;
int requesttype = peerConnManager.getRequesttype();
String requestid = peerConnManager.getRequestid();
setPeerConnectionParams(requestid, (byte) peerConnManager.getRequesttype(), i, i2, i3);
peerConnManager.setSdpEvent(new SdpEvent(peerConnManager.getNMediaWebsocket().getWebst()));
PcEvents pcEvents = new PcEvents(requesttype, requestid, peerConnManager.getNMediaWebsocket().getWebst(), System.currentTimeMillis(), completionCallbackWith, true, new PcInfoNotifyImp(), new SsrcReport(), new SdpInfoNotiFyImp(requestid, requesttype, this.maxVideoBitrate), str, str2);
pcEvents.setPlatform(isplatformreq);
pcEvents.setAppcontext(MediaInstance.getMediaManager().getAppContext());
pcEvents.g_bmp = this.g_bmp;
pcEvents.g_bmpWidth = this.g_bmpWidth;
pcEvents.g_bmpHeight = this.g_bmpHeight;
pcEvents.g_xPos = this.g_xPos;
pcEvents.g_yPos = this.g_yPos;
peerConnManager.setPcEvent(pcEvents);
PeerConnectionParameters peerConnectionParameters = this.peerConnectionParameters;
peerConnectionParameters.enablePauseSend = z2;
peerConnectionParameters.enablePauseRecv = z3;
peerConnectionParameters.enableCamera = z4;
if (MediaInstance.getMediaManager().getPeerConnectionClient() == null) {
MediaInstance.getMediaManager().setPeerConnectionClient(new PeerConnectionClient(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getEglBase(), this.peerConnectionParameters));
}
MediaInstance.getMediaManager().getPeerConnectionClient().setPeerConnectionPars(this.peerConnectionParameters);
if (!this.mPeerConnManagerMap.containsKey(requestid)) {
Log4jUtils.printMsg(Log4jUtils.TypeLog.LOGGER_JAVA, Level.DEBUG, requestid + "mPeerConnManagerMap add peerConnManager");
this.mPeerConnManagerMap.put(requestid, peerConnManager);
} else {
Log4jUtils.printMsg(Log4jUtils.TypeLog.LOGGER_JAVA, Level.DEBUG, requestid + "mPeerConnManagerMap not add peerConnManager");
}
boolean z6 = requesttype == 2 || requesttype == 4 || requesttype == 6 || requesttype == 8 || requesttype == CmdType.VIDEO_CALL.getValue() || requesttype == CmdType.AUDIO_CALL.getValue();
if (new File(Log4jUtils.RTC_SET_INI).exists()) {
try {
String profileString = SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "enableVoice", "-1");
if (Integer.valueOf(profileString).intValue() == 1) {
z5 = true;
} else if (Integer.valueOf(profileString).intValue() == 0) {
z5 = false;
}
} catch (IOException e) {
e.printStackTrace();
}
Log4jUtils.printMsg(Log4jUtils.TypeLog.LOGGER_JAVA, Level.DEBUG, "reqestType=" + requesttype + " isVoice=" + z5 + " audioMode=" + getAudioMode());
ConnectPeerInternal(this.enableEnc, requestid, degradationPreference, z, z5, str, str2);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().setReqType(requesttype);
MediaInstance.getMediaManager().getPeerConnectionClient().setPcEvent(requestid, peerConnManager.getPcEvent());
MediaInstance.getMediaManager().getPeerConnectionClient().setOAEvent(requestid, peerConnManager.getSdpEvent());
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() == null) {
MediaInstance.getMediaManager().getPeerConnectionClient().setQpValue(Integer.valueOf(this.qpValue).intValue());
return;
}
return;
}
z5 = z6;
Log4jUtils.printMsg(Log4jUtils.TypeLog.LOGGER_JAVA, Level.DEBUG, "reqestType=" + requesttype + " isVoice=" + z5 + " audioMode=" + getAudioMode());
ConnectPeerInternal(this.enableEnc, requestid, degradationPreference, z, z5, str, str2);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() == null) {
}
}
public static void setJavaConsole(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(" setJavaConsole enable=" + z);
Log4jUtils.enableJavaConsole(z);
}
public static void setLogLevel(String str, Level level) {
Log4jUtils.setLoggerLevel(str, level);
}
public static void setLogPath(String str) {
MediaInstance.getMediaManager().setGlobalLogPath(str);
Log4jUtils.getInstance(str, appName);
}
private boolean setPeerConnectionParams(String str, byte b, int i, int i2, int i3) {
String sharedStringData;
String str2;
boolean z;
boolean z2;
int sharedIntData;
boolean z3;
?? r44;
String str3;
boolean z4;
String str4;
boolean z5;
boolean z6;
boolean z7;
boolean z8;
int sharedIntData2;
String str5;
boolean z9;
boolean z10;
String str6;
String str7;
String str8;
String str9;
String str10;
boolean z11;
boolean z12;
int i4;
boolean z13;
String profileString;
int i5;
boolean z14;
boolean z15;
String str11;
int i6;
int i7;
boolean z16;
this.videoWidth = 640;
this.videoHeight = 480;
String str12 = VADefaultConfig.VIDEO_RESOLUTION;
String str13 = VADefaultConfig.VIDEO_MULTI_RESOLUTION;
String str14 = VADefaultConfig.VIDEO_YUV_FORMAT;
String str15 = VADefaultConfig.VIDEO_FPS;
String str16 = VADefaultConfig.VIDEO_CODEC;
String str17 = VADefaultConfig.VIDEOCODEC_WAY;
this.enableEnc = VADefaultConfig.ENABLE_ENC;
boolean z17 = VADefaultConfig.VIDEO_FLEXFEC;
String str18 = VADefaultConfig.AUDIO_MAX_BITRATE;
String str19 = VADefaultConfig.AUDIO_CODEC;
boolean z18 = VADefaultConfig.AUDIO_EchoCancellation;
boolean z19 = VADefaultConfig.AUDIO_AutoGainControl;
boolean z20 = VADefaultConfig.AUDIO_HighpassFilter;
boolean z21 = VADefaultConfig.AUDIO_NoiseSuppression;
boolean z22 = VADefaultConfig.AUDIO_OpenSLES;
boolean z23 = VADefaultConfig.AUDIO_EnableBuiltInAEC;
boolean z24 = VADefaultConfig.AUDIO_EnableBuiltInAGC;
boolean z25 = VADefaultConfig.AUDIO_EnableBuiltInNS;
boolean z26 = VADefaultConfig.AUDIO_EnableWebRtcAGCAndHPF;
String str20 = str17;
boolean sharedBooleanData = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.ENABLE_RTC_SETTINGS, VADefaultConfig.RTC_ENABLE_SET);
MediaInstance.getMediaManager().setEnableSet(sharedBooleanData);
Log4jUtils.getInstance().info("[WEBRTC_CONFIG] enableSet:" + sharedBooleanData);
if (!sharedBooleanData) {
this.qpValue = VADefaultConfig.QP_VALUE;
String str21 = MediaInstance.getMediaManager().isMulti(str) ? str13 : str12;
String[] split = str21.split("[ x]+");
String str22 = str21;
if (split.length == 2) {
try {
this.videoWidth = Integer.parseInt(split[0]);
this.videoHeight = Integer.parseInt(split[1]);
} catch (NumberFormatException unused) {
Log4jUtils.getInstance().error("Wrong video resolution setting: " + str12);
}
}
boolean equals = str14.equals(VADefaultConfig.VIDEO_YUV_FORMAT);
if (BlackList.MANUFACTURE_HUAWEI_MODELS_MATCH(null)) {
str20 = IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE;
}
str2 = BlackList.MANUFACTURE_HUAWEI_MODELS_MATCH("7") ? "3" : str20;
r44 = equals;
z6 = z22;
z3 = z24;
z7 = z25;
z8 = z26;
str4 = str15;
z4 = z17;
str6 = str18;
z9 = z19;
z10 = z20;
z = true;
sharedIntData2 = 9;
z5 = z21;
str5 = str19;
str3 = str22;
z2 = true;
sharedIntData = 3;
} else {
this.enableEnc = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.ENABLE_ENC_PREFERENCE, VADefaultConfig.ENABLE_ENC);
if (ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.ENABLE_QP_VALUE_PREFERENCE, VADefaultConfig.QP_VALUE_SET)) {
this.qpValue = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.QP_VALUE_PREFERENCE, VADefaultConfig.QP_VALUE);
} else {
this.qpValue = VADefaultConfig.QP_VALUE;
}
if (MediaInstance.getMediaManager().isMulti(str)) {
sharedStringData = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.RESOLUTION_MULTI_PEFERENCE, VADefaultConfig.VIDEO_MULTI_RESOLUTION);
} else {
sharedStringData = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.RESOLUTION_PEFERENCE, VADefaultConfig.VIDEO_RESOLUTION);
}
String[] split2 = sharedStringData.split("[ x]+");
if (split2.length == 2) {
try {
this.videoWidth = Integer.parseInt(split2[0]);
this.videoHeight = Integer.parseInt(split2[1]);
} catch (NumberFormatException unused2) {
Log4jUtils.getInstance().error("Wrong video resolution setting: " + str12);
}
}
String sharedStringData2 = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.YUVFORMAT_PREFERENCE, VADefaultConfig.VIDEO_YUV_FORMAT);
boolean equals2 = sharedStringData2.equals(VADefaultConfig.VIDEO_YUV_FORMAT);
String sharedStringData3 = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.FPS_PREFERENCE, VADefaultConfig.VIDEO_FPS);
this.maxVideoBitrate = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.MAXVIDEOBITRATE_PREFERENCE, VADefaultConfig.VIDEO_MAX_BITRATE);
String sharedStringData4 = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.VIDEOCODEC_WAY_PREFERENCE, VADefaultConfig.VIDEOCODEC_WAY);
if (sharedStringData4.equals(VADefaultConfig.CODEC_WAY.HARD_EN_DE)) {
str2 = "0";
} else if (sharedStringData4.equals(VADefaultConfig.CODEC_WAY.HARD_EN_SOFT_DE)) {
str2 = IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE;
} else if (sharedStringData4.equals(VADefaultConfig.CODEC_WAY.SOFT_EN_HARD_DE)) {
str2 = "2";
} else {
str2 = sharedStringData4.equals(VADefaultConfig.CODEC_WAY.SOFT_EN_DE) ? "3" : sharedStringData4;
}
String str23 = sharedStringData;
boolean sharedBooleanData2 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.FLEXFEC_PREFERENCE, VADefaultConfig.VIDEO_FLEXFEC);
String sharedStringData5 = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.STARTAUDIOBITRATEVALUE_PREFERENCE, VADefaultConfig.AUDIO_MAX_BITRATE);
String sharedStringData6 = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AUDIOCODEC_PREFERENCE, VADefaultConfig.AUDIO_CODEC);
boolean sharedBooleanData3 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.ECHOCANCELLATION_PREFERENCE, VADefaultConfig.AUDIO_EchoCancellation);
String str24 = Build.DEVICE;
if (str24.equals("KEDACOMF3")) {
sharedBooleanData3 = true;
}
z = sharedBooleanData3;
boolean sharedBooleanData4 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AUTOGAINCONTROL_PREFERENCE, VADefaultConfig.AUDIO_AutoGainControl);
boolean sharedBooleanData5 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.HIGHTPASSFILTER_PREFERENCE, VADefaultConfig.AUDIO_HighpassFilter);
boolean sharedBooleanData6 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.NOISESUPPRESSION_PREFERENCE, VADefaultConfig.AUDIO_NoiseSuppression);
boolean sharedBooleanData7 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.OPENSLES_PREFERENCE, VADefaultConfig.AUDIO_OpenSLES);
boolean sharedBooleanData8 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AEC_PREFERENCE, VADefaultConfig.AUDIO_EnableBuiltInAEC);
if (str24.equals("KEDACOMF3")) {
sharedBooleanData8 = true;
}
boolean sharedBooleanData9 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AGC_PREFERENCE, VADefaultConfig.AUDIO_EnableBuiltInAGC);
z2 = sharedBooleanData8;
boolean sharedBooleanData10 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.NS_PREFERENCE, VADefaultConfig.AUDIO_EnableBuiltInNS);
boolean sharedBooleanData11 = ShareDataUtils.getSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AGC_HPF_PREFERENCE, VADefaultConfig.AUDIO_EnableWebRtcAGCAndHPF);
sharedIntData = ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.TARGET_LEVEL_DBFS_PREFERENCE, VADefaultConfig.TARGET_LEVEL_DBFS);
z3 = sharedBooleanData9;
r44 = equals2;
str3 = str23;
z4 = sharedBooleanData2;
str14 = sharedStringData2;
str4 = sharedStringData3;
z5 = sharedBooleanData6;
z6 = sharedBooleanData7;
z7 = sharedBooleanData10;
z8 = sharedBooleanData11;
sharedIntData2 = ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.COMPRESSION_GAIN_DB_PREFERENCE, VADefaultConfig.COMPRESSION_GAIN_DB);
str5 = sharedStringData6;
z9 = sharedBooleanData4;
z10 = sharedBooleanData5;
str6 = sharedStringData5;
}
if (i == 106) {
str7 = str5;
str8 = str6;
str9 = CommVAParam.CODEC_H264;
} else if (i != 111) {
str7 = str5;
str8 = str6;
Log4jUtils.getInstance().warn("not surpport this encode codec, videoType:" + i);
str9 = str16;
} else {
str7 = str5;
str8 = str6;
str9 = CommVAParam.CODEC_HEVC;
}
if (i2 == 0 || i2 % 16 != 0 || i3 == 0 || i3 % 16 != 0) {
str10 = str3;
} else {
this.videoWidth = i2;
this.videoHeight = i3;
str10 = this.videoWidth + " x " + this.videoHeight;
}
File file = new File(Log4jUtils.RTC_SET_INI);
Log4jUtils.getInstance().info(WEBRTC_CONFIG + Log4jUtils.RTC_SET_INI);
if (file.exists()) {
try {
String profileString2 = SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "softwareAEC", "2");
if (Integer.valueOf(profileString2).intValue() == 1) {
z = true;
} else if (Integer.valueOf(profileString2).intValue() == 0) {
z = false;
}
z12 = Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "aecdump", "0")).intValue() > 0 ? Boolean.valueOf("TRUE").booleanValue() : false;
try {
z11 = Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "hwAEC", IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)).intValue() != 0;
} catch (IOException e) {
e = e;
z11 = true;
}
} catch (IOException e2) {
e = e2;
z11 = z2;
z12 = false;
}
try {
String profileString3 = SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "levelDB", "0");
if (Integer.valueOf(profileString3).intValue() > 0 && Integer.valueOf(profileString3).intValue() < 31) {
sharedIntData = Integer.valueOf(profileString3).intValue();
}
profileString = SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "gainDB", "0");
} catch (IOException e3) {
e = e3;
Log4jUtils.getInstance().info(" IniSetting:" + e.toString());
i4 = sharedIntData2;
z13 = z;
i5 = sharedIntData;
StringBuilder sb = new StringBuilder("{\"enableEnc\":");
sb.append(this.enableEnc);
sb.append(",\"videoCodecWay\":\"");
sb.append(str2);
sb.append("\",\"qpValue\":\"");
sb.append(this.qpValue);
sb.append("\",\"resolution\":\"");
sb.append(str10);
sb.append("\",\"yuvFormatStr\":\"");
sb.append(str14);
sb.append("\",\"cameraFps\":\"");
sb.append(str4);
sb.append(" fps\",\"maxVideoBitrate\":\"");
sb.append(this.maxVideoBitrate);
sb.append(" kbps\",\"videoCodec\":\"");
sb.append(str9);
sb.append("\",\"flexfec\":");
sb.append(z4);
sb.append(",\"startAudioBitrate\":\"");
String str25 = str8;
sb.append(str25);
sb.append("\",\"audioCodec\":\"");
String str26 = str7;
sb.append(str26);
sb.append("\",\"enableAecdump\":");
sb.append(z12);
sb.append(",\"enableEchoCancellation\":");
sb.append(z13);
sb.append(",\"enableAutoGainControl\":");
sb.append(z9);
sb.append(",\"enableHighpassFilter\":");
sb.append(z10);
sb.append(",\"enableNoiseSuppression\":");
sb.append(z5);
sb.append(",\"openSLES\":");
boolean z27 = z6;
sb.append(z27);
sb.append(",\"enableBuiltInAEC\":");
sb.append(z11);
sb.append(",\"enableBuiltInAGC\":");
sb.append(z3);
sb.append(",\"enableBuiltInNS\":");
sb.append(z7);
sb.append(",\"enableWebRtcAGCAndHPF\":");
sb.append(z8);
sb.append(",\"agcTargetLevelDB\":");
sb.append(i5);
sb.append(",\"agcCompressionGainDB\":");
sb.append(i4);
String sb2 = sb.toString();
if (ClogSDKCallback.isClogSDK()) {
}
Log4jUtils.getInstance().info(WEBRTC_CONFIG + sb2);
this.peerConnectionParameters = new PeerConnectionParameters(b, true, false, this.videoWidth, this.videoHeight, Integer.parseInt(str4), 0, str9, Integer.parseInt(str2), r44, z4, Integer.parseInt(str25), str11, z13, true, true, true, z14, false, z16, z15, true, true, false, false, null, i6, i7);
return true;
}
if (Integer.valueOf(profileString).intValue() > 0 && Integer.valueOf(profileString).intValue() < 90) {
i4 = Integer.valueOf(profileString).intValue();
z13 = z;
}
i4 = sharedIntData2;
z13 = z;
} else {
i4 = sharedIntData2;
if (Build.DEVICE.equals("KEDACOMF3")) {
z12 = false;
i5 = sharedIntData;
z13 = true;
z11 = true;
StringBuilder sb3 = new StringBuilder("{\"enableEnc\":");
sb3.append(this.enableEnc);
sb3.append(",\"videoCodecWay\":\"");
sb3.append(str2);
sb3.append("\",\"qpValue\":\"");
sb3.append(this.qpValue);
sb3.append("\",\"resolution\":\"");
sb3.append(str10);
sb3.append("\",\"yuvFormatStr\":\"");
sb3.append(str14);
sb3.append("\",\"cameraFps\":\"");
sb3.append(str4);
sb3.append(" fps\",\"maxVideoBitrate\":\"");
sb3.append(this.maxVideoBitrate);
sb3.append(" kbps\",\"videoCodec\":\"");
sb3.append(str9);
sb3.append("\",\"flexfec\":");
sb3.append(z4);
sb3.append(",\"startAudioBitrate\":\"");
String str252 = str8;
sb3.append(str252);
sb3.append("\",\"audioCodec\":\"");
String str262 = str7;
sb3.append(str262);
sb3.append("\",\"enableAecdump\":");
sb3.append(z12);
sb3.append(",\"enableEchoCancellation\":");
sb3.append(z13);
sb3.append(",\"enableAutoGainControl\":");
sb3.append(z9);
sb3.append(",\"enableHighpassFilter\":");
sb3.append(z10);
sb3.append(",\"enableNoiseSuppression\":");
sb3.append(z5);
sb3.append(",\"openSLES\":");
boolean z272 = z6;
sb3.append(z272);
sb3.append(",\"enableBuiltInAEC\":");
sb3.append(z11);
sb3.append(",\"enableBuiltInAGC\":");
sb3.append(z3);
sb3.append(",\"enableBuiltInNS\":");
sb3.append(z7);
sb3.append(",\"enableWebRtcAGCAndHPF\":");
sb3.append(z8);
sb3.append(",\"agcTargetLevelDB\":");
sb3.append(i5);
sb3.append(",\"agcCompressionGainDB\":");
sb3.append(i4);
String sb22 = sb3.toString();
if (ClogSDKCallback.isClogSDK()) {
i7 = i4;
i6 = i5;
z15 = z11;
z16 = z272;
z14 = z12;
str11 = str262;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", "setPeerConnectionParams requestid:" + str + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), sb22, "200", "success").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
} else {
z14 = z12;
z15 = z11;
str11 = str262;
i6 = i5;
i7 = i4;
z16 = z272;
}
Log4jUtils.getInstance().info(WEBRTC_CONFIG + sb22);
this.peerConnectionParameters = new PeerConnectionParameters(b, true, false, this.videoWidth, this.videoHeight, Integer.parseInt(str4), 0, str9, Integer.parseInt(str2), r44, z4, Integer.parseInt(str252), str11, z13, true, true, true, z14, false, z16, z15, true, true, false, false, null, i6, i7);
return true;
}
z13 = z;
z11 = z2;
z12 = false;
}
i5 = sharedIntData;
StringBuilder sb32 = new StringBuilder("{\"enableEnc\":");
sb32.append(this.enableEnc);
sb32.append(",\"videoCodecWay\":\"");
sb32.append(str2);
sb32.append("\",\"qpValue\":\"");
sb32.append(this.qpValue);
sb32.append("\",\"resolution\":\"");
sb32.append(str10);
sb32.append("\",\"yuvFormatStr\":\"");
sb32.append(str14);
sb32.append("\",\"cameraFps\":\"");
sb32.append(str4);
sb32.append(" fps\",\"maxVideoBitrate\":\"");
sb32.append(this.maxVideoBitrate);
sb32.append(" kbps\",\"videoCodec\":\"");
sb32.append(str9);
sb32.append("\",\"flexfec\":");
sb32.append(z4);
sb32.append(",\"startAudioBitrate\":\"");
String str2522 = str8;
sb32.append(str2522);
sb32.append("\",\"audioCodec\":\"");
String str2622 = str7;
sb32.append(str2622);
sb32.append("\",\"enableAecdump\":");
sb32.append(z12);
sb32.append(",\"enableEchoCancellation\":");
sb32.append(z13);
sb32.append(",\"enableAutoGainControl\":");
sb32.append(z9);
sb32.append(",\"enableHighpassFilter\":");
sb32.append(z10);
sb32.append(",\"enableNoiseSuppression\":");
sb32.append(z5);
sb32.append(",\"openSLES\":");
boolean z2722 = z6;
sb32.append(z2722);
sb32.append(",\"enableBuiltInAEC\":");
sb32.append(z11);
sb32.append(",\"enableBuiltInAGC\":");
sb32.append(z3);
sb32.append(",\"enableBuiltInNS\":");
sb32.append(z7);
sb32.append(",\"enableWebRtcAGCAndHPF\":");
sb32.append(z8);
sb32.append(",\"agcTargetLevelDB\":");
sb32.append(i5);
sb32.append(",\"agcCompressionGainDB\":");
sb32.append(i4);
String sb222 = sb32.toString();
if (ClogSDKCallback.isClogSDK()) {
}
Log4jUtils.getInstance().info(WEBRTC_CONFIG + sb222);
this.peerConnectionParameters = new PeerConnectionParameters(b, true, false, this.videoWidth, this.videoHeight, Integer.parseInt(str4), 0, str9, Integer.parseInt(str2), r44, z4, Integer.parseInt(str2522), str11, z13, true, true, true, z14, false, z16, z15, true, true, false, false, null, i6, i7);
return true;
}
public static void setPlatformConsole(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(" setPlatformConsole enable=" + z);
Log4jUtils.enablePlatformConsole(z);
}
private boolean skipMulti(int i, String str, int i2, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
if (isKdcHacked) {
if (i == 30000 && !issxt) {
isplatformreq = true;
} else if (!isplatformreq) {
issxt = true;
}
boolean z = issxt;
if (z && i == 30000) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn(" reqid:" + str + " issxt:" + issxt + " isplatformreq:" + isplatformreq);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "VideoAudioCall", "multi request >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_SXT_USE), "error").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorReqResponse(str, Constantsdef.CALLBACK_REQ_SXT_USE, "already sxt is running", completionCallbackWith);
return false;
} else if (isplatformreq && i != 30000) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.warn(" reqid:" + str + " issxt:" + issxt + " isplatformreq:" + isplatformreq);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type2 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type2, "kedacommrtc", "", "VideoAudioCall", "multi request >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_PLATFORM_USE), "error").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorReqResponse(str, Constantsdef.CALLBACK_REQ_PLATFORM_USE, "already platform is running", completionCallbackWith);
return false;
} else {
if (z && i2 == 0) {
this.maxVideoBitrate = String.valueOf(2048);
}
if (isplatformreq) {
this.maxVideoBitrate = String.valueOf(i2);
}
}
}
return true;
}
private void startAudioDevice() {
MediaInstance.getMediaManager().setAudioManager(AppRTCAudioManager.create(MediaInstance.getMediaManager().getAppContext()));
MediaInstance.getMediaManager().getAudioManager().start(new AppRTCAudioManager.AudioManagerEvents() {
@Override
public void onAudioDeviceChanged(AppRTCAudioManager.AudioDevice audioDevice, Set<AppRTCAudioManager.AudioDevice> set) {
kedamedia.this.onAudioManagerDevicesChanged(audioDevice, set);
}
});
}
private void stopPreviousStart(final WSVideoAuidoReqParam wSVideoAuidoReqParam, final WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
Log4jUtils.getInstance().debug(" stop previous start operate begin");
if (SinglePeerCon.getStartVAReqParam() != null && (wSVideoAuidoReqParam == null || (!wSVideoAuidoReqParam.isMulti() && wSVideoAuidoReqParam.getByRequestType() != 2 && wSVideoAuidoReqParam.getByRequestType() != 3))) {
final PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(SinglePeerCon.getStartVAReqParam().getSzRequestID());
if (peerConnManager == null) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("peerConnManager is null requestid : " + SinglePeerCon.getStartVAReqParam().getSzRequestID());
return;
} else if (peerConnManager.getPcEvent() != null) {
this.mwaitInt[0] = 1;
new Thread(new Runnable() {
@Override
public void run() {
Log4jUtils.getInstance().debug(" waiting for previous peer start finished before!");
int i = 0;
while (true) {
if (peerConnManager.getPcEvent().getPcStatus() > 0) {
break;
}
Log4jUtils.getInstance().debug(" waiting for previous peer start finished: status:" + peerConnManager.getPcEvent().getPcStatus());
i++;
if (i >= 15) {
Log4jUtils.getInstance().debug(" waiting for previous peer start over cnt:" + i);
break;
}
try {
Thread.sleep(100L);
} catch (Exception e) {
System.out.println(e);
}
}
Log4jUtils.getInstance().debug(" waiting for previous peer start finished: status:" + peerConnManager.getPcEvent().getPcStatus());
synchronized (kedamedia.this.mwaitInt) {
kedamedia.this.mwaitInt[0] = 2;
kedamedia.this.mwaitInt.notify();
}
Log4jUtils.getInstance().debug(" waiting for previous peer start finished after!");
}
}).start();
Log4jUtils.getInstance().debug("waiting for object begin");
synchronized (this.mwaitInt) {
try {
int[] iArr = this.mwaitInt;
if (iArr[0] == 1) {
iArr.wait();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
this.mwaitInt[0] = 0;
Log4jUtils.getInstance().debug("waiting for object end");
if (SinglePeerCon.getStartVAReqParam() != null) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.debug("stop operate previous " + SinglePeerCon.getStartVAReqParam().toString());
} else {
Log4jUtils.getInstance().warn("getStartVAReqParam is null");
}
this.mstopInt[0] = 1;
new TimeOutCheck(DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS, new TimeOutCheck.TimeOutNotify() {
@Override
public void onTimeOut() {
Log4jUtils.getInstance().debug("TimeOutCheck ...");
synchronized (kedamedia.this.mstopInt) {
if (kedamedia.this.mstopInt[0] == 1) {
kedamedia.this.mstopInt.notify();
}
WSVideoAuidoReqParam wSVideoAuidoReqParam2 = wSVideoAuidoReqParam;
if (wSVideoAuidoReqParam2 != null) {
CallBack.errorReqResponse(wSVideoAuidoReqParam2.getSzRequestID(), Constantsdef.CALLBACK_START_TWICE, "start twice", completionCallbackWith);
}
}
}
}).start();
stopVideoAudioReq(SinglePeerCon.getStartVAReqParam().getSzRequestID(), SinglePeerCon.getStartVAReqParam().getByRequestType(), new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
synchronized (kedamedia.this.mstopInt) {
if (kedamedia.this.mstopInt[0] == 1) {
kedamedia.this.mstopInt.notify();
}
WSVideoAuidoReqParam wSVideoAuidoReqParam2 = wSVideoAuidoReqParam;
if (wSVideoAuidoReqParam2 != null) {
CallBack.errorReqResponse(wSVideoAuidoReqParam2.getSzRequestID(), Constantsdef.CALLBACK_START_TWICE, "start twice", completionCallbackWith);
}
}
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.info("stop operate previous response:" + wSResponse.toString());
SinglePeerCon.setStartVAReqParam(null);
SinglePeerCon.setStartreqid(null);
}
});
try {
try {
Log4jUtils.getInstance().debug("object wait before");
synchronized (this.mstopInt) {
int[] iArr2 = this.mstopInt;
if (iArr2[0] == 1) {
iArr2.wait();
}
}
this.mstopInt[0] = 3;
} catch (InterruptedException e2) {
e2.printStackTrace();
}
} finally {
Log4jUtils.getInstance().debug("object wait after");
}
} else if (SinglePeerCon.getStartVAReqParam() != null) {
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.warn("getPcEvent not contain reqId: " + SinglePeerCon.getStartVAReqParam().getSzRequestID() + " stopPreviousStart end");
return;
} else {
Log4jUtils.getInstance().warn("getStartVAReqParam is null");
return;
}
} else if (wSVideoAuidoReqParam != null && (wSVideoAuidoReqParam.getByRequestType() != 2 || wSVideoAuidoReqParam.getByRequestType() != 3)) {
Logger log4jUtils4 = Log4jUtils.getInstance();
log4jUtils4.debug(" requesttype:" + ((int) wSVideoAuidoReqParam.getByRequestType()));
} else {
Logger log4jUtils5 = Log4jUtils.getInstance();
log4jUtils5.debug(" startReqParam is null, start_stopReq: " + SinglePeerCon.getStartreqid());
}
if (wSVideoAuidoReqParam != null && !wSVideoAuidoReqParam.isMulti()) {
SinglePeerCon.setStartVAReqParam(wSVideoAuidoReqParam);
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "VideoAudioCall", "stopPreviousStart requestid:" + wSVideoAuidoReqParam.getSzRequestID() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), wSVideoAuidoReqParam.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(wSVideoAuidoReqParam.getSzRequestID()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getInstance().debug(" stop previous start operate end");
}
private PeerConnManager viewManager(PeerConnManager peerConnManager, Map<String, View> map, View view) {
RemoteViewShow remoteViewShow = new RemoteViewShow();
Map<String, View> hashMap = new HashMap<>();
if (map == null) {
if (view != null) {
hashMap.put("", view);
}
map = hashMap;
}
remoteViewShow.setRemoteSurView(map);
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
}
} else {
Log4jUtils.getInstance().warn(" pipRenderer is null, please check");
}
Map<String, View> remoteSurView = remoteViewShow.getRemoteSurView();
if (remoteSurView != null) {
for (Map.Entry<String, View> entry : remoteSurView.entrySet()) {
if (entry.getValue() != null) {
View value = entry.getValue();
if (value instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) value).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
} else if (value instanceof TextureViewRenderer) {
((TextureViewRenderer) value).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
}
}
}
} else {
Log4jUtils.getInstance().warn(" remoteViewList is null, please check");
}
List<ProxyVideoSinkRemote> remoteProxySink = remoteViewShow.getRemoteProxySink();
if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() == null && MediaInstance.getMediaManager().getPipRenderer() != null) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().resetSize();
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().setTarget((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer());
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().setTarget((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer());
}
Log4jUtils.getInstance().debug("local proxy setTarget");
} else {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("local proxy getTarget:" + MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() + " " + MediaInstance.getMediaManager().getPipRenderer());
}
if (remoteSurView != null) {
for (Map.Entry<String, View> entry2 : remoteSurView.entrySet()) {
ProxyVideoSinkRemote proxyVideoSinkRemote = new ProxyVideoSinkRemote();
proxyVideoSinkRemote.setListen(new RemoteVideoSinkEvent());
proxyVideoSinkRemote.setCallee(entry2.getKey());
if (!ObjJudge.isNull(entry2.getValue())) {
View value2 = entry2.getValue();
if (value2 instanceof SurfaceViewRenderer) {
SurfaceViewRenderer surfaceViewRenderer = (SurfaceViewRenderer) value2;
surfaceViewRenderer.setMirror(false);
proxyVideoSinkRemote.setTarget(surfaceViewRenderer);
} else if (value2 instanceof TextureViewRenderer) {
TextureViewRenderer textureViewRenderer = (TextureViewRenderer) value2;
textureViewRenderer.setMirror(false);
proxyVideoSinkRemote.setTarget(textureViewRenderer);
}
}
remoteProxySink.add(proxyVideoSinkRemote);
}
}
remoteViewShow.setRemoteProxySink(remoteProxySink);
if (peerConnManager != null) {
peerConnManager.setRemoteViewShow(remoteViewShow);
} else {
Log4jUtils.getInstance().debug("peerConnManager is null");
}
return peerConnManager;
}
public void addConferenceMembers(MultiConferenceAddReq multiConferenceAddReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
boolean z;
VideoSink videoSink;
VideoSink videoSink2;
Log4jUtils.getConference().debug("addConferenceMembers start");
if (ObjJudge.isNull(multiConferenceAddReq)) {
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "param addReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers param addReq is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(multiConferenceAddReq.getCalleeMap()) && (ObjJudge.isNull(multiConferenceAddReq.getCalleeMap()) || ObjJudge.valid(multiConferenceAddReq.getCalleeMap()))) {
int size = multiConferenceAddReq.getCalleeMap().size();
Iterator<Map.Entry<String, View>> it = multiConferenceAddReq.getCalleeMap().entrySet().iterator();
int i = 0;
while (it.hasNext()) {
Map.Entry<String, View> next = it.next();
if (ObjJudge.isNull(next)) {
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "addReq callee param null");
return;
}
if (g_cmdType == CmdType.VIDEO_CALL) {
if (!ObjJudge.isNull(next.getValue())) {
if (next.getValue() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) next.getValue()).setUser(next.getKey());
} else if (next.getValue() instanceof TextureViewRenderer) {
((TextureViewRenderer) next.getValue()).setUser(next.getKey());
}
} else {
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "addReq callee=" + next.getKey() + " view is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq callee=" + next.getKey() + " view is null requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
if (this.conference_callees.contains(next.getKey())) {
it.remove();
i++;
}
}
if (i == size) {
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, 0, "addReq callee repetitive");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq callee repetitive requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), multiConferenceAddReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getConference().debug(multiConferenceAddReq.toString());
String requestId = multiConferenceAddReq.getRequestId();
String str = CommUtils.getUUID() + "-add";
if (!ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient())) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestId);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "sessionId param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq sessionId param is null requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
String addMembers = nMrtcMsg.addMembers(g_cmdType, multiConferenceAddReq.getCalleeMap(), str, sessionId);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.containsKey(requestId) ? this.mPeerConnManagerMap.get(requestId) : null;
if (!ObjJudge.isNull(peerConnManager) && !ObjJudge.isNull(multiConferenceAddReq.getCalleeMap())) {
if (g_cmdType == CmdType.VIDEO_CALL) {
for (Map.Entry<String, View> entry : multiConferenceAddReq.getCalleeMap().entrySet()) {
if (!ObjJudge.isNull(entry.getValue())) {
View value = entry.getValue();
if (value instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) value).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i2, int i3, int i4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i2 + " videoHeight:" + i3 + " rotation:" + i4);
}
});
} else if (value instanceof TextureViewRenderer) {
((TextureViewRenderer) value).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i2, int i3, int i4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i2 + " videoHeight:" + i3 + " rotation:" + i4);
}
});
}
}
Iterator<ProxyVideoSinkRemote> it2 = peerConnManager.getRemoteViewShow().getRemoteProxySink().iterator();
while (true) {
if (!it2.hasNext()) {
z = true;
break;
}
ProxyVideoSinkRemote next2 = it2.next();
if (next2.getCallee().equals(entry.getKey())) {
if (entry.getValue() instanceof SurfaceViewRenderer) {
videoSink2 = (SurfaceViewRenderer) entry.getValue();
} else {
videoSink2 = (TextureViewRenderer) entry.getValue();
}
next2.setTarget(videoSink2);
z = false;
}
}
if (z) {
ProxyVideoSinkRemote proxyVideoSinkRemote = new ProxyVideoSinkRemote();
proxyVideoSinkRemote.requestId = requestId;
proxyVideoSinkRemote.setListen(new RemoteVideoSinkEvent());
proxyVideoSinkRemote.setCallee(entry.getKey());
if (entry.getValue() instanceof SurfaceViewRenderer) {
videoSink = (SurfaceViewRenderer) entry.getValue();
} else {
videoSink = (TextureViewRenderer) entry.getValue();
}
proxyVideoSinkRemote.setTarget(videoSink);
peerConnManager.getRemoteViewShow().getRemoteProxySink().add(proxyVideoSinkRemote);
}
peerConnManager.getRemoteViewShow().getRemoteSurView().put(entry.getKey(), entry.getValue());
}
}
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (!ObjJudge.isNull(peerManager) && g_cmdType == CmdType.VIDEO_CALL) {
peerManager.getPcObserver().setVideoSinks(peerConnManager.getRemoteViewShow().getRemoteProxySink());
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestId);
if (ObjJudge.isNull(wsShortLinkEvent)) {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq shortLinkEvent param is null requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
LinkedList linkedList = new LinkedList();
Map<String, View> calleeMap = multiConferenceAddReq.getCalleeMap();
if (calleeMap != null) {
for (Map.Entry<String, View> entry2 : calleeMap.entrySet()) {
linkedList.add(entry2.getKey());
}
}
peerManager.getSdpObserver().setCallback(new SDPCallbackEvent(completionCallbackWith));
peerManager.getSdpObserver().setRequestid(str);
peerConnManager.getSdpEvent().addCallee(str, linkedList);
peerConnManager.getSdpEvent().addType(str, SdpEvent.CALL_TYPE.CALL_TYPE_MULTI);
if (nMediaWebsocket != null) {
nMediaWebsocket.getWebst().Send(addMembers);
}
for (Map.Entry<String, View> entry3 : multiConferenceAddReq.getCalleeMap().entrySet()) {
this.conference_callees.add(entry3.getKey());
}
Log4jUtils.getConference().debug("addConferenceMembers end");
return;
}
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "peerConnManager param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq peerConnManager param is null requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq getPeerConnectionClient is null requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
CallBack.errorParam(completionCallbackWith, multiConferenceAddReq.getRequestId(), 1, "addReq calleeMap param null or empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers addReq calleeMap param null or empty requestid:" + multiConferenceAddReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceAddReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public void addSFUMembers(SFUModeMembersReq sFUModeMembersReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
boolean z;
Log4jUtils.getConference().debug("addSFUMembers start");
if (ObjJudge.isNull(sFUModeMembersReq)) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "param addReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers param addReq is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(sFUModeMembersReq.getCalleeMap()) && (ObjJudge.isNull(sFUModeMembersReq.getCalleeMap()) || ObjJudge.valid(sFUModeMembersReq.getCalleeMap()))) {
int size = sFUModeMembersReq.getCalleeMap().size();
Iterator<Map.Entry<String, SFUParam>> it = sFUModeMembersReq.getCalleeMap().entrySet().iterator();
int i = 0;
while (it.hasNext()) {
Map.Entry<String, SFUParam> next = it.next();
if (ObjJudge.isNull(next)) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "addReq callee param null");
return;
}
SFUParam value = next.getValue();
if (value.eStreamType == SFUModeStartReq.StreamType.STREAM_TYPE_VIDEOAUDIO) {
if (!ObjJudge.isNull(value) && !ObjJudge.isNull(value.remoteView)) {
View view = value.remoteView;
if (view instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view).setUser(next.getKey());
} else if (view instanceof TextureViewRenderer) {
((TextureViewRenderer) view).setUser(next.getKey());
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "addReq callee=" + next.getKey() + " view is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq callee=" + next.getKey() + " view is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
if (this.conference_callees.contains(next.getKey())) {
it.remove();
i++;
}
}
if (i == size) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, 0, "addReq callee repetitive");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq callee repetitive requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), sFUModeMembersReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getConference().debug(sFUModeMembersReq.toString());
String requestId = sFUModeMembersReq.getRequestId();
String str = CommUtils.getUUID() + "-add";
if (!ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient())) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestId);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "sessionId param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq sessionId param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
String addSFUMembers = nMrtcMsg.addSFUMembers(g_cmdType, sFUModeMembersReq.getCalleeMap(), str, sessionId);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.containsKey(requestId) ? this.mPeerConnManagerMap.get(requestId) : null;
if (!ObjJudge.isNull(peerConnManager) && !ObjJudge.isNull(sFUModeMembersReq.getCalleeMap())) {
boolean z2 = false;
for (Map.Entry<String, SFUParam> entry : sFUModeMembersReq.getCalleeMap().entrySet()) {
if (!ObjJudge.isNull(entry.getValue()) && entry.getValue().eStreamType == SFUModeStartReq.StreamType.STREAM_TYPE_VIDEOAUDIO) {
SFUParam value2 = entry.getValue();
View view2 = value2.remoteView;
if (view2 != null) {
if (view2 instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view2).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i2, int i3, int i4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i2 + " videoHeight:" + i3 + " rotation:" + i4);
}
});
} else if (view2 instanceof TextureViewRenderer) {
((TextureViewRenderer) view2).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i2, int i3, int i4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i2 + " videoHeight:" + i3 + " rotation:" + i4);
}
});
}
if (peerConnManager.getRemoteViewShow() != null) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote : peerConnManager.getRemoteViewShow().getRemoteProxySink()) {
if (proxyVideoSinkRemote.getCallee().equals(entry.getKey())) {
View view3 = value2.remoteView;
if (view3 instanceof SurfaceViewRenderer) {
proxyVideoSinkRemote.setTarget((SurfaceViewRenderer) view3);
} else if (view3 instanceof TextureViewRenderer) {
proxyVideoSinkRemote.setTarget((TextureViewRenderer) view3);
}
z = false;
if (z) {
ProxyVideoSinkRemote proxyVideoSinkRemote2 = new ProxyVideoSinkRemote();
proxyVideoSinkRemote2.requestId = requestId;
proxyVideoSinkRemote2.setListen(new RemoteVideoSinkEvent());
proxyVideoSinkRemote2.setCallee(entry.getKey());
View view4 = value2.remoteView;
if (view4 instanceof SurfaceViewRenderer) {
proxyVideoSinkRemote2.setTarget((SurfaceViewRenderer) view4);
} else if (view4 instanceof TextureViewRenderer) {
proxyVideoSinkRemote2.setTarget((TextureViewRenderer) view4);
}
peerConnManager.getRemoteViewShow().getRemoteProxySink().add(proxyVideoSinkRemote2);
}
peerConnManager.getRemoteViewShow().getRemoteSurView().put(entry.getKey(), value2.remoteView);
z2 = true;
}
}
}
z = true;
if (z) {
}
peerConnManager.getRemoteViewShow().getRemoteSurView().put(entry.getKey(), value2.remoteView);
z2 = true;
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "remoteView param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq remoteView param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
}
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (!ObjJudge.isNull(peerManager) && z2) {
peerManager.getPcObserver().setVideoSinks(peerConnManager.getRemoteViewShow().getRemoteProxySink());
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestId);
if (ObjJudge.isNull(wsShortLinkEvent)) {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq shortLinkEvent param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
LinkedList linkedList = new LinkedList();
Map<String, SFUParam> calleeMap = sFUModeMembersReq.getCalleeMap();
if (calleeMap != null) {
for (Map.Entry<String, SFUParam> entry2 : calleeMap.entrySet()) {
linkedList.add(entry2.getKey());
this.conference_callees.add(entry2.getKey());
}
}
peerManager.getSdpObserver().setCallback(new SDPCallbackEvent(completionCallbackWith));
peerManager.getSdpObserver().setRequestid(str);
peerConnManager.getSdpEvent().addCallee(str, linkedList);
peerConnManager.getSdpEvent().addType(str, SdpEvent.CALL_TYPE.CALL_TYPE_SFU);
if (nMediaWebsocket != null) {
nMediaWebsocket.getWebst().Send(addSFUMembers);
}
Log4jUtils.getConference().debug("addSFUMembers end");
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "peerConnManager param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq peerConnManager param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq getPeerConnectionClient is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "addReq calleeMap param null or empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq calleeMap param null or empty requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public void appendMediaSdp(String str, String str2) {
}
public boolean changeCaptureFormat(int i, int i2, int i3) {
if (i > 0 && i2 > 0 && i3 > 0) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().changeCaptureFormat(i, i2, i3);
return true;
}
Log4jUtils.getInstance().warn("changeCaptureFormat MediaInstance.getMediaManager().getPeerConnectionClient() is null");
return false;
}
Log4jUtils.getInstance().warn("changeCaptureFormat param is error");
return false;
}
public void closeWs(String str) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("reqid: " + str);
if (str.equals(Constantsdef.WS_LINK_PLATFORM)) {
if (PlatformHB.getInstance().getIsSatrt()) {
PlatformHB.getInstance().setSuspend(true);
}
PlatformManger platformManger = this.platformManger;
if (platformManger != null) {
if (platformManger.getWebsocket() != null) {
this.platformManger.getWebsocket().closePlatformWebsocket();
}
this.platformManger = null;
}
isConnectPlatfrom = false;
}
}
public void connectPlatForm() {
String str;
int i;
String str2;
if (isConnectPlatfrom) {
Log4jUtils.getInstance().debug("isConnectPlatfrom:" + isConnectPlatfrom);
return;
}
isConnectPlatfrom = true;
if (ShareDataUtils.exitKey(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_PLATFORM_SERVER_IP)) {
str = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_PLATFORM_SERVER_IP);
} else {
Log4jUtils.getInstance().error(DescribeInfo.WS_XML_IPPARAM_NOEXIST);
str = "0.0.0.0";
}
if (ShareDataUtils.exitKey(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_PLATFORM_SERVER_PORT)) {
i = ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_PLATFORM_SERVER_PORT);
} else {
Log4jUtils.getInstance().error(DescribeInfo.WS_XML_PORTPARAM_NOEXIST);
i = 8081;
}
if (ShareDataUtils.exitKey(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_PLATFORM_SERVER_SUBPATH)) {
str2 = ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.WS_XML_FILE, Constantsdef.WS_PLATFORM_SERVER_SUBPATH);
} else {
Log4jUtils.getInstance().error(DescribeInfo.WS_XML_SUBPATHPARAM_NOEXIST);
str2 = "";
}
Log4jUtils.getInstance().debug("connectPlatForm incoming...");
String format = (str2.startsWith("/") || str2.equals("")) ? String.format("ws://%s:%d%s", str, Integer.valueOf(i), str2) : String.format("ws://%s:%d/%s", str, Integer.valueOf(i), str2);
Log4jUtils.getInstance().debug(format);
if (str == null || str.isEmpty() || i == 0) {
Log4jUtils.getInstance().debug("connectPlatForm Url is error");
format = String.format("ws://%s:%d/%s", "0.0.0.0", 8081, str2);
}
if (this.platformManger == null) {
Log4jUtils.getInstance().debug("connectPlatForm incoming...1");
this.platformManger = new PlatformManger(new PlatformWebsocket(new WebSocketManagerImp(MediaInstance.getMediaManager().getAppContext(), format, 10, Constantsdef.WS_LINK_PLATFORM)));
WakeLock.initWakeLock(MediaInstance.getMediaManager().getAppContext());
} else {
Log4jUtils.getInstance().warn("platformManger is not null");
}
PlatformHB.getInstance().setWsImp(this.platformManger.getWebsocket().getWebst());
}
public void connectWs(String str) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("reqid: " + str);
if (str.equals(Constantsdef.WS_LINK_PLATFORM)) {
connectPlatForm();
}
}
public void createScreenCapturer(String str, Intent intent) {
this.screenCapturer = new ScreenCapturerAndroid(intent, new MediaProjection.Callback() {
@Override
public void onStop() {
super.onStop();
}
});
}
public void destorysdk() {
MediaInstance.getMediaManager().setInited(false);
SinglePeerCon.setStartreqid(null);
for (Map.Entry<String, PeerConnManager> entry : this.mPeerConnManagerMap.entrySet()) {
if (entry.getValue().getNMediaWebsocket() != null) {
entry.getValue().getNMediaWebsocket().closeNMWebsocket();
}
}
this.mWsShortLinkEventMap.clear();
Log4jUtils.getInstance().info(DescribeInfo.SDK_DESTORY);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).stop();
MediaInstance.getMediaManager().setEnableLogcat(true);
if (!CheckSleepThread.isKeepLive() || MediaInstance.getMediaManager().getCheckSleep() == null) {
return;
}
CheckSleepThread.setKeepLive(false);
}
public void destroyScreenCapturer(String str) {
}
public boolean deviceJoinUpManager(WSDevJoinUpMagReqParam wSDevJoinUpMagReqParam, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
if (this.platformManger == null) {
Log4jUtils.getInstance().warn(" platformManger is null");
CallBack.errorParam(completionCallbackWith, "", 0, "platformManger is null");
return false;
}
WakeLock.acquireWakeLock();
Log4jUtils.getInstance().info(wSDevJoinUpMagReqParam.toString());
String str = null;
switch (wSDevJoinUpMagReqParam.getnRequestType()) {
case Constantsdef.DEV_REGISTER:
str = nMrtcMsg.register(wSDevJoinUpMagReqParam.getsDevId(), wSDevJoinUpMagReqParam.getsUserName(), wSDevJoinUpMagReqParam.getsPassWord(), wSDevJoinUpMagReqParam.getnDevType(), wSDevJoinUpMagReqParam.getnRegType(), wSDevJoinUpMagReqParam.getKeepAlivePeriod(), ShareDataUtils.getSharedStringData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.PLATFORM_USER_XML_FILE, Constantsdef.PLATFORM_USER_QUICK_LOGIN_SESSIONID, null));
PlatformHB.getInstance().setDeviceid(wSDevJoinUpMagReqParam.getsDevId());
PlatformHB.getInstance().setPeriod(wSDevJoinUpMagReqParam.getKeepAlivePeriod());
ConfigParam.setRegisterConfig(wSDevJoinUpMagReqParam);
break;
case Constantsdef.DEV_UNREGISTER:
str = nMrtcMsg.unRegister(wSDevJoinUpMagReqParam.getsDevId());
break;
case Constantsdef.DEV_LIVE_STOP:
str = nMrtcMsg.rtcLive(wSDevJoinUpMagReqParam);
break;
case Constantsdef.DEV_AUDIOCALL_STOP:
str = nMrtcMsg.reverseAudioCall(wSDevJoinUpMagReqParam);
break;
}
this.platformManger.getWebsocket().getNotifyImp().setCallbackWithMap(completionCallbackWith);
if (!this.platformManger.getWebsocket().getWebst().Send(str)) {
this.platformManger.getWebsocket().getWebst().strMsg = str;
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.error(wSDevJoinUpMagReqParam.getsDevId() + DescribeInfo.WS_SENDFAILED);
WakeLock.releaseWakeLock();
return false;
}
WakeLock.releaseWakeLock();
return true;
}
public void enAblePeerSsrcReport(boolean z) {
ShareDataUtils.setSharedBooleanData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, Constantsdef.RTC_ENABLE_REPORT_LOG, z);
}
public boolean enableStream(EnableStream enableStream) {
Log4jUtils.getInstance().debug(enableStream.toString());
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "StreamCtrl", "enableStream requestid:" + enableStream.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), enableStream.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(enableStream.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
Log4jUtils.getInstance().debug(enableStream.getType());
MediaInstance.getMediaManager().getPeerConnectionClient().enableRecvStream(enableStream.getRequestid(), enableStream.getType(), enableStream.isEnable());
return true;
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return true;
}
public void forceStop() {
Logger log4jUtils = Log4jUtils.getInstance();
StringBuilder sb = new StringBuilder("forceStop startReqParam=");
sb.append(SinglePeerCon.getStartVAReqParam() != null ? SinglePeerCon.getStartVAReqParam().toString() : Configurator.NULL);
log4jUtils.debug(sb.toString());
for (Map.Entry<String, Boolean> entry : MediaInstance.getMediaManager().getReqId_Multi().entrySet()) {
if (!entry.getValue().booleanValue()) {
stopPreviousStart(null, null);
}
}
LinkedList<String> linkedList = new LinkedList();
for (Map.Entry<String, PeerConnManager> entry2 : this.mPeerConnManagerMap.entrySet()) {
linkedList.add(entry2.getKey());
}
for (String str : linkedList) {
peerClose(str, 6);
if (!ObjJudge.isNull(this.mPeerConnManagerMap.get(str))) {
disconnectWs(this.mPeerConnManagerMap.get(str).getNMediaWebsocket(), str);
}
}
}
public int getAudioMode() {
AudioManager audioManager = (AudioManager) MediaInstance.getMediaManager().getAppContext().getSystemService("audio");
if (audioManager != null) {
return audioManager.getMode();
}
return -1;
}
public WSServerConfig getExtraServerConfig() {
return ConfigParam.getServerConfig(true);
}
public Bitmap getLastRecvFrameBitmap(String str) {
if (this.saveBitmap.containsKey(str)) {
return this.saveBitmap.get(str);
}
Log4jUtils.getInstance().debug("LastRecvFrameBitmap is NULL !");
return null;
}
public PlatformUserInfo getPlatformUserInfo() {
return ConfigParam.getPlatformUserInfo();
}
public WSServerConfig getServerConfig() {
return ConfigParam.getServerConfig(false);
}
public String getVAQualityReport(String str) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (ObjJudge.isNull(peerConnManager)) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("peerConnManager is null, requestid:" + str);
return "";
}
PcEvents pcEvent = peerConnManager.getPcEvent();
if (ObjJudge.isNull(pcEvent)) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.warn("peerConnManager getPcEvent is null, requestid:" + str);
return "";
}
return pcEvent.getVAQualityReport();
}
public boolean init() {
if (MediaInstance.getMediaManager().isInited()) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(DescribeInfo.INIT_SDK_CALLED + MediaInstance.getMediaManager().isInited());
return false;
}
releasesdk();
Log4jUtils.getInstance().debug("release before memory data");
SinglePeerCon.setStartreqid(null);
SinglePeerCon.setStartVAReqParam(null);
Vector<String> vector = reqIdMapNullresourceId;
if (vector != null) {
vector.clear();
}
this.mWsShortLinkEventMap.clear();
MediaInstance.getMediaManager().setInited(true);
Log4jUtils.getInstance().debug(DescribeInfo.INIT_SDK_START);
Log4jUtils.getInstance().debug(DescribeInfo.INIT_SDK_FINISHED);
return true;
}
public boolean isCreatrScreenCapturer() {
return this.screenCapturer != null;
}
public void m436x512a77cf(String str, int i) {
if (this.mPeerConnManagerMap.get(str) == null) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("peerConnManager is null and requestid:" + str);
return;
}
int size = this.mPeerConnManagerMap.size();
if (i == 2 || i == 4 || i == 6 || i == 8 || i == 1001 || i == 1002) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.debug("STOP AUDIO CAPTURE commSource requestType:" + i);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().closeAudio();
}
}
if (i == 6 || i == 5 || i == 0 || i == 0 || i == 8) {
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.debug("STOP VIDEO CAPTURE commSource requestType:" + i);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().closeVideo();
}
}
if (size == 1) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().close();
MediaInstance.getMediaManager().setPeerConnectionClient(null);
} else {
Log4jUtils.getInstance().error(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).stop();
MediaInstance.getMediaManager().setEnableLogcat(true);
} else if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().close(str);
} else {
Log4jUtils.getInstance().error(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
if (MediaInstance.getMediaManager().getScreenCapturer() != null && i == 9) {
Logger log4jUtils4 = Log4jUtils.getInstance();
log4jUtils4.debug("SCREEN_SEND STOP SCREEN CAPTURE INCOMING requestType:" + i);
try {
try {
MediaInstance.getMediaManager().getScreenCapturer().stopCapture();
MediaInstance.getMediaManager().getScreenCapturer().dispose();
} catch (Exception e) {
Log4jUtils.getInstance().error(e.getMessage());
e.printStackTrace();
}
} finally {
MediaInstance.getMediaManager().setScreenCapturer(null);
this.screenCapturer = null;
}
}
if (MediaInstance.getMediaManager().getScreenCapturer() == null && this.screenCapturer != null) {
Logger log4jUtils5 = Log4jUtils.getInstance();
log4jUtils5.debug("STOP SCREEN CAPTURE INCOMING requestType:" + i);
try {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().closeScreen();
}
} catch (Exception e2) {
Log4jUtils.getInstance().error(e2.getMessage());
e2.printStackTrace();
} finally {
this.screenCapturer = null;
this.currentCapSource = Constantsdef.CapturerSource.CAPTURER_CAMERA;
}
}
Logger log4jUtils6 = Log4jUtils.getInstance();
log4jUtils6.debug("STOP VIDEO CAPTURE BEDORE requestType:" + i);
if (MediaInstance.getMediaManager().getVideoCapturer() != null && (i == 6 || i == 5 || i == 0 || i == 0 || i == 8)) {
Logger log4jUtils7 = Log4jUtils.getInstance();
log4jUtils7.debug("STOP CAPTURE INCOMING requestType:" + i);
try {
try {
MediaInstance.getMediaManager().getVideoCapturer().stopCapture();
MediaInstance.getMediaManager().getVideoCapturer().dispose();
} finally {
MediaInstance.getMediaManager().setVideoCapturer(null);
}
} catch (Exception e3) {
Log4jUtils.getInstance().error(e3.getMessage());
e3.printStackTrace();
}
}
this.mPeerConnManagerMap.remove(str);
}
public void m437x8469d14a(WebrtcCallback.CompletionCallbackWith completionCallbackWith, String str, VideoCapturer videoCapturer, boolean z) {
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).setMirror(!z);
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).setMirror(!z);
}
}
PeerConnectionClient peerConnectionClient = MediaInstance.getMediaManager().getPeerConnectionClient();
if (peerConnectionClient == null) {
Log4jUtils.getInstance().error(" failed to get PeerClient!");
return;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("UVCCAMER_STATUS connected=" + z);
if (z) {
CallBack.callbackInt(21, Constantsdef.BUNDLE_KEY_INT_UVC_STATUS, 1);
peerConnectionClient.reConfigCapture(null, videoCapturer, false);
return;
}
CallBack.callbackInt(21, Constantsdef.BUNDLE_KEY_INT_UVC_STATUS, 0);
Log4jUtils.getInstance().debug(DescribeInfo.CAM_USING_CAMERA1);
VideoCapturer createCameraCapturer = createCameraCapturer(new Camera1Enumerator(true), completionCallbackWith, str);
if (createCameraCapturer != null) {
peerConnectionClient.reConfigCapture(createCameraCapturer, videoCapturer, true);
} else {
Log4jUtils.getInstance().error("open Self camera failed!");
}
}
public void m438xd672e6f9(WSVideoAuidoReqParam wSVideoAuidoReqParam, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
PeerConnManager peerConnManager;
String str;
boolean z;
boolean z2;
VideoSink videoSink;
VideoSink videoSink2;
VideoSink videoSink3;
synchronized (this) {
String szRequestID = wSVideoAuidoReqParam.getSzRequestID();
String szResourceID = wSVideoAuidoReqParam.getSzResourceID();
byte byRequestType = wSVideoAuidoReqParam.getByRequestType();
Log4jUtils.getInstance().debug("rest MedaiCallReq:" + wSVideoAuidoReqParam.toString());
if (szResourceID != null && !szResourceID.isEmpty()) {
if (!this.mPeerConnManagerMap.containsKey(szRequestID)) {
Log4jUtils.getInstance().debug(" mPeerConnManagerMap is not have requestId:" + szRequestID);
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), wSVideoAuidoReqParam.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if ((byRequestType == 0 || 5 == byRequestType || 6 == byRequestType || 8 == byRequestType) && MediaInstance.getMediaManager().getVideoCapturer() == null) {
MediaInstance.getMediaManager().setVideoCapturer(createVideoCapturer(completionCallbackWith, szRequestID));
}
String startorRestMediaCall = nMrtcMsg.startorRestMediaCall(wSVideoAuidoReqParam, false, MediaInstance.getMediaManager().getAppContext(), true);
PeerConnManager peerConnManager2 = this.mPeerConnManagerMap.get(szRequestID);
PeerConnectionClient peerConnectionClient = MediaInstance.getMediaManager().getPeerConnectionClient();
PeerManager peerManager = peerConnectionClient.getPeerManager(szRequestID);
if (byRequestType == 6 && this.startRequestType == 4) {
this.startRequestType = 6;
if (wSVideoAuidoReqParam.getLocalView() != null) {
MediaInstance.getMediaManager().setPipRenderer(wSVideoAuidoReqParam.getLocalView());
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
}
} else {
Log4jUtils.getInstance().warn(" pipRenderer is null, please check");
}
}
if (PeerConnectionClient.getCommSource().getSurfaceTextureHelper() == null && PeerConnectionClient.getCommSource().getVideoSource() == null) {
PeerConnectionClient.getCommSource().setVideoCapturer(MediaInstance.getMediaManager().getVideoCapturer());
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
videoSink3 = (SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer();
} else {
videoSink3 = (TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer();
}
peerConnectionClient.addVideoTrack(szRequestID, videoSink3, wSVideoAuidoReqParam.getSzCallerID(), wSVideoAuidoReqParam.getSzCalleeID());
}
if (!ObjJudge.isNull(wSVideoAuidoReqParam.getRemoteView())) {
View remoteView = wSVideoAuidoReqParam.getRemoteView();
if (remoteView instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) remoteView).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
} else if (remoteView instanceof TextureViewRenderer) {
((TextureViewRenderer) remoteView).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
}
}
Iterator<ProxyVideoSinkRemote> it = peerConnManager2.getRemoteViewShow().getRemoteProxySink().iterator();
while (true) {
if (!it.hasNext()) {
z2 = true;
break;
}
ProxyVideoSinkRemote next = it.next();
if (next.getCallee().equals(wSVideoAuidoReqParam.getSzCalleeID())) {
if (wSVideoAuidoReqParam.getRemoteView() instanceof SurfaceViewRenderer) {
videoSink2 = (SurfaceViewRenderer) wSVideoAuidoReqParam.getRemoteView();
} else {
videoSink2 = (TextureViewRenderer) wSVideoAuidoReqParam.getRemoteView();
}
next.setTarget(videoSink2);
z2 = false;
}
}
if (z2) {
ProxyVideoSinkRemote proxyVideoSinkRemote = new ProxyVideoSinkRemote();
proxyVideoSinkRemote.requestId = szRequestID;
proxyVideoSinkRemote.setListen(new RemoteVideoSinkEvent());
proxyVideoSinkRemote.setCallee(wSVideoAuidoReqParam.getSzCalleeID());
if (wSVideoAuidoReqParam.getRemoteView() instanceof SurfaceViewRenderer) {
videoSink = (SurfaceViewRenderer) wSVideoAuidoReqParam.getRemoteView();
} else {
videoSink = (TextureViewRenderer) wSVideoAuidoReqParam.getRemoteView();
}
proxyVideoSinkRemote.setTarget(videoSink);
peerConnManager2.getRemoteViewShow().getRemoteProxySink().add(proxyVideoSinkRemote);
}
peerConnManager2.getRemoteViewShow().getRemoteSurView().put(wSVideoAuidoReqParam.getSzCalleeID(), wSVideoAuidoReqParam.getRemoteView());
peerManager.getPcObserver().setVideoSinks(peerConnManager2.getRemoteViewShow().getRemoteProxySink());
}
Log4jUtils.getInstance().debug(startorRestMediaCall);
Log4jUtils.getInstance().debug(DescribeInfo.START_ING);
Log4jUtils.getInstance().debug("NewMedia_reqid reqid=" + szRequestID + " resourceId:" + szResourceID + " Size=" + this.mWsShortLinkEventMap.size());
for (Map.Entry<String, WsShortLinkEvent> entry : this.mWsShortLinkEventMap.entrySet()) {
Log4jUtils.getInstance().debug("NewMedia_reqid item-ResourceID=" + entry.getKey() + " shortLink=" + entry.getValue());
}
if (!wSVideoAuidoReqParam.isMulti() && this.mWsShortLinkEventMap.get(szResourceID) == null) {
peerConnManager = peerConnManager2;
str = startorRestMediaCall;
peerConnManager.setNMediaWebsocket(createShortNMediaLink(szRequestID, szResourceID, startorRestMediaCall, byRequestType, 0, false, false, wSVideoAuidoReqParam.isUseExtraUrl(), false));
} else {
peerConnManager = peerConnManager2;
str = startorRestMediaCall;
if (!wSVideoAuidoReqParam.isMulti() && this.mWsShortLinkEventMap.get(szResourceID) != null) {
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(szResourceID);
if (wsShortLinkEvent.getWsLinkCloseEvent() != null && wsShortLinkEvent.getWsLinkCloseEvent().ishaverun()) {
wsShortLinkEvent.stop();
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP resourceid:" + szResourceID);
peerConnManager.setNMediaWebsocket(createShortNMediaLink(szRequestID, szResourceID, str, byRequestType, 0, false, false, wSVideoAuidoReqParam.isUseExtraUrl(), false));
} else if (wsShortLinkEvent.getWsLinkCloseEvent() != null) {
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP resourceid:" + szResourceID);
wsShortLinkEvent.stop();
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
nMediaWebsocket.getWebst().reqId = szRequestID;
nMediaWebsocket.getNmediaevent().setReqId(szRequestID);
nMediaWebsocket.getNotifyImp().setStreamopertype(byRequestType);
nMediaWebsocket.getNotifyImp().setStreamPtz(0);
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.setNMediaWebsocket(nMediaWebsocket);
} else {
Log4jUtils.getInstance().debug(" NewMedia_reqid=" + szRequestID + " resourceId:" + szResourceID);
}
}
z = false;
if (peerConnManager.getNMediaWebsocket() != null) {
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_WEBSOCKET_NOT_CREATED, "websokcet for peerManager Not set", completionCallbackWith);
if (!wSVideoAuidoReqParam.isMulti() && SinglePeerCon.getStartreqid() != null) {
SinglePeerCon.setStartreqid(null);
Log4jUtils.getInstance().debug(" NewMedia_reqid=" + szRequestID + " setStartreqid null");
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", "websokcet for peerManager Not set >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_WEBSOCKET_NOT_CREATED), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return;
}
PeerConnManager peerConnManager3 = peerConnManager;
peerConnect(peerConnManager, wSVideoAuidoReqParam.getDegradePre(), wSVideoAuidoReqParam.getByVideoType(), wSVideoAuidoReqParam.getWidth(), wSVideoAuidoReqParam.getHeight(), completionCallbackWith, wSVideoAuidoReqParam.isUseExtraUrl(), wSVideoAuidoReqParam.getSzCallerID(), wSVideoAuidoReqParam.getSzCalleeID(), wSVideoAuidoReqParam.getisPauseSend(), wSVideoAuidoReqParam.getisPauseRecv(), wSVideoAuidoReqParam.getisEnableCamera());
if (!wSVideoAuidoReqParam.isMulti()) {
if (z) {
peerConnManager3.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
Log4jUtils.getInstance().warn("webSocketManagerImp connectNMWebsocket");
} else {
WebSocketManagerImp webst = peerConnManager3.getNMediaWebsocket().getWebst();
if (webst != null) {
peerConnManager3.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(true);
String str2 = str;
if (!webst.Send(str2)) {
Log4jUtils.getInstance().warn("szWsMessage send failed, msg:" + str2);
webst.strMsg = str2;
}
} else {
Log4jUtils.getInstance().warn("webSocketManagerImp is null");
}
}
}
setSwappedFeeds(false, szRequestID);
return;
}
z = true;
if (peerConnManager.getNMediaWebsocket() != null) {
}
}
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_REQ_RESOURCEID_NULL, "resourceId param is null", completionCallbackWith);
reqIdMapNullresourceId.add(szRequestID);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", "resourceId param is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_RESOURCEID_NULL), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public void m439x8d03d66(WSVideoAuidoReqParam wSVideoAuidoReqParam, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String str;
String str2;
String str3;
PeerConnManager peerConnManager;
PeerConnManager peerConnManager2;
String str4;
char c;
String str5;
boolean z;
boolean z2;
WSServerConfig serverConfig;
synchronized (this) {
String szRequestID = wSVideoAuidoReqParam.getSzRequestID();
String szResourceID = wSVideoAuidoReqParam.getSzResourceID();
byte byRequestType = wSVideoAuidoReqParam.getByRequestType();
Log4jUtils.getInstance().debug("start MedaiCallReq:" + wSVideoAuidoReqParam.toString());
if (skipMulti(wSVideoAuidoReqParam.mThirdReqParam.getnThirdReq(), szRequestID, wSVideoAuidoReqParam.getMaxSendBitrate(), completionCallbackWith)) {
if (szResourceID != null && !szResourceID.isEmpty()) {
stopPreviousStart(wSVideoAuidoReqParam, completionCallbackWith);
if (this.mPeerConnManagerMap.containsKey(szRequestID)) {
this.mPeerConnManagerMap.remove(szRequestID);
Log4jUtils.getInstance().debug(" remove reqId = " + szRequestID);
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.MsgBody msgBody = new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), wSVideoAuidoReqParam.toString(), "200", "success");
str3 = szResourceID;
str = "start_stop must paired appearance >>";
str2 = "eglbase is null >>";
ClogSDKCallback.CLoggerLOG(Level.DEBUG, msgBody.toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
} else {
str = "start_stop must paired appearance >>";
str2 = "eglbase is null >>";
str3 = szResourceID;
}
if (this.mPeerConnManagerMap.containsKey(szRequestID)) {
peerConnManager = null;
} else {
if (wSVideoAuidoReqParam.isUseExtraUrl()) {
serverConfig = ConfigParam.getServerConfig(true);
} else {
serverConfig = ConfigParam.getServerConfig(false);
}
if (isplatformreq) {
if (ObjJudge.isNull(serverConfig.getPlatform_szServerIP()) || ((!ObjJudge.isNull(serverConfig.getPlatform_szServerIP()) && serverConfig.getPlatform_szServerIP().isEmpty()) || serverConfig.getPlatform_nServerPort() == 0)) {
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_URL_ERR, "platform nmedia url err", completionCallbackWith);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", "platform nmedia url err >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_URL_ERR), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return;
}
this.szHostUrl = String.format("ws://%s:%d", serverConfig.getPlatform_szServerIP(), Integer.valueOf(serverConfig.getPlatform_nServerPort()));
} else {
if (!ObjJudge.isNull(serverConfig.getSzServerIP()) && ((ObjJudge.isNull(serverConfig.getSzServerIP()) || !serverConfig.getSzServerIP().isEmpty()) && serverConfig.getnServerPort() != 0)) {
if (serverConfig.getisWssServer()) {
this.szHostUrl = String.format("wss://%s:%d", serverConfig.getSzServerIP(), Integer.valueOf(serverConfig.getnServerPort()));
} else {
this.szHostUrl = String.format("ws://%s:%d", serverConfig.getSzServerIP(), Integer.valueOf(serverConfig.getnServerPort()));
}
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", "nmedia url err >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_URL_ERR), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_URL_ERR, "nmedia url err", completionCallbackWith);
return;
}
PeerConnManager peerConnManager3 = new PeerConnManager();
if (wSVideoAuidoReqParam.isMulti()) {
Log4jUtils.getInstance().debug("szHostUrl:" + this.szHostUrl);
NMediaWebsocket nMediaWebsocket = new NMediaWebsocket(new WebSocketManagerImp(MediaInstance.getMediaManager().getAppContext(), this.szHostUrl, 10, szRequestID), false);
nMediaWebsocket.getWebst().reqType = wSVideoAuidoReqParam.getByRequestType();
nMediaWebsocket.getNotifyImp().setStreamopertype(byRequestType);
nMediaWebsocket.getWebst().setNmedialog_to_platform(isKdcHacked);
nMediaWebsocket.getNmediaevent().setNmedialog_to_platform(isKdcHacked);
peerConnManager3.setNMediaWebsocket(nMediaWebsocket);
}
peerConnManager3.setRequestid(szRequestID);
peerConnManager3.setRequesttype(wSVideoAuidoReqParam.getByRequestType());
peerConnManager = peerConnManager3;
}
MediaInstance.getMediaManager().setMulti(szRequestID, wSVideoAuidoReqParam.isMulti());
if (ObjJudge.isNull(MediaInstance.getMediaManager().getEglBase()) && ObjJudge.isNull(wSVideoAuidoReqParam.getEglBase())) {
Log4jUtils.getInstance().warn("eglbase is null");
CallBack.errorReqResponse(szRequestID, -1, "eglbase is null", completionCallbackWith);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", str2 + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return;
}
if (ObjJudge.isNull(MediaInstance.getMediaManager().getEglBase()) && !ObjJudge.isNull(wSVideoAuidoReqParam.getEglBase())) {
MediaInstance.getMediaManager().setEglBase(wSVideoAuidoReqParam.getEglBase());
}
if (!wSVideoAuidoReqParam.isMulti()) {
if (SinglePeerCon.getStartreqid() == null) {
SinglePeerCon.setStartreqid(wSVideoAuidoReqParam.getSzRequestID());
} else {
Log4jUtils.getInstance().warn("start_stop must paired appearance");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", str + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf(-100), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorReqResponse(szRequestID, -100, "start_stop must paired appearance", completionCallbackWith);
return;
}
}
if (MediaInstance.getMediaManager().isEnableLogcat()) {
MediaInstance.getMediaManager().setEnableLogcat(false);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).start();
Log4jUtils.getInstance().info(AndroidPhone.getInstance(MediaInstance.getMediaManager().getAppContext()).getAllIp());
}
if ((byRequestType == 0 || 5 == byRequestType || 6 == byRequestType || 8 == byRequestType) && MediaInstance.getMediaManager().getVideoCapturer() == null) {
MediaInstance.getMediaManager().setVideoCapturer(createVideoCapturer(completionCallbackWith, szRequestID));
}
if (9 == byRequestType && this.screenCapturer != null) {
MediaInstance.getMediaManager().setScreenCapturer(this.screenCapturer);
}
if (!isKdcHacked && (2 == byRequestType || 4 == byRequestType || 6 == byRequestType || 8 == byRequestType)) {
Log4jUtils.getInstance().debug("start audioMode=" + getAudioMode());
if (new File(Log4jUtils.RTC_SET_INI).exists()) {
try {
} catch (IOException e) {
e.printStackTrace();
}
if (Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "enableVoice", IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)).intValue() == 0) {
z2 = false;
if (z2) {
setAudioMode(true);
}
Log4jUtils.getInstance().debug("start audioMode= MODE_NORMAL 1111");
}
}
z2 = true;
if (z2) {
}
Log4jUtils.getInstance().debug("start audioMode= MODE_NORMAL 1111");
}
String startorRestMediaCall = nMrtcMsg.startorRestMediaCall(wSVideoAuidoReqParam, false, MediaInstance.getMediaManager().getAppContext(), false);
this.startRequestType = byRequestType;
if (wSVideoAuidoReqParam.getLocalView() != null) {
MediaInstance.getMediaManager().setPipRenderer(wSVideoAuidoReqParam.getLocalView());
}
if (9 != byRequestType) {
HashMap hashMap = new HashMap();
hashMap.put(wSVideoAuidoReqParam.getSzCalleeID() != null ? wSVideoAuidoReqParam.getSzCalleeID() : "", wSVideoAuidoReqParam.getRemoteView());
peerConnManager = viewManager(peerConnManager, hashMap, null);
MediaInstance.getMediaManager().setIsFrontCam(true);
}
PeerConnManager peerConnManager4 = peerConnManager;
Log4jUtils.getInstance().debug(startorRestMediaCall);
Log4jUtils.getInstance().debug(DescribeInfo.START_ING);
Logger log4jUtils = Log4jUtils.getInstance();
StringBuilder sb = new StringBuilder("NewMedia_reqid reqid=");
sb.append(szRequestID);
sb.append(" resourceId:");
String str6 = str3;
sb.append(str6);
sb.append(" Size=");
sb.append(this.mWsShortLinkEventMap.size());
log4jUtils.debug(sb.toString());
for (Map.Entry<String, WsShortLinkEvent> entry : this.mWsShortLinkEventMap.entrySet()) {
Log4jUtils.getInstance().debug("NewMedia_reqid item-ResourceID=" + entry.getKey() + " shortLink=" + entry.getValue());
}
if (!wSVideoAuidoReqParam.isMulti() && this.mWsShortLinkEventMap.get(str6) == null) {
str5 = null;
peerConnManager2 = peerConnManager4;
str4 = startorRestMediaCall;
c = 0;
peerConnManager2.setNMediaWebsocket(createShortNMediaLink(szRequestID, str6, startorRestMediaCall, byRequestType, 0, false, false, wSVideoAuidoReqParam.isUseExtraUrl(), false));
} else {
peerConnManager2 = peerConnManager4;
str4 = startorRestMediaCall;
c = 0;
str5 = null;
if (!wSVideoAuidoReqParam.isMulti() && this.mWsShortLinkEventMap.get(str6) != null) {
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(str6);
if (wsShortLinkEvent.getWsLinkCloseEvent() != null && wsShortLinkEvent.getWsLinkCloseEvent().ishaverun()) {
wsShortLinkEvent.stop();
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP resourceid:" + str6);
peerConnManager2.setNMediaWebsocket(createShortNMediaLink(szRequestID, str6, str4, byRequestType, 0, false, false, wSVideoAuidoReqParam.isUseExtraUrl(), false));
} else if (wsShortLinkEvent.getWsLinkCloseEvent() != null) {
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP resourceid:" + str6);
wsShortLinkEvent.stop();
NMediaWebsocket nMediaWebsocket2 = wsShortLinkEvent.getNMediaWebsocket();
nMediaWebsocket2.getWebst().reqId = szRequestID;
nMediaWebsocket2.getNmediaevent().setReqId(szRequestID);
nMediaWebsocket2.getNotifyImp().setStreamopertype(byRequestType);
nMediaWebsocket2.getNotifyImp().setStreamPtz(0);
nMediaWebsocket2.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager2.setNMediaWebsocket(nMediaWebsocket2);
} else {
Log4jUtils.getInstance().debug(" NewMedia_reqid=" + szRequestID + " resourceId:" + str6);
}
}
z = false;
if (peerConnManager2.getNMediaWebsocket() != null) {
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_WEBSOCKET_NOT_CREATED, "websokcet for peerManager Not set", completionCallbackWith);
if (!wSVideoAuidoReqParam.isMulti() && SinglePeerCon.getStartreqid() != null) {
SinglePeerCon.setStartreqid(str5);
Log4jUtils.getInstance().debug(" NewMedia_reqid=" + szRequestID + " setStartreqid null");
}
if (ClogSDKCallback.isClogSDK()) {
?? r8 = str5;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", "websokcet for peerManager Not set >>" + new Throwable().getStackTrace()[c].getFileName() + "-" + new Throwable().getStackTrace()[c].getMethodName() + ":" + new Throwable().getStackTrace()[c].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_WEBSOCKET_NOT_CREATED), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), r8, new ClogSDKCallback.InvokeInfo(r8, new Throwable().getStackTrace()[c].getClassName(), new Throwable().getStackTrace()[c].getMethodName(), String.valueOf(new Throwable().getStackTrace()[c].getLineNumber())));
}
return;
}
peerConnect(peerConnManager2, wSVideoAuidoReqParam.getDegradePre(), wSVideoAuidoReqParam.getByVideoType(), wSVideoAuidoReqParam.getWidth(), wSVideoAuidoReqParam.getHeight(), completionCallbackWith, wSVideoAuidoReqParam.isUseExtraUrl(), wSVideoAuidoReqParam.getSzCallerID(), wSVideoAuidoReqParam.getSzCalleeID(), wSVideoAuidoReqParam.getisPauseSend(), wSVideoAuidoReqParam.getisPauseRecv(), wSVideoAuidoReqParam.getisEnableCamera());
if (!wSVideoAuidoReqParam.isMulti()) {
if (z) {
peerConnManager2.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
Log4jUtils.getInstance().warn("webSocketManagerImp connectNMWebsocket");
} else {
WebSocketManagerImp webst = peerConnManager2.getNMediaWebsocket().getWebst();
if (webst != null) {
peerConnManager2.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(true);
String str7 = str4;
if (!webst.Send(str7)) {
Log4jUtils.getInstance().warn("szWsMessage send failed, msg:" + str7);
webst.strMsg = str7;
}
} else {
Log4jUtils.getInstance().warn("webSocketManagerImp is null");
}
}
}
setSwappedFeeds(false, szRequestID);
return;
}
z = true;
if (peerConnManager2.getNMediaWebsocket() != null) {
}
}
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_REQ_RESOURCEID_NULL, "resourceId param is null", completionCallbackWith);
reqIdMapNullresourceId.add(szRequestID);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MediaCall", "resourceId param is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_RESOURCEID_NULL), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
}
public void m440x85f11edc(WSVideoAuidoReqParam wSVideoAuidoReqParam, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String str;
String str2;
String str3;
PeerConnManager peerConnManager;
int i;
PeerConnManager peerConnManager2;
String str4;
int i2;
String str5;
int i3;
String str6;
int i4;
WSServerConfig serverConfig;
synchronized (this) {
String szRequestID = wSVideoAuidoReqParam.getSzRequestID();
String szResourceID = wSVideoAuidoReqParam.getSzResourceID();
byte byRequestType = wSVideoAuidoReqParam.getByRequestType();
Log4jUtils.getInstance().debug("start videoaudioReq:" + wSVideoAuidoReqParam.toString());
if (skipMulti(wSVideoAuidoReqParam.mThirdReqParam.getnThirdReq(), szRequestID, wSVideoAuidoReqParam.getMaxSendBitrate(), completionCallbackWith)) {
if (szResourceID != null && !szResourceID.isEmpty()) {
if (9 == byRequestType && this.screenCapturer == null) {
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_SCREEN_NOT_CAPTURER, "screenCapturer param is null", completionCallbackWith);
return;
}
if (9 != byRequestType) {
stopPreviousStart(wSVideoAuidoReqParam, completionCallbackWith);
}
if (this.mPeerConnManagerMap.containsKey(szRequestID)) {
this.mPeerConnManagerMap.remove(szRequestID);
Log4jUtils.getInstance().debug(" remove reqId = " + szRequestID);
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.MsgBody msgBody = new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), wSVideoAuidoReqParam.toString(), "200", "success");
str3 = szResourceID;
str = "start_stop must paired appearance >>";
str2 = "eglbase is null >>";
ClogSDKCallback.CLoggerLOG(Level.DEBUG, msgBody.toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
} else {
str = "start_stop must paired appearance >>";
str2 = "eglbase is null >>";
str3 = szResourceID;
}
if (this.mPeerConnManagerMap.containsKey(szRequestID)) {
peerConnManager = null;
} else {
if (wSVideoAuidoReqParam.isUseExtraUrl()) {
serverConfig = ConfigParam.getServerConfig(true);
} else {
serverConfig = ConfigParam.getServerConfig(false);
}
if (isplatformreq) {
if (ObjJudge.isNull(serverConfig.getPlatform_szServerIP()) || ((!ObjJudge.isNull(serverConfig.getPlatform_szServerIP()) && serverConfig.getPlatform_szServerIP().isEmpty()) || serverConfig.getPlatform_nServerPort() == 0)) {
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_URL_ERR, "platform nmedia url err", completionCallbackWith);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", "platform nmedia url err >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_URL_ERR), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return;
}
this.szHostUrl = String.format("ws://%s:%d", serverConfig.getPlatform_szServerIP(), Integer.valueOf(serverConfig.getPlatform_nServerPort()));
} else {
if (!ObjJudge.isNull(serverConfig.getSzServerIP()) && ((ObjJudge.isNull(serverConfig.getSzServerIP()) || !serverConfig.getSzServerIP().isEmpty()) && serverConfig.getnServerPort() != 0)) {
if (serverConfig.getisWssServer()) {
this.szHostUrl = String.format("wss://%s:%d", serverConfig.getSzServerIP(), Integer.valueOf(serverConfig.getnServerPort()));
} else {
this.szHostUrl = String.format("ws://%s:%d", serverConfig.getSzServerIP(), Integer.valueOf(serverConfig.getnServerPort()));
}
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", "nmedia url err >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_URL_ERR), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_URL_ERR, "nmedia url err", completionCallbackWith);
return;
}
PeerConnManager peerConnManager3 = new PeerConnManager();
if (wSVideoAuidoReqParam.isMulti()) {
Log4jUtils.getInstance().debug("szHostUrl:" + this.szHostUrl);
NMediaWebsocket nMediaWebsocket = new NMediaWebsocket(new WebSocketManagerImp(MediaInstance.getMediaManager().getAppContext(), this.szHostUrl, 10, szRequestID), false);
nMediaWebsocket.getWebst().reqType = wSVideoAuidoReqParam.getByRequestType();
nMediaWebsocket.getNotifyImp().setStreamopertype(byRequestType);
nMediaWebsocket.getWebst().setNmedialog_to_platform(isKdcHacked);
nMediaWebsocket.getNmediaevent().setNmedialog_to_platform(isKdcHacked);
peerConnManager3.setNMediaWebsocket(nMediaWebsocket);
}
peerConnManager3.setRequestid(szRequestID);
peerConnManager3.setRequesttype(wSVideoAuidoReqParam.getByRequestType());
peerConnManager = peerConnManager3;
}
MediaInstance.getMediaManager().setMulti(szRequestID, wSVideoAuidoReqParam.isMulti());
if (ObjJudge.isNull(MediaInstance.getMediaManager().getEglBase()) && ObjJudge.isNull(wSVideoAuidoReqParam.getEglBase())) {
Log4jUtils.getInstance().warn("eglbase is null");
CallBack.errorReqResponse(szRequestID, -1, "eglbase is null", completionCallbackWith);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", str2 + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return;
}
if (ObjJudge.isNull(MediaInstance.getMediaManager().getEglBase()) && !ObjJudge.isNull(wSVideoAuidoReqParam.getEglBase())) {
MediaInstance.getMediaManager().setEglBase(wSVideoAuidoReqParam.getEglBase());
}
if (!wSVideoAuidoReqParam.isMulti() && 9 != byRequestType) {
if (SinglePeerCon.getStartreqid() == null) {
SinglePeerCon.setStartreqid(wSVideoAuidoReqParam.getSzRequestID());
} else {
Log4jUtils.getInstance().warn("start_stop must paired appearance");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", str + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf(-100), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorReqResponse(szRequestID, -100, "start_stop must paired appearance", completionCallbackWith);
return;
}
}
if (MediaInstance.getMediaManager().isEnableLogcat()) {
i = 0;
MediaInstance.getMediaManager().setEnableLogcat(false);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).start();
Log4jUtils.getInstance().info(AndroidPhone.getInstance(MediaInstance.getMediaManager().getAppContext()).getAllIp());
} else {
i = 0;
}
if ((byRequestType == 0 || 5 == byRequestType || 6 == byRequestType || 8 == byRequestType) && MediaInstance.getMediaManager().getVideoCapturer() == null) {
MediaInstance.getMediaManager().setVideoCapturer(createVideoCapturer(completionCallbackWith, szRequestID));
}
if (9 == byRequestType && this.screenCapturer != null) {
MediaInstance.getMediaManager().setScreenCapturer(this.screenCapturer);
}
if (!isKdcHacked && (2 == byRequestType || 4 == byRequestType || 6 == byRequestType || 8 == byRequestType)) {
Log4jUtils.getInstance().debug("start audioMode=" + getAudioMode());
if (new File(Log4jUtils.RTC_SET_INI).exists()) {
try {
} catch (IOException e) {
e.printStackTrace();
}
if (Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "enableVoice", IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)).intValue() == 0) {
i4 = i;
if (i4 != 0) {
setAudioMode(true);
}
Log4jUtils.getInstance().debug("start audioMode= MODE_NORMAL 1111");
}
}
i4 = 1;
if (i4 != 0) {
}
Log4jUtils.getInstance().debug("start audioMode= MODE_NORMAL 1111");
}
String msgManager = msgManager(byRequestType, wSVideoAuidoReqParam);
if (wSVideoAuidoReqParam.getLocalView() != null) {
MediaInstance.getMediaManager().setPipRenderer(wSVideoAuidoReqParam.getLocalView());
}
if (9 != byRequestType) {
HashMap hashMap = new HashMap();
hashMap.put(wSVideoAuidoReqParam.getSzCalleeID() != null ? wSVideoAuidoReqParam.getSzCalleeID() : "", wSVideoAuidoReqParam.getRemoteView());
peerConnManager = viewManager(peerConnManager, hashMap, null);
MediaInstance.getMediaManager().setIsFrontCam(true);
}
PeerConnManager peerConnManager4 = peerConnManager;
Log4jUtils.getInstance().debug(msgManager);
Log4jUtils.getInstance().debug(DescribeInfo.START_ING);
Logger log4jUtils = Log4jUtils.getInstance();
StringBuilder sb = new StringBuilder("NewMedia_reqid reqid=");
sb.append(szRequestID);
sb.append(" resourceId:");
String str7 = str3;
sb.append(str7);
sb.append(" Size=");
sb.append(this.mWsShortLinkEventMap.size());
log4jUtils.debug(sb.toString());
for (Map.Entry<String, WsShortLinkEvent> entry : this.mWsShortLinkEventMap.entrySet()) {
Log4jUtils.getInstance().debug("NewMedia_reqid item-ResourceID=" + entry.getKey() + " shortLink=" + entry.getValue());
}
if (!wSVideoAuidoReqParam.isMulti() && this.mWsShortLinkEventMap.get(szRequestID) == null) {
str5 = null;
str4 = msgManager;
peerConnManager2 = peerConnManager4;
i2 = i;
peerConnManager2.setNMediaWebsocket(createShortNMediaLink(szRequestID, szRequestID, msgManager, byRequestType, 0, false, false, wSVideoAuidoReqParam.isUseExtraUrl(), false));
} else {
peerConnManager2 = peerConnManager4;
str4 = msgManager;
i2 = i;
str5 = null;
if (!wSVideoAuidoReqParam.isMulti() && this.mWsShortLinkEventMap.get(szRequestID) != null) {
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(szRequestID);
if (wsShortLinkEvent.getWsLinkCloseEvent() != null && wsShortLinkEvent.getWsLinkCloseEvent().ishaverun()) {
wsShortLinkEvent.stop();
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP reqId:" + szRequestID);
peerConnManager2.setNMediaWebsocket(createShortNMediaLink(szRequestID, szRequestID, str4, byRequestType, 0, false, false, wSVideoAuidoReqParam.isUseExtraUrl(), false));
} else if (wsShortLinkEvent.getWsLinkCloseEvent() != null) {
Log4jUtils.getInstance().debug("wsShortLinkEvent --STOP-- reqId:" + szRequestID);
wsShortLinkEvent.stop();
NMediaWebsocket nMediaWebsocket2 = wsShortLinkEvent.getNMediaWebsocket();
nMediaWebsocket2.getWebst().reqId = szRequestID;
nMediaWebsocket2.getNmediaevent().setReqId(szRequestID);
nMediaWebsocket2.getNotifyImp().setStreamopertype(byRequestType);
nMediaWebsocket2.getNotifyImp().setStreamPtz(i2);
nMediaWebsocket2.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager2.setNMediaWebsocket(nMediaWebsocket2);
} else {
Log4jUtils.getInstance().debug(" NewMedia_reqid=" + szRequestID + " resourceId:" + str7);
}
}
i3 = i2;
if (peerConnManager2.getNMediaWebsocket() != null) {
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_START_WEBSOCKET_NOT_CREATED, "websokcet for peerManager Not set", completionCallbackWith);
if (!wSVideoAuidoReqParam.isMulti() && SinglePeerCon.getStartreqid() != null) {
SinglePeerCon.setStartreqid(str5);
Log4jUtils.getInstance().debug(" NewMedia_reqid=" + szRequestID + " setStartreqid null");
}
if (ClogSDKCallback.isClogSDK()) {
?? r8 = str5;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", "websokcet for peerManager Not set >>" + new Throwable().getStackTrace()[i2].getFileName() + "-" + new Throwable().getStackTrace()[i2].getMethodName() + ":" + new Throwable().getStackTrace()[i2].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_START_WEBSOCKET_NOT_CREATED), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), r8, new ClogSDKCallback.InvokeInfo(r8, new Throwable().getStackTrace()[i2].getClassName(), new Throwable().getStackTrace()[i2].getMethodName(), String.valueOf(new Throwable().getStackTrace()[i2].getLineNumber())));
}
return;
}
peerConnect(peerConnManager2, wSVideoAuidoReqParam.getDegradePre(), wSVideoAuidoReqParam.getByVideoType(), wSVideoAuidoReqParam.getWidth(), wSVideoAuidoReqParam.getHeight(), completionCallbackWith, wSVideoAuidoReqParam.isUseExtraUrl(), wSVideoAuidoReqParam.getSzCallerID(), wSVideoAuidoReqParam.getSzCalleeID(), wSVideoAuidoReqParam.getisPauseSend(), wSVideoAuidoReqParam.getisPauseRecv(), wSVideoAuidoReqParam.getisEnableCamera());
if (!wSVideoAuidoReqParam.isMulti()) {
if (i3 != 0) {
peerConnManager2.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
Log4jUtils.getInstance().warn("webSocketManagerImp connectNMWebsocket");
} else {
WebSocketManagerImp webst = peerConnManager2.getNMediaWebsocket().getWebst();
if (webst != null) {
peerConnManager2.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(true);
str6 = str4;
if (!webst.Send(str6)) {
Log4jUtils.getInstance().warn("szWsMessage send failed, msg:" + str6);
webst.strMsg = str6;
}
} else {
str6 = str4;
Log4jUtils.getInstance().warn("webSocketManagerImp is null");
}
if (!MediaInstance.getMediaManager().isMulti(szRequestID)) {
peerConnManager2.getNMediaWebsocket().getNotifyImp().setCallbackWithMap(callbackWithMap);
String str8 = wSVideoAuidoReqParam.strMapHistoryMsg;
if (str8 != null && (str8 == null || !str8.isEmpty())) {
peerConnManager2.getNMediaWebsocket().getWebst().strMsg = wSVideoAuidoReqParam.strMapHistoryMsg;
peerConnManager2.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
}
peerConnManager2.getNMediaWebsocket().getWebst().strMsg = str6;
peerConnManager2.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
} else {
setSwappedFeeds(false, szRequestID);
}
return;
}
}
str6 = str4;
if (!MediaInstance.getMediaManager().isMulti(szRequestID)) {
}
return;
}
i3 = 1;
if (peerConnManager2.getNMediaWebsocket() != null) {
}
}
CallBack.errorReqResponse(szRequestID, Constantsdef.CALLBACK_REQ_RESOURCEID_NULL, "resourceId param is null", completionCallbackWith);
reqIdMapNullresourceId.add(szRequestID);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "VideoAudioCall", "resourceId param is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_RESOURCEID_NULL), "error").toString(), ClogSDKCallback.getExistTraceId(szRequestID), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
}
public void printLog(LogLevel logLevel, String str, String str2) {
String str3 = str + " " + str2;
if (logLevel == LogLevel.TRACE) {
Log4jUtils.getInstance().trace(str3);
} else if (logLevel == LogLevel.DEBUG) {
Log4jUtils.getInstance().debug(str3);
} else if (logLevel == LogLevel.INFO) {
Log4jUtils.getInstance().info(str3);
} else if (logLevel == LogLevel.ERROR) {
Log4jUtils.getInstance().error(str3);
} else if (logLevel == LogLevel.FATAL) {
Log4jUtils.getInstance().fatal(str3);
}
}
public void reStartRecordPlayback(boolean z, boolean z2) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("isRecord:" + z + "isVoice:" + z2);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().reStartInOut(z, z2);
} else {
Log4jUtils.getInstance().warn("peerConnectionClient is null!");
}
}
public void recordRtcStream(final DownLoadReq downLoadReq, final WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
if (downLoadReq != null) {
Log4jUtils.getInstance().debug(downLoadReq.toString());
DownLoadReq.RecordType recordType = downLoadReq.getRecordType();
DownLoadReq.RecordType recordType2 = DownLoadReq.RecordType.STOP;
if (recordType == recordType2 && downLoadReq.getSaveFile() == null) {
Log4jUtils.getInstance().warn("loadReq stop, save file must contain");
CallBack.errorParam(completionCallbackWith, downLoadReq.getReuqestid(), 0, "loadReq stop, save file must contain");
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "StreamCtrl", "recordRtcStream requestid:" + downLoadReq.getReuqestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), downLoadReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(downLoadReq.getReuqestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
NMSStreamCtrlParam nMSStreamCtrlParam = new NMSStreamCtrlParam();
nMSStreamCtrlParam.setRequestId(downLoadReq.getReuqestid());
nMSStreamCtrlParam.setnCtrlType(Constantsdef.RTC_STREAMMSG_REC_VIDEO);
WebrtcAppRecOperate webrtcAppRecOperate = new WebrtcAppRecOperate();
if (downLoadReq.getRecordType() == DownLoadReq.RecordType.START) {
webrtcAppRecOperate.seteRecOperateType(1);
nMSStreamCtrlParam.setRecOperate(webrtcAppRecOperate);
rtcStreamOperate(nMSStreamCtrlParam, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
Log4jUtils.getInstance().debug(wSResponse.toString());
DownLoadResult downLoadResult = new DownLoadResult();
downLoadResult.setnErr(wSResponse.getnError());
downLoadResult.setDes(wSResponse.getSzErrorDescribe());
downLoadResult.setRequesid(wSResponse.getSzRequestID());
WebrtcCallback.CompletionCallbackWith completionCallbackWith2 = completionCallbackWith;
if (completionCallbackWith2 != null) {
completionCallbackWith2.onResult(downLoadResult);
}
}
});
return;
} else if (downLoadReq.getRecordType() == recordType2) {
webrtcAppRecOperate.seteRecOperateType(2);
nMSStreamCtrlParam.setRecOperate(webrtcAppRecOperate);
rtcStreamOperate(nMSStreamCtrlParam, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
Log4jUtils.getInstance().debug(wSResponse.toString());
new OkHttpDownUtil(wSResponse.getSzRequestID()).getDownRequest(wSResponse.getSzUrl(), downLoadReq.getSaveFile(), new OkHttpDownUtil.HttpDownListener() {
@Override
public void onFailure(IOException iOException) {
DownLoadResult downLoadResult = new DownLoadResult();
downLoadResult.setRequesid(downLoadReq.getReuqestid());
downLoadResult.setnErr(-1);
downLoadResult.setDes(iOException.toString());
WebrtcCallback.CompletionCallbackWith completionCallbackWith2 = completionCallbackWith;
if (completionCallbackWith2 != null) {
completionCallbackWith2.onResult(downLoadResult);
}
}
@Override
public void onResponse(Response response, long j, long j2) {
}
@Override
public void onSuccess(String str, String str2, long j, File file) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("requestid:" + str + " url:" + str2 + " totalLength:" + j);
DownLoadResult downLoadResult = new DownLoadResult();
downLoadResult.setRequesid(str);
downLoadResult.setnErr(0);
downLoadResult.setFile(file);
downLoadResult.setUrl(str2);
WebrtcCallback.CompletionCallbackWith completionCallbackWith2 = completionCallbackWith;
if (completionCallbackWith2 != null) {
completionCallbackWith2.onResult(downLoadResult);
}
}
});
}
});
return;
} else if (downLoadReq.getRecordType() == DownLoadReq.RecordType.CANCEL) {
webrtcAppRecOperate.seteRecOperateType(3);
nMSStreamCtrlParam.setRecOperate(webrtcAppRecOperate);
rtcStreamOperate(nMSStreamCtrlParam, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
Log4jUtils.getInstance().debug(wSResponse.toString());
DownLoadResult downLoadResult = new DownLoadResult();
downLoadResult.setnErr(wSResponse.getnError());
downLoadResult.setDes(wSResponse.getSzErrorDescribe());
downLoadResult.setRequesid(wSResponse.getSzRequestID());
WebrtcCallback.CompletionCallbackWith completionCallbackWith2 = completionCallbackWith;
if (completionCallbackWith2 != null) {
completionCallbackWith2.onResult(downLoadResult);
}
}
});
return;
} else {
return;
}
}
Log4jUtils.getInstance().warn("loadReq is null");
CallBack.errorParam(completionCallbackWith, "", 0, "loadReq is null");
}
public void recordSelfStream(WSVideoAuidoReqParam wSVideoAuidoReqParam, final NMSStreamCtrlParam nMSStreamCtrlParam, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
this.selfcallback = completionCallbackWith;
if (nMSStreamCtrlParam != null && nMSStreamCtrlParam.getRecOperate() != null) {
int i = nMSStreamCtrlParam.getRecOperate().geteRecOperateType();
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "StreamCtrl", "recordSelfStream requestid:" + nMSStreamCtrlParam.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(nMSStreamCtrlParam.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (i != 1) {
if (i == 3 || i == 2) {
rtcStreamOperate(nMSStreamCtrlParam, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
WebrtcCallback.CompletionCallbackWith completionCallbackWith2 = kedamedia.this.selfcallback;
if (completionCallbackWith2 != null) {
completionCallbackWith2.onResult(wSResponse);
kedamedia.this.selfcallback = null;
}
kedamedia.this.stopVideoAudioReq(nMSStreamCtrlParam.getRequestId(), (byte) 7, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse2) {
Log4jUtils.getInstance().debug(wSResponse2.toString());
}
});
}
});
new TimeOutCheck(PathInterpolatorCompat.MAX_NUM_POINTS, new TimeOutCheck.TimeOutNotify() {
@Override
public void onTimeOut() {
if (kedamedia.this.selfcallback != null) {
WSResponse wSResponse = new WSResponse();
wSResponse.setnError(-1);
wSResponse.setSzErrorDescribe("stop timeout");
kedamedia.this.selfcallback.onResult(wSResponse);
kedamedia kedamediaVar = kedamedia.this;
kedamediaVar.selfcallback = null;
kedamediaVar.stopVideoAudioReq(nMSStreamCtrlParam.getRequestId(), (byte) 7, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse2) {
Log4jUtils.getInstance().debug(wSResponse2.toString());
}
});
}
}
}).start();
return;
}
return;
} else if (wSVideoAuidoReqParam == null) {
WSResponse wSResponse = new WSResponse();
wSResponse.setnError(-1);
wSResponse.setSzErrorDescribe("param vaReq invalid");
WebrtcCallback.CompletionCallbackWith completionCallbackWith2 = this.selfcallback;
if (completionCallbackWith2 != null) {
completionCallbackWith2.onResult(wSResponse);
this.selfcallback = null;
}
Log4jUtils.getInstance().warn("param vaReq invalid");
return;
} else {
startVideoAudioReq(wSVideoAuidoReqParam, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse2) {
if (wSResponse2.getnError() == 0) {
kedamedia.this.rtcStreamOperate(nMSStreamCtrlParam, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse3) {
EnableStream enableStream = new EnableStream();
enableStream.setEnable(false);
enableStream.setRequestid(wSResponse3.getSzRequestID());
enableStream.setType("audio");
if (kedamedia.this.enableStream(enableStream)) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(wSResponse3.getSzRequestID() + " enableStream=" + enableStream.toString());
}
WebrtcCallback.CompletionCallbackWith completionCallbackWith3 = kedamedia.this.selfcallback;
if (completionCallbackWith3 != null) {
completionCallbackWith3.onResult(wSResponse3);
kedamedia.this.selfcallback = null;
}
}
});
}
}
});
new TimeOutCheck(PathInterpolatorCompat.MAX_NUM_POINTS, new TimeOutCheck.TimeOutNotify() {
@Override
public void onTimeOut() {
if (kedamedia.this.selfcallback != null) {
WSResponse wSResponse2 = new WSResponse();
wSResponse2.setnError(-1);
wSResponse2.setSzErrorDescribe("start timeout");
WebrtcCallback.CompletionCallbackWith completionCallbackWith3 = kedamedia.this.selfcallback;
if (completionCallbackWith3 != null) {
completionCallbackWith3.onResult(wSResponse2);
kedamedia.this.selfcallback = null;
}
kedamedia.this.stopVideoAudioReq(nMSStreamCtrlParam.getRequestId(), (byte) 7, new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse3) {
Log4jUtils.getInstance().debug(wSResponse3.toString());
}
});
}
}
}).start();
return;
}
}
WSResponse wSResponse2 = new WSResponse();
wSResponse2.setnError(-1);
wSResponse2.setSzErrorDescribe("param invalid");
WebrtcCallback.CompletionCallbackWith completionCallbackWith3 = this.selfcallback;
if (completionCallbackWith3 != null) {
completionCallbackWith3.onResult(wSResponse2);
this.selfcallback = null;
}
Log4jUtils.getInstance().warn("param invalid");
}
@Deprecated
public void releasesdk() {
}
public void removeConferenceMembers(MultiConferenceRemoveReq multiConferenceRemoveReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
Log4jUtils.getConference().debug("removeConferenceMembers start");
if (ObjJudge.isNull(multiConferenceRemoveReq)) {
CallBack.errorParam(completionCallbackWith, multiConferenceRemoveReq.getRequestId(), 1, "param removeReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "removeConferenceMembers param removeReq is null>>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(multiConferenceRemoveReq.getCallees()) && (ObjJudge.isNull(multiConferenceRemoveReq.getCallees()) || ObjJudge.valid(multiConferenceRemoveReq.getCallees()))) {
for (String str : multiConferenceRemoveReq.getCallees()) {
if (ObjJudge.isNull(str)) {
CallBack.errorParam(completionCallbackWith, multiConferenceRemoveReq.getRequestId(), 1, "removeReq callee param null");
return;
}
}
Log4jUtils.getConference().debug(multiConferenceRemoveReq.toString());
String requestId = multiConferenceRemoveReq.getRequestId();
String str2 = CommUtils.getUUID() + "-remove";
if (!ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient())) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestId);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, multiConferenceRemoveReq.getRequestId(), 1, "sessionId param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers removeReq sessionId param null requestid:" + multiConferenceRemoveReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceRemoveReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers requestid:" + multiConferenceRemoveReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), multiConferenceRemoveReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(multiConferenceRemoveReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestId);
if (ObjJudge.isNull(wsShortLinkEvent)) {
return;
}
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
String removeMembers = nMrtcMsg.removeMembers(g_cmdType, multiConferenceRemoveReq.getCallees(), str2, sessionId);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.containsKey(requestId) ? this.mPeerConnManagerMap.get(requestId) : null;
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (!ObjJudge.isNull(peerManager)) {
peerManager.getSdpObserver().setRequestid(requestId);
}
if (!ObjJudge.isNull(peerConnManager)) {
if (g_cmdType == CmdType.VIDEO_CALL) {
Map<String, View> remoteSurView = peerConnManager.getRemoteViewShow().getRemoteSurView();
for (String str3 : multiConferenceRemoveReq.getCallees()) {
View view = remoteSurView.get(str3);
if (peerConnManager.getRemoteViewShow().getRemoteSurView().containsKey(str3)) {
peerConnManager.getRemoteViewShow().getRemoteSurView().remove(str3);
}
if (!ObjJudge.isNull(view)) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote : peerConnManager.getRemoteViewShow().getRemoteProxySink()) {
if (proxyVideoSinkRemote.getCallee().equals(str3)) {
proxyVideoSinkRemote.setTarget(null);
}
}
Log4jUtils.getInstance().debug(" remove release callee=" + str3 + " view" + view);
if (view instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view).release();
} else if (view instanceof TextureViewRenderer) {
((TextureViewRenderer) view).release();
}
}
MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPcObserver().getVideoSinks().remove(str3);
}
}
SessionDescription remoteDescription = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPc().getRemoteDescription();
boolean z = false;
for (String str4 : multiConferenceRemoveReq.getCallees()) {
Log4jUtils.getConference().debug("remove cll=" + str4);
if (!ObjJudge.isNull(str4)) {
remoteDescription = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPc().inactiveRemoteDescription(remoteDescription, str4);
}
z = true;
}
if (z) {
Log4jUtils.getConference().debug("remoteSdp = " + remoteDescription.description);
MediaInstance.getMediaManager().getPeerConnectionClient().setRemoteDescription(requestId, null, remoteDescription);
}
if (nMediaWebsocket != null) {
nMediaWebsocket.getNmediaevent().putRemoveCallback(str2, completionCallbackWith);
nMediaWebsocket.getWebst().Send(removeMembers);
}
for (String str5 : multiConferenceRemoveReq.getCallees()) {
this.conference_callees.remove(str5);
}
Log4jUtils.getConference().debug("removeConferenceMembers end");
return;
}
CallBack.errorParam(completionCallbackWith, multiConferenceRemoveReq.getRequestId(), 1, "peerConnManager param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers removeReq peerConnManager param null requestid:" + multiConferenceRemoveReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceRemoveReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, multiConferenceRemoveReq.getRequestId(), 1, "pcClient param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers removeReq getPeerConnectionClient param null requestid:" + multiConferenceRemoveReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceRemoveReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
CallBack.errorParam(completionCallbackWith, multiConferenceRemoveReq.getRequestId(), 1, "removeReq calleeMap param null or empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "addConferenceMembers removeReq calleeMap param null or empty requestid:" + multiConferenceRemoveReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceRemoveReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public void removeSFUMembers(SFUModeMembersReq sFUModeMembersReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
Log4jUtils.getConference().debug("removeSFUMembers start");
if (ObjJudge.isNull(sFUModeMembersReq)) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "param removeReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "removeSFUMembers param removeReq is null>>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(sFUModeMembersReq.getCalleeList()) && ObjJudge.valid(sFUModeMembersReq.getCalleeList())) {
for (String str : sFUModeMembersReq.getCalleeList()) {
if (ObjJudge.isNull(str)) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "removeReq callee param null");
return;
}
}
Log4jUtils.getConference().debug(sFUModeMembersReq.toString());
String requestId = sFUModeMembersReq.getRequestId();
String str2 = CommUtils.getUUID() + "-remove";
if (!ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient())) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestId);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "sessionId param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers removeReq sessionId param null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), sFUModeMembersReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestId);
if (ObjJudge.isNull(wsShortLinkEvent)) {
return;
}
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
String removeSFUMembers = nMrtcMsg.removeSFUMembers(g_cmdType, sFUModeMembersReq.getCalleeList(), str2, sessionId);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.containsKey(requestId) ? this.mPeerConnManagerMap.get(requestId) : null;
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (!ObjJudge.isNull(peerManager)) {
peerManager.getSdpObserver().setRequestid(requestId);
}
if (!ObjJudge.isNull(peerConnManager)) {
Map<String, View> remoteSurView = peerConnManager.getRemoteViewShow().getRemoteSurView();
for (String str3 : sFUModeMembersReq.getCalleeList()) {
View view = remoteSurView.get(str3);
if (peerConnManager.getRemoteViewShow().getRemoteSurView().containsKey(str3)) {
peerConnManager.getRemoteViewShow().getRemoteSurView().remove(str3);
}
if (!ObjJudge.isNull(view)) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote : peerConnManager.getRemoteViewShow().getRemoteProxySink()) {
if (proxyVideoSinkRemote.getCallee().equals(str3)) {
proxyVideoSinkRemote.setTarget(null);
}
}
Log4jUtils.getInstance().debug(" remove release callee=" + str3 + " view" + view);
if (view instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view).release();
} else if (view instanceof TextureViewRenderer) {
((TextureViewRenderer) view).release();
}
}
MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPcObserver().getVideoSinks().remove(str3);
}
SessionDescription remoteDescription = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPc().getRemoteDescription();
boolean z = false;
for (String str4 : sFUModeMembersReq.getCalleeList()) {
Log4jUtils.getConference().debug("remove cll=" + str4);
if (!ObjJudge.isNull(str4)) {
remoteDescription = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPc().inactiveRemoteDescription(remoteDescription, str4);
}
z = true;
}
if (z) {
Log4jUtils.getConference().debug("remoteSdp = " + remoteDescription.description);
MediaInstance.getMediaManager().getPeerConnectionClient().setRemoteDescription(requestId, null, remoteDescription);
}
if (nMediaWebsocket != null) {
nMediaWebsocket.getNmediaevent().putRemoveCallback(str2, completionCallbackWith);
nMediaWebsocket.getWebst().Send(removeSFUMembers);
}
for (String str5 : sFUModeMembersReq.getCalleeList()) {
this.conference_callees.remove(str5);
}
Log4jUtils.getConference().debug("removeSFUMembers end");
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "peerConnManager param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addConferenceMembers removeReq peerConnManager param null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "pcClient param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers removeReq getPeerConnectionClient param null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "removeReq getCalleeList param null or empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers removeReq getCalleeList param null or empty requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public boolean removeWebrtcCallback(String str) {
CallBack.removeCompletionCallback(str);
return true;
}
public boolean responseMsgToPlatForm(ResponseToPlatForm responseToPlatForm) {
String responseToFlatForm;
if (this.platformManger == null) {
Log4jUtils.getInstance().warn(" platformManger is null");
return false;
}
switch (responseToPlatForm.getnResponseType()) {
case Constantsdef.RESPONSE_DEV_TO_PLATFORM_GETLIST:
case Constantsdef.RESPONSE_DEV_TO_PLATFORM_LIVE:
case Constantsdef.RESPONSE_DEV_TO_PLATFORM_AUDIOCALL:
responseToFlatForm = nMrtcMsg.responseToFlatForm(responseToPlatForm);
break;
default:
responseToFlatForm = null;
break;
}
Log4jUtils.getInstance().debug(responseToFlatForm);
if (!this.platformManger.getWebsocket().getWebst().Send(responseToFlatForm)) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.error(responseToPlatForm.mResponse.getsSessionId() + DescribeInfo.WS_SENDFAILED);
WakeLock.releaseWakeLock();
return false;
}
WakeLock.releaseWakeLock();
return true;
}
public boolean restMedaiCallReq(final WSVideoAuidoReqParam wSVideoAuidoReqParam, final WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
if (!Log4jUtils.fileCreated) {
Log4jUtils.getInstance(MediaInstance.getMediaManager().getGlobalLogPath(), appName);
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(" start begin fileCreated=" + Log4jUtils.fileCreated);
executor.execute(new Runnable() {
@Override
public final void run() {
kedamedia.this.m438xd672e6f9(wSVideoAuidoReqParam, completionCallbackWith);
}
});
Log4jUtils.getInstance().debug(DescribeInfo.START_END);
return true;
}
public boolean rtcStreamOperate(NMSStreamCtrlParam nMSStreamCtrlParam, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String realTimeRecVideo;
String requestId;
String str;
int i;
int i2;
String str2;
boolean z;
int i3;
Log4jUtils.getInstance().debug("ctrlParam:" + nMSStreamCtrlParam.toString());
synchronized (this) {
int i4 = nMSStreamCtrlParam.getRecOperate().geteRecOperateType();
if (nMSStreamCtrlParam.getnCtrlType() == 20006) {
if (nMSStreamCtrlParam.getPTZCtrl() != null) {
String ctrlPtz = nMrtcMsg.ctrlPtz(nMSStreamCtrlParam.getPTZCtrl());
requestId = nMSStreamCtrlParam.getPTZCtrl().getrequestId();
str = ctrlPtz;
i = 20006;
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "ptz ctrl is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "-1", "error").toString(), ClogSDKCallback.getExistTraceId(null), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, null, 0, "ptz ctrl is null");
return false;
}
} else {
if (nMSStreamCtrlParam.getnCtrlType() == 20004) {
if (nMSStreamCtrlParam.getRecOperate() != null) {
if (i4 != 0 && i4 != 1 && i4 != 3) {
if (i4 != 2 && i4 != 4 && i4 != 5) {
realTimeRecVideo = null;
requestId = nMSStreamCtrlParam.getRecOperate().getrequestId();
}
realTimeRecVideo = nMrtcMsg.recordStopOperate(nMSStreamCtrlParam.getRecOperate());
requestId = nMSStreamCtrlParam.getRecOperate().getrequestId();
}
realTimeRecVideo = nMrtcMsg.recordStartOperate(nMSStreamCtrlParam.getRecOperate(), MediaInstance.getMediaManager().getAppContext(), nMSStreamCtrlParam.isUseExtraUrl());
requestId = nMSStreamCtrlParam.getRecOperate().getrequestId();
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "rec operate is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "-1", "error").toString(), ClogSDKCallback.getExistTraceId(null), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, null, 0, "rec operate is null");
return false;
}
} else if (nMSStreamCtrlParam.getnCtrlType() == 20005) {
if (nMSStreamCtrlParam.getPlayCtrl() != null) {
String recPlayCtrl = nMrtcMsg.recPlayCtrl(nMSStreamCtrlParam.getPlayCtrl());
String str3 = nMSStreamCtrlParam.getPlayCtrl().getrequestId();
if (nMSStreamCtrlParam.getPlayCtrl().getePlayCtrlType() == 2) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str3);
if (peerConnManager == null) {
Log4jUtils.getInstance().warn("peerConnManager is null and requestid:" + str3);
} else {
RemoteViewShow remoteViewShow = peerConnManager.getRemoteViewShow();
if (remoteViewShow == null) {
Log4jUtils.getInstance().warn("remoteViewShow is null and requestid:" + str3);
} else {
List<ProxyVideoSinkRemote> remoteProxySink = remoteViewShow.getRemoteProxySink();
if (remoteProxySink != null) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote : remoteProxySink) {
proxyVideoSinkRemote.isRemoteSave = true;
proxyVideoSinkRemote.requestId = str3;
proxyVideoSinkRemote.saveBitmapCallback = new WebrtcCallback.CompletionCallbackWith() {
@Override
public void onResult(Object obj) {
if (obj == null) {
return;
}
BitmapInfo bitmapInfo = (BitmapInfo) obj;
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("zlp111zlp PLAY_CTRL_PAUSE bitmap size:" + kedamedia.this.saveBitmap.size() + " requestid:" + bitmapInfo.getStrRequestId() + " " + bitmapInfo.getBitmap().toString());
if (kedamedia.this.saveBitmap.containsKey(bitmapInfo.getStrRequestId())) {
kedamedia.this.saveBitmap.get(bitmapInfo.getStrRequestId()).recycle();
}
kedamedia.this.saveBitmap.put(bitmapInfo.getStrRequestId(), bitmapInfo.getBitmap());
}
};
}
} else {
Log4jUtils.getInstance().warn("remoteSinkList is null");
}
}
}
} else {
PeerConnManager peerConnManager2 = this.mPeerConnManagerMap.get(str3);
if (peerConnManager2 == null) {
Log4jUtils.getInstance().warn("peerConnManager is null and requestid:" + str3);
} else {
RemoteViewShow remoteViewShow2 = peerConnManager2.getRemoteViewShow();
if (remoteViewShow2 == null) {
Log4jUtils.getInstance().warn("remoteViewShow is null and requestid:" + str3);
} else {
List<ProxyVideoSinkRemote> remoteProxySink2 = remoteViewShow2.getRemoteProxySink();
if (remoteProxySink2 != null) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote2 : remoteProxySink2) {
proxyVideoSinkRemote2.isRemoteSave = false;
proxyVideoSinkRemote2.requestId = "";
proxyVideoSinkRemote2.saveBitmapCallback = null;
}
} else {
Log4jUtils.getInstance().warn("remoteSinkList is null");
}
}
}
Log4jUtils.getInstance().warn("zlp111zlp bitmap PLAY_CTRL_other size:" + this.saveBitmap.size());
if (this.saveBitmap.containsKey(str3)) {
this.saveBitmap.get(str3).recycle();
this.saveBitmap.remove(str3);
}
Log4jUtils.getInstance().warn("zlp111zlp bitmap PLAY_CTRL_RESUME1 size:" + this.saveBitmap.size());
}
if (callbackWithMap.containsKey(str3 + Constantsdef.RTC_STREAMMSG_REC_PLAY_CTRL)) {
callbackWithMap.remove(str3 + Constantsdef.RTC_STREAMMSG_REC_PLAY_CTRL);
}
callbackWithMap.put(str3 + Constantsdef.RTC_STREAMMSG_REC_PLAY_CTRL, completionCallbackWith);
str = recPlayCtrl;
requestId = str3;
i = 0;
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "play ctrl is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "-1", "error").toString(), ClogSDKCallback.getExistTraceId(null), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, null, 0, "play ctrl is null");
return false;
}
} else if (nMSStreamCtrlParam.getnCtrlType() == 20007) {
if (nMSStreamCtrlParam.getRequestId() != null) {
realTimeRecVideo = nMrtcMsg.recReverseCtrl(nMSStreamCtrlParam.getRequestId());
requestId = nMSStreamCtrlParam.getRequestId();
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "request id is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "-1", "error").toString(), ClogSDKCallback.getExistTraceId(null), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, null, 0, "request id is null");
return false;
}
} else if (nMSStreamCtrlParam.getnCtrlType() == 20008) {
if (nMSStreamCtrlParam.getRequestId() != null) {
realTimeRecVideo = nMrtcMsg.realTimeRecVideo(i4, nMSStreamCtrlParam.getRequestId(), nMSStreamCtrlParam.isUseExtraUrl());
requestId = nMSStreamCtrlParam.getRequestId();
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "request id is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "-1", "error").toString(), ClogSDKCallback.getExistTraceId(null), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, null, 0, "request id is null");
return false;
}
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "ctrl type is error >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "-1", "error").toString(), ClogSDKCallback.getExistTraceId(null), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, null, 0, "ctrl type is error");
return false;
}
str = realTimeRecVideo;
i = 0;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "ctrlParam >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), nMSStreamCtrlParam.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(requestId), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getInstance().debug("rtcStreamOperate reqId:" + requestId);
Log4jUtils.getInstance().debug("szMesg:" + str);
if (callbackWithMap.get(requestId + Constantsdef.RTC_STREAMMSG_REC_PLAY_CTRL) == null) {
callbackWithMap.put(requestId, completionCallbackWith);
} else {
Log4jUtils.getInstance().debug("current oper type:20005");
}
if (i4 == 1 && 20008 != nMSStreamCtrlParam.getnCtrlType()) {
nMSStreamCtrlParam.getVideoAuidoReqParam().strMapHistoryMsg = str;
nMSStreamCtrlParam.getVideoAuidoReqParam().setByRequestType((byte) 1);
startVideoAudioReq(nMSStreamCtrlParam.getVideoAuidoReqParam(), new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
}
});
} else {
if (i4 == 2 && 20008 != nMSStreamCtrlParam.getnCtrlType()) {
nMSStreamCtrlParam.getVideoAuidoReqParam().mThirdReqParam.strMapHistoryMsg = str;
setThirdParam(nMSStreamCtrlParam.getVideoAuidoReqParam().mThirdReqParam);
nMSStreamCtrlParam.getVideoAuidoReqParam().setByRequestType((byte) 2);
stopVideoAudioReq(nMSStreamCtrlParam.getVideoAuidoReqParam().getSzRequestID(), nMSStreamCtrlParam.getVideoAuidoReqParam().getByRequestType(), new WebrtcCallback.CompletionCallbackWith<WSResponse>() {
@Override
public void onResult(WSResponse wSResponse) {
}
});
}
if ((i4 == 3 || i4 == 5 || i4 == 4 || i4 == 0) && nMSStreamCtrlParam.getnCtrlType() == 20004) {
String str4 = nMSStreamCtrlParam.getRecOperate().getrequestId();
if (callbackWithMap.containsKey(str4)) {
if (i4 == 3) {
callbackWithMap.remove(str4);
} else {
i2 = 3;
if (i4 == i2) {
callbackWithMap.put(str4, completionCallbackWith);
}
str2 = nMSStreamCtrlParam.getRecOperate().getresourceId();
Log4jUtils.getInstance().debug("reqestid_his:" + str4 + " resourceid:" + str2);
if (this.mWsShortLinkEventMap.get(str2) == null) {
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(str2);
boolean isDisconnect = (wsShortLinkEvent.getNMediaWebsocket() == null || wsShortLinkEvent.getNMediaWebsocket().getWebst() == null) ? false : wsShortLinkEvent.getNMediaWebsocket().getWebst().isDisconnect();
if (wsShortLinkEvent.getWsLinkCloseEvent() != null && (isDisconnect || wsShortLinkEvent.getWsLinkCloseEvent().ishaverun())) {
wsShortLinkEvent.stop();
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP resourceid:" + str2);
int i5 = i2;
createShortNMediaLink(str4, str2, str, i4, i, false, true, nMSStreamCtrlParam.isUseExtraUrl(), false);
if (this.mWsShortLinkEventMap.get(str2) != null) {
this.mWsShortLinkEventMap.get(str2).getNMediaWebsocket().getWebst().reqType = i4;
}
if (i4 == i5 && nMSStreamCtrlParam.getRecOperate().getnTransferChunked() == 0) {
this.mWsShortLinkEventMap.get(str2).start(SHORTLINK_DELAY_SEEMAP_HISDOWN);
} else {
this.mWsShortLinkEventMap.get(str2).start(30);
}
} else {
int i6 = i2;
if (wsShortLinkEvent.getWsLinkCloseEvent() != null) {
Log4jUtils.getInstance().debug("wsShortLinkEvent STOP resourceid:" + str2);
wsShortLinkEvent.stop();
if (i4 == i6 && nMSStreamCtrlParam.getRecOperate().getnTransferChunked() == 0) {
wsShortLinkEvent.start(SHORTLINK_DELAY_SEEMAP_HISDOWN);
} else {
wsShortLinkEvent.start(30);
}
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
nMediaWebsocket.getWebst().reqId = str4;
nMediaWebsocket.getWebst().reqType = i4;
nMediaWebsocket.getNmediaevent().setReqId(str4);
nMediaWebsocket.getNotifyImp().setStreamopertype(i4);
nMediaWebsocket.getNotifyImp().setStreamPtz(i);
if (nMSStreamCtrlParam.getRecOperate().getnTransferChunked() == 1) {
nMediaWebsocket.getNotifyImp().setisTransfer_chunked(true);
}
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
if (!nMediaWebsocket.getWebst().Send(str)) {
Log4jUtils.getInstance().warn("szWsMessage send failed, msg:" + str);
nMediaWebsocket.getWebst().strMsg = str;
}
z = true;
}
}
i3 = 5;
z = true;
if (i4 != i3 && i4 != 4) {
if (i4 != 3) {
disconnecMapWs(15, str4);
}
}
disconnecMapWs(2, str4);
} else {
z = true;
createShortNMediaLink(str4, str2, str, i4, i, false, true, nMSStreamCtrlParam.isUseExtraUrl(), false);
if (this.mWsShortLinkEventMap.get(str2) != null) {
WsShortLinkEvent wsShortLinkEvent2 = this.mWsShortLinkEventMap.get(str2);
wsShortLinkEvent2.getNMediaWebsocket().getWebst().reqType = i4;
if (nMSStreamCtrlParam.getRecOperate().getnTransferChunked() == 1) {
wsShortLinkEvent2.getNMediaWebsocket().getNotifyImp().setisTransfer_chunked(true);
}
}
if (i4 == 3 && nMSStreamCtrlParam.getRecOperate().getnTransferChunked() == 0) {
this.mWsShortLinkEventMap.get(str2).start(SHORTLINK_DELAY_SEEMAP_HISDOWN);
} else {
this.mWsShortLinkEventMap.get(str2).start(30);
}
}
i3 = 5;
if (i4 != i3) {
if (i4 != 3) {
}
}
disconnecMapWs(2, str4);
}
}
i2 = 3;
if (i4 == i2) {
}
str2 = nMSStreamCtrlParam.getRecOperate().getresourceId();
Log4jUtils.getInstance().debug("reqestid_his:" + str4 + " resourceid:" + str2);
if (this.mWsShortLinkEventMap.get(str2) == null) {
}
i3 = 5;
if (i4 != i3) {
}
disconnecMapWs(2, str4);
} else {
z = true;
PeerConnManager peerConnManager3 = this.mPeerConnManagerMap.get(requestId);
if (peerConnManager3 == null) {
Log4jUtils.getInstance().warn("peerConnManager is null and requestid:" + requestId);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "peerConnManager is null and requestid:" + requestId + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(requestId), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
CallBack.errorParam(completionCallbackWith, requestId, 0, "peerConnManager is null");
return false;
}
peerConnManager3.getNMediaWebsocket().getNotifyImp().setCallbackWithMap(callbackWithMap);
if (!peerConnManager3.getNMediaWebsocket().getWebst().Send(str)) {
Log4jUtils.getInstance().error(requestId + peerConnManager3.getNMediaWebsocket().getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
peerConnManager3.getNMediaWebsocket().getWebst().strMsg = str;
}
}
return z;
}
z = true;
return z;
}
}
public void setAudioEnable(String str, String str2, boolean z) {
PeerManager peerManager = !ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient()) ? MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(str) : null;
if (ObjJudge.isNull(peerManager)) {
return;
}
for (AudioTrack audioTrack : peerManager.getRemoteAudioTrack()) {
if (audioTrack.id().endsWith(str2)) {
audioTrack.setEnabled(z);
}
}
}
public void setAudioFileAsCapture(String str, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String str2 = Log4jUtils.PCM_FILE;
MCDecoderAudio mCDecoderAudio = new MCDecoderAudio();
ShareDataUtils.setSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AUDIO_FILE_CHANNELS, 0);
ShareDataUtils.setSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AUDIO_FILE_SAMPLERATE, 0);
File file = new File(Log4jUtils.PCM_FILE);
if (file.exists()) {
file.delete();
}
mCDecoderAudio.decodeAudio(str, str2, completionCallbackWith);
}
public void setAudioMode(boolean z) {
AudioManager audioManager = (AudioManager) MediaInstance.getMediaManager().getAppContext().getSystemService("audio");
if (z) {
reStartRecordPlayback(false, true);
if (audioManager.getMode() != 3) {
audioManager.setMode(3);
return;
}
return;
}
reStartRecordPlayback(false, false);
if (audioManager.getMode() != 0) {
audioManager.setMode(0);
}
}
public boolean setCallMute(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setCallMute :" + z);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().setSpeakerMute(z);
return true;
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return true;
}
public boolean setCameraEnable(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setCameraEnable :" + z);
if (MediaInstance.getMediaManager().getPeerConnectionClient() == null) {
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return true;
} else if (z) {
MediaInstance.getMediaManager().getPeerConnectionClient().startVideoSource();
return true;
} else {
MediaInstance.getMediaManager().getPeerConnectionClient().stopVideoSource();
return true;
}
}
public boolean setClogSDKCallback(ClogSDKCallback.ClogSDKCallbackWith clogSDKCallbackWith) {
ClogSDKCallback.clogCallback = clogSDKCallbackWith;
return true;
}
public boolean setHandsFree(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setHandsFree :" + z);
AudioManager audioManager = (AudioManager) MediaInstance.getMediaManager().getAppContext().getSystemService("audio");
if (audioManager != null) {
audioManager.setSpeakerphoneOn(z);
}
if (!z && MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().reStartAudioRecording();
Log4jUtils.getInstance().debug("audio_set restart audio record ");
}
Log4jUtils.getInstance().debug("setHandsFree end:");
return true;
}
public boolean setHumansegPath(String str, int i) {
return MediaInstance.getMediaManager().getPeerConnectionClient().setHumansegPath(str, i);
}
public boolean setHumansegPreview(boolean z, int i) {
return MediaInstance.getMediaManager().getPeerConnectionClient().setHumansegPreview(z, i);
}
public boolean setHumansegState(boolean z, int i) {
return MediaInstance.getMediaManager().getPeerConnectionClient().setHumansegState(z, i);
}
public boolean setMicEnable(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setMicEnable :" + z);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().setAudioEnabled(!z);
MediaInstance.getMediaManager().getPeerConnectionClient();
if (PeerConnectionClient.getCommSource().getAdm() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
PeerConnectionClient.getCommSource().getAdm().setMicrophoneMute(z);
return true;
}
Log4jUtils.getInstance().warn("adm is null");
return true;
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return true;
}
public void setNativeLogLevel(Logging.Severity severity) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("enAblePeerNative level=" + severity);
if (severity != null) {
ShareDataUtils.setSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, Constantsdef.RTC_ENABLE_NATIVE_LOG, severity.ordinal());
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
if (PeerConnectionClient.getCommSource() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
if (PeerConnectionClient.getCommSource().getFactory() != null) {
setNativeLogLevel();
}
}
}
}
public void setOnTouch(boolean z) {
}
public void setOsdBmp(Bitmap bitmap, int i, int i2) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("OSDEXT setOsdBmp xPos=" + i + " yPos=" + i2);
if (bitmap == null) {
return;
}
this.g_bmpWidth = bitmap.getWidth();
this.g_bmpHeight = bitmap.getHeight();
if (this.g_bmpWidth % 4 == 0 && i2 >= 0 && i >= 0) {
if (i > this.videoHeight - bitmap.getWidth()) {
i = this.videoHeight - bitmap.getWidth();
}
if (i2 > this.videoWidth - bitmap.getHeight()) {
i2 = this.videoWidth - bitmap.getHeight();
}
this.g_bmp = bitmap;
this.g_xPos = i;
this.g_yPos = i2;
return;
}
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.error("OSDEXT W/H % 4 must == 0 or X/Ypos must >= 0 g_bmpWidth=" + this.g_bmpWidth + " g_bmpHeight=" + this.g_bmpHeight);
}
public boolean setRegisterConfig(WSDevJoinUpMagReqParam wSDevJoinUpMagReqParam) {
ConfigParam.setRegisterConfig(wSDevJoinUpMagReqParam);
return true;
}
public boolean setServerConfig(WSServerConfig wSServerConfig) {
if (!Log4jUtils.fileCreated) {
Log4jUtils.getInstance(MediaInstance.getMediaManager().getGlobalLogPath(), appName);
}
ConfigParam.setServerConfig(wSServerConfig);
String platformurl = ConfigParam.getPlatformurl();
this.szHostUrl = ConfigParam.getNmwsurl();
this.szExtraUrl = ConfigParam.getExtranmwsurl();
isKdcHacked = ConfigParam.isIsKdcHacked();
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("--szHostUrl=" + this.szHostUrl + " szExtraUrl=" + this.szExtraUrl + " platform_url=" + platformurl);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "Config", "setServerConfig isKdcHacked:" + isKdcHacked + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), wSServerConfig.toString(), "200", "success").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (ConfigParam.isIs_platform_ConfigChange() && wSServerConfig.getnConfigType() == 9001) {
if (!ObjJudge.isNull(this.platformManger) && !ObjJudge.isNull(platformurl)) {
PlatformWebsocket websocket = this.platformManger.getWebsocket();
if (websocket == null) {
Log4jUtils.getInstance().warn("platformWebsocket is null");
return false;
}
websocket.closePlatformWebsocket();
this.platformManger.setWebsocket(new PlatformWebsocket(new WebSocketManagerImp(MediaInstance.getMediaManager().getAppContext(), platformurl, 10, Constantsdef.WS_LINK_PLATFORM)));
Log4jUtils.getInstance().debug("setServerConfig incoming set platformManger...");
PlatformHB.getInstance().setWsImp(this.platformManger.getWebsocket().getWebst());
return true;
}
Log4jUtils.getInstance().warn("link_platform platformManger is null ");
return true;
}
return true;
}
public boolean setSpeakMute(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setSpeakMute :" + z);
setCallMute(z);
return true;
}
public void setSslCertificate(InputStream inputStream) {
this.m_streamCertificate = inputStream;
}
public boolean setStartRecv(String str) {
Log4jUtils.getInstance().debug("accept start recv");
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(str);
if (peerManager != null) {
peerManager.getPcObserver().setEnablePauseRecv(false);
}
MediaInstance.getMediaManager().getPeerConnectionClient().enableRecvStream(str, "video", true);
MediaInstance.getMediaManager().getPeerConnectionClient().enableRecvStream(str, "audio", true);
} else {
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
return true;
}
public boolean setStartSend() {
Log4jUtils.getInstance().debug("accept start send");
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().setAudioEnabled(true);
MediaInstance.getMediaManager().getPeerConnectionClient().setVideoEnabled(true);
} else {
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
return true;
}
public void setSwappedFeeds(boolean z, String str) {
Map<String, View> map;
List<ProxyVideoSinkRemote> list;
VideoSink videoSink;
VideoSink videoSink2;
Log4jUtils.getInstance().debug("setSwappedFeeds: " + z + " multi:" + MediaInstance.getMediaManager().isMulti(str));
Log4jUtils.getInstance().debug("mPeerConnManagerMap size:" + this.mPeerConnManagerMap.size() + " reqId:" + str);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (peerConnManager == null) {
Log4jUtils.getInstance().warn("peerConnManager is null requestid:" + str);
return;
}
int requesttype = peerConnManager.getRequesttype();
RemoteViewShow remoteViewShow = peerConnManager.getRemoteViewShow();
if (remoteViewShow != null) {
map = remoteViewShow.getRemoteSurView();
list = remoteViewShow.getRemoteProxySink();
} else {
map = null;
list = null;
}
if (list != null && list.size() == 1) {
this.remoteSink = list.get(0);
if (map != null && map.size() == 1) {
ProxyVideoSinkRemote proxyVideoSinkRemote = this.remoteSink;
if (proxyVideoSinkRemote != null) {
this.remoteView = map.get(proxyVideoSinkRemote.getCallee());
} else {
for (String str2 : map.keySet()) {
this.remoteView = map.get(str2);
}
}
Log4jUtils.getInstance().debug("requesttype:" + requesttype + " pip:" + MediaInstance.getMediaManager().getPipRenderer());
if (MediaInstance.getMediaManager().getPipRenderer() != null && this.remoteView != null && (requesttype == 5 || requesttype == 6)) {
ProxyVideoSinkLocal localProxyVideoSink = MediaInstance.getMediaManager().getLocalProxyVideoSink();
if (z) {
View view = this.remoteView;
videoSink = view instanceof SurfaceViewRenderer ? (SurfaceViewRenderer) view : (TextureViewRenderer) view;
} else {
videoSink = MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer ? (SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer() : (TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer();
}
localProxyVideoSink.setTarget(videoSink);
ProxyVideoSinkRemote proxyVideoSinkRemote2 = this.remoteSink;
if (z) {
videoSink2 = MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer ? (SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer() : (TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer();
} else {
View view2 = this.remoteView;
videoSink2 = view2 instanceof SurfaceViewRenderer ? (SurfaceViewRenderer) view2 : (TextureViewRenderer) view2;
}
proxyVideoSinkRemote2.setTarget(videoSink2);
View view3 = this.remoteView;
if (view3 instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view3).setMirror(false);
} else if (view3 instanceof TextureViewRenderer) {
((TextureViewRenderer) view3).setMirror(false);
}
Log4jUtils.getInstance().debug("set both view isSwappedFeeds:" + z + " pipRender:" + MediaInstance.getMediaManager().getPipRenderer());
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
MediaInstance.getMediaManager().getPipRenderer().setVisibility(0);
Log4jUtils.getInstance().debug("set pipRenderer VISIBLE");
} else {
Log4jUtils.getInstance().warn(DescribeInfo.VIEW_LOCAL_ISNULL);
}
View view4 = kedamedia.this.remoteView;
if (view4 != null) {
view4.setVisibility(0);
Log4jUtils.getInstance().debug("set remoteSurViewMap-id:VISIBLE");
return;
}
Log4jUtils.getInstance().warn(DescribeInfo.VIEW_REMOTE_NOTCONTAIN);
}
});
if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget()).setMirror(MediaInstance.getMediaManager().isIsFrontCam());
return;
} else if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget()).setMirror(MediaInstance.getMediaManager().isIsFrontCam());
return;
} else {
return;
}
} else if (MediaInstance.getMediaManager().getPipRenderer() != null && (requesttype == 0 || requesttype == 8)) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().setTarget(MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer ? (SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer() : (TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer());
if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget()).setMirror(MediaInstance.getMediaManager().isIsFrontCam());
} else if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget()).setMirror(MediaInstance.getMediaManager().isIsFrontCam());
}
Log4jUtils.getInstance().debug("set single view pipRenderer");
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
MediaInstance.getMediaManager().getPipRenderer().setVisibility(0);
Log4jUtils.getInstance().debug("set pipRenderer VISIBLE");
return;
}
Log4jUtils.getInstance().warn(DescribeInfo.VIEW_LOCAL_ISNULL);
}
});
return;
} else {
View view4 = this.remoteView;
if (view4 != null && (requesttype == 1 || requesttype == 7)) {
if (view4 instanceof SurfaceViewRenderer) {
ProxyVideoSinkRemote proxyVideoSinkRemote3 = this.remoteSink;
if (proxyVideoSinkRemote3 != null) {
proxyVideoSinkRemote3.setTarget((SurfaceViewRenderer) view4);
}
((SurfaceViewRenderer) this.remoteView).setMirror(false);
} else if (view4 instanceof TextureViewRenderer) {
ProxyVideoSinkRemote proxyVideoSinkRemote4 = this.remoteSink;
if (proxyVideoSinkRemote4 != null) {
proxyVideoSinkRemote4.setTarget((TextureViewRenderer) view4);
}
((TextureViewRenderer) this.remoteView).setMirror(false);
}
Log4jUtils.getInstance().debug("set single view ");
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
View view5 = kedamedia.this.remoteView;
if (view5 != null) {
view5.setVisibility(0);
Log4jUtils.getInstance().debug("set remotevr VISIBLE");
return;
}
Log4jUtils.getInstance().warn(DescribeInfo.VIEW_REMOTE_NOTCONTAIN);
}
});
return;
}
Log4jUtils.getInstance().debug(" reqType:" + requesttype);
return;
}
}
Log4jUtils.getInstance().debug(" remoteviewList:" + map);
return;
}
Log4jUtils.getInstance().debug(" proxyVideoSink:" + list);
}
public void setThirdParam(ThirdReqParam thirdReqParam) {
sThirdReqParam = thirdReqParam;
Log4jUtils.getInstance().debug(sThirdReqParam.toString());
}
public void setVideoEnable(String str, String str2, boolean z) {
PeerManager peerManager = !ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient()) ? MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(str) : null;
if (ObjJudge.isNull(peerManager)) {
return;
}
for (VideoTrack videoTrack : peerManager.getRemoteVideoTrack()) {
if (videoTrack.id().endsWith(str2)) {
videoTrack.setEnabled(z);
}
}
}
public void setVideoFileAsCamera(String str) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(" videoFilePath: " + str);
if (str != null && !str.equals("")) {
videoFileAsCamera = str;
return;
}
videoFileAsCamera = null;
Log4jUtils.getInstance().warn(" videoFilePath not exist");
}
public boolean setWSCallback(WebrtcCallback.CompletionCallback completionCallback) {
CallBack.callback_excess = completionCallback;
return true;
}
public boolean setWebrtcCallback(WebrtcCallback.CompletionCallback completionCallback) {
CallBack.callback = completionCallback;
return true;
}
public boolean snapImg(String str, String str2, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
Log4jUtils.getInstance().debug("\"request_id\":\"" + str + ",\"jpg_path\":\"" + str2 + "\"");
if (!str2.endsWith(".jpg")) {
Log4jUtils.getInstance().error("imgPath is not endwith .jpg");
CallBack.errorParam(completionCallbackWith, str, 0, "imgPath is not endwith .jpg");
return false;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "snapImg requestid:" + str + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "{\"request_id\":\"" + str + "\",\"jpg_path\":\"" + str2 + "\"}", "200", "success").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if ((str == null || str.isEmpty()) && MediaInstance.getMediaManager().getLocalProxyVideoSink() != null) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().islocalsnap = true;
MediaInstance.getMediaManager().getLocalProxyVideoSink().requestId = str;
MediaInstance.getMediaManager().getLocalProxyVideoSink().localsnapimgpath = str2;
MediaInstance.getMediaManager().getLocalProxyVideoSink().snapCallback = completionCallbackWith;
return true;
} else if (str != null && !str.isEmpty()) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (peerConnManager == null) {
Log4jUtils.getInstance().warn("peerConnManager is null and requestid:" + str);
CallBack.errorParam(completionCallbackWith, str, 0, "peerConnManager is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "StreamCtrl", "snapImg peerConnManager is null and requestid:" + str + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return false;
}
RemoteViewShow remoteViewShow = peerConnManager.getRemoteViewShow();
if (remoteViewShow == null) {
Log4jUtils.getInstance().warn("remoteViewShow is null and requestid:" + str);
CallBack.errorParam(completionCallbackWith, str, 0, "remoteViewShow is null");
return false;
}
List<ProxyVideoSinkRemote> remoteProxySink = remoteViewShow.getRemoteProxySink();
if (remoteProxySink != null) {
for (ProxyVideoSinkRemote proxyVideoSinkRemote : remoteProxySink) {
proxyVideoSinkRemote.isRemotesnap = true;
proxyVideoSinkRemote.requestId = str;
proxyVideoSinkRemote.remotesnapimgpath = str2;
proxyVideoSinkRemote.snapCallback = completionCallbackWith;
}
} else {
Log4jUtils.getInstance().warn("remoteSinkList is null");
}
return true;
} else {
Log4jUtils.getInstance().error("reqestId is err.");
CallBack.errorParam(completionCallbackWith, str, 0, "reqestId is err");
return false;
}
}
public boolean startMedaiCallReq(final WSVideoAuidoReqParam wSVideoAuidoReqParam, final WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
if (!Log4jUtils.fileCreated) {
Log4jUtils.getInstance(MediaInstance.getMediaManager().getGlobalLogPath(), appName);
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(" start begin fileCreated=" + Log4jUtils.fileCreated);
executor.execute(new Runnable() {
@Override
public final void run() {
kedamedia.this.m439x8d03d66(wSVideoAuidoReqParam, completionCallbackWith);
}
});
Log4jUtils.getInstance().debug(DescribeInfo.START_END);
return true;
}
public void startMultiConference(MultiConferenceStartReq multiConferenceStartReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
boolean z;
String startConferenceAudioCall;
if (!Log4jUtils.fileCreated) {
Log4jUtils.getInstance(MediaInstance.getMediaManager().getGlobalLogPath(), appName);
}
CmdType cmdType = multiConferenceStartReq.getCmdType();
g_cmdType = cmdType;
if (cmdType == null) {
g_cmdType = CmdType.VIDEO_CALL;
}
Log4jUtils.getConference().debug("startMultiConference start fileCreated=" + Log4jUtils.fileCreated);
if (new File(Log4jUtils.RTC_SET_INI).exists()) {
try {
} catch (IOException e) {
e.printStackTrace();
}
if (Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "enableVoice", IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)).intValue() == 0) {
z = false;
if (z) {
setAudioMode(true);
}
Log4jUtils.getConference().debug("setAudioMode MODE_IN_COMMUNICATION");
if (!ObjJudge.isNull(multiConferenceStartReq)) {
CallBack.errorParam(completionCallbackWith, "", 0, "param startReq is null");
return;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), multiConferenceStartReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (multiConferenceStartReq.getWidth() == 0) {
multiConferenceStartReq.setWidth(288);
multiConferenceStartReq.setHeight(352);
this.maxVideoBitrate = String.valueOf(512);
}
if (multiConferenceStartReq.getDegradePre() == null) {
multiConferenceStartReq.setDegradePre(PeerConnection.DegradationPreference.MAINTAIN_RESOLUTION);
} else {
Log4jUtils.getConference().debug("DegradePre = " + multiConferenceStartReq.getDegradePre());
}
this.conference_callees.clear();
if (!ObjJudge.isNull(multiConferenceStartReq.getCalleeMap())) {
if (multiConferenceStartReq.getCalleeMap().size() == 0) {
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "startReq callee do not support empty");
this.conference_callees.clear();
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference startReq callee do not support empty requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
for (Map.Entry<String, View> entry : multiConferenceStartReq.getCalleeMap().entrySet()) {
if (ObjJudge.isNull(entry)) {
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "startReq callee param null");
this.conference_callees.clear();
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference startReq callee param null requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (g_cmdType == CmdType.VIDEO_CALL) {
if (!ObjJudge.isNull(entry.getValue())) {
if (entry.getValue() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) entry.getValue()).setUser(entry.getKey());
} else if (entry.getValue() instanceof TextureViewRenderer) {
((TextureViewRenderer) entry.getValue()).setUser(entry.getKey());
}
} else {
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "startReq callee=" + entry.getKey() + " view is null");
this.conference_callees.clear();
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference startReq callee=" + entry.getKey() + " view is null requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
this.conference_callees.add(entry.getKey());
}
CmdType cmdType2 = g_cmdType;
CmdType cmdType3 = CmdType.VIDEO_CALL;
if (cmdType2 == cmdType3) {
if (!ObjJudge.isNull(multiConferenceStartReq.getLocalView())) {
if (multiConferenceStartReq.getLocalView() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) multiConferenceStartReq.getLocalView()).setUser(multiConferenceStartReq.getSzCallerID());
} else if (multiConferenceStartReq.getLocalView() instanceof TextureViewRenderer) {
((TextureViewRenderer) multiConferenceStartReq.getLocalView()).setUser(multiConferenceStartReq.getSzCallerID());
}
if (!ObjJudge.isNull(multiConferenceStartReq.getLocalView())) {
if (multiConferenceStartReq.getLocalView() instanceof SurfaceViewRenderer) {
MediaInstance.getMediaManager().setPipRenderer(multiConferenceStartReq.getLocalView());
} else {
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "local view not correct");
}
}
startConferenceAudioCall = nMrtcMsg.startConferenceVideoCall(multiConferenceStartReq, this.conference_callees, MediaInstance.getMediaManager().getAppContext());
if (MediaInstance.getMediaManager().getVideoCapturer() == null) {
MediaInstance.getMediaManager().setVideoCapturer(createVideoCapturer(completionCallbackWith, multiConferenceStartReq.getRequestId()));
}
} else {
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "startReq local view is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference startReq local view is null requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
} else {
startConferenceAudioCall = nMrtcMsg.startConferenceAudioCall(multiConferenceStartReq, this.conference_callees, MediaInstance.getMediaManager().getAppContext());
}
String str = startConferenceAudioCall;
if (ObjJudge.isNull(str)) {
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "param msg is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference param msg is null requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (MediaInstance.getMediaManager().getEglBase() == null) {
MediaInstance.getMediaManager().setEglBase(multiConferenceStartReq.getEglBase());
}
if (ObjJudge.isNull(g_startReq)) {
g_startReq = multiConferenceStartReq;
Log4jUtils.getConference().debug(multiConferenceStartReq.toString());
String requestId = multiConferenceStartReq.getRequestId();
Log4jUtils.getConference().debug(requestId + " " + str);
if (MediaInstance.getMediaManager().isEnableLogcat()) {
MediaInstance.getMediaManager().setEnableLogcat(false);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).start();
}
PeerConnManager peerConnManager = new PeerConnManager();
peerConnManager.setRequestid(requestId);
peerConnManager.setRequesttype(g_cmdType.getValue());
if (g_cmdType == cmdType3) {
peerConnManager = viewManager(peerConnManager, multiConferenceStartReq.getCalleeMap(), null);
}
PeerConnManager peerConnManager2 = peerConnManager;
Log4jUtils.getConference().debug("startMultiConference ing 1");
peerConnManager2.setNMediaWebsocket(createShortNMediaLink(requestId, requestId, str, 0, 0, true, false, false, true));
peerConnect(peerConnManager2, multiConferenceStartReq.getDegradePre(), multiConferenceStartReq.getnVideoType(), multiConferenceStartReq.getWidth(), multiConferenceStartReq.getHeight(), completionCallbackWith, false, multiConferenceStartReq.getSzCallerID(), this.conference_callees.get(0), multiConferenceStartReq.getisPauseSend(), multiConferenceStartReq.getisPauseRecv(), true);
Log4jUtils.getConference().debug("startMultiConference ing 2");
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (ObjJudge.isNull(peerManager)) {
Log4jUtils.getConference().debug("startMultiConference ing 3");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference peerManager is null requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
Log4jUtils.getConference().debug("startMultiConference ing 4");
LinkedList linkedList = new LinkedList();
Map<String, View> calleeMap = multiConferenceStartReq.getCalleeMap();
if (calleeMap != null) {
for (Map.Entry<String, View> entry2 : calleeMap.entrySet()) {
linkedList.add(entry2.getKey());
}
}
Log4jUtils.getConference().debug("startMultiConference ing 5 ");
peerManager.getSdpObserver().setRequestid(requestId);
peerConnManager2.getSdpEvent().addCallee(requestId, linkedList);
peerConnManager2.getSdpEvent().addType(requestId, SdpEvent.CALL_TYPE.CALL_TYPE_MULTI);
peerConnManager2.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
for (Map.Entry<String, WsShortLinkEvent> entry3 : this.mWsShortLinkEventMap.entrySet()) {
Log4jUtils.getInstance().debug("ConferenceNewMedia_reqid item-ReqID=" + entry3.getKey() + " shortLink=" + entry3.getValue() + " shortLinkSize=" + this.mWsShortLinkEventMap.size());
}
Log4jUtils.getConference().debug("startMultiConference end");
return;
}
MultiConferenceStopReq multiConferenceStopReq = new MultiConferenceStopReq();
multiConferenceStopReq.setRequestid(g_startReq.getRequestId());
stopMultiConference(multiConferenceStopReq, null);
SystemClock.sleep(200L);
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "start for same requestid start-stop dont make pair, please restart");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference start for same requestid start-stop dont make pair, please restart requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, multiConferenceStartReq.getRequestId(), 0, "startReq callee do not support empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "MultiConference", "startMultiConference startReq callee map is null requestid:" + multiConferenceStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
z = true;
if (z) {
}
Log4jUtils.getConference().debug("setAudioMode MODE_IN_COMMUNICATION");
if (!ObjJudge.isNull(multiConferenceStartReq)) {
}
}
public void startRecordLocalH264(String str) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
if (str == null || str.isEmpty()) {
return;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("h264 filepath: " + str);
MediaInstance.getMediaManager().getPeerConnectionClient().startRecordEnStream(str);
return;
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
public void startRecordRemoteH264(String str) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
if (str == null || str.isEmpty()) {
return;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("h264 filepath: " + str);
MediaInstance.getMediaManager().getPeerConnectionClient().startRecordDeStream(str);
return;
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
public void startSFUConference(SFUModeStartReq sFUModeStartReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
boolean z;
String startSFUConferenceCall;
char c;
if (!Log4jUtils.fileCreated) {
Log4jUtils.getInstance(MediaInstance.getMediaManager().getGlobalLogPath(), appName);
}
CmdType cmdType = sFUModeStartReq.getCmdType();
g_cmdType = cmdType;
if (cmdType == null) {
g_cmdType = CmdType.VIDEO_CALL;
}
Log4jUtils.getConference().debug("startSFUConference start fileCreated=" + Log4jUtils.fileCreated);
if (new File(Log4jUtils.RTC_SET_INI).exists()) {
try {
} catch (IOException e) {
e.printStackTrace();
}
if (Integer.valueOf(SettingIni.getProfileString(Log4jUtils.RTC_SET_INI, Constantsdef.RTC_XML_FILE, "enableVoice", IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)).intValue() == 0) {
z = false;
if (z) {
setAudioMode(true);
}
Log4jUtils.getConference().debug("setAudioMode MODE_IN_COMMUNICATION");
String str = "";
if (!ObjJudge.isNull(sFUModeStartReq)) {
CallBack.errorParam(completionCallbackWith, "", 0, "param startReq is null");
return;
}
View view = null;
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), sFUModeStartReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (sFUModeStartReq.getWidth() == 0) {
sFUModeStartReq.setWidth(288);
sFUModeStartReq.setHeight(352);
this.maxVideoBitrate = String.valueOf(512);
}
if (sFUModeStartReq.getDegradePre() == null) {
sFUModeStartReq.setDegradePre(PeerConnection.DegradationPreference.MAINTAIN_RESOLUTION);
} else {
Log4jUtils.getConference().debug("DegradePre = " + sFUModeStartReq.getDegradePre());
}
this.conference_callees.clear();
if (!ObjJudge.isNull(sFUModeStartReq.getCalleeMap())) {
if (sFUModeStartReq.getCalleeMap().size() == 0) {
Log4jUtils.getConference().debug("startReq callee is empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference startReq callee do not support empty requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
for (Map.Entry<String, SFUParam> entry : sFUModeStartReq.getCalleeMap().entrySet()) {
if (ObjJudge.isNull(entry)) {
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "startReq callee param null");
this.conference_callees.clear();
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference startReq callee param null requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
SFUParam value = entry.getValue();
if (value.eStreamType == SFUModeStartReq.StreamType.STREAM_TYPE_VIDEOAUDIO) {
if (!ObjJudge.isNull(value) && !ObjJudge.isNull(value.remoteView)) {
View view2 = value.remoteView;
if (view2 instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view2).setUser(entry.getKey());
} else if (view2 instanceof TextureViewRenderer) {
((TextureViewRenderer) view2).setUser(entry.getKey());
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "startReq callee=" + entry.getKey() + " view is null");
this.conference_callees.clear();
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference startReq callee=" + entry.getKey() + " view is null requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
this.conference_callees.add(entry.getKey());
}
}
if (g_cmdType == CmdType.VIDEO_CALL) {
if (!ObjJudge.isNull(sFUModeStartReq.getLocalView())) {
if (sFUModeStartReq.getLocalView() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) sFUModeStartReq.getLocalView()).setUser(sFUModeStartReq.getSzCallerID());
} else if (sFUModeStartReq.getLocalView() instanceof TextureViewRenderer) {
((TextureViewRenderer) sFUModeStartReq.getLocalView()).setUser(sFUModeStartReq.getSzCallerID());
}
if (!ObjJudge.isNull(sFUModeStartReq.getLocalView())) {
if (sFUModeStartReq.getLocalView() instanceof SurfaceViewRenderer) {
MediaInstance.getMediaManager().setPipRenderer(sFUModeStartReq.getLocalView());
} else {
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "local view not correct");
}
}
startSFUConferenceCall = nMrtcMsg.startSFUConferenceCall(sFUModeStartReq, this.conference_callees, MediaInstance.getMediaManager().getAppContext());
if (MediaInstance.getMediaManager().getVideoCapturer() == null) {
MediaInstance.getMediaManager().setVideoCapturer(createVideoCapturer(completionCallbackWith, sFUModeStartReq.getRequestId()));
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "startReq local view is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference startReq local view is null requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
} else {
startSFUConferenceCall = nMrtcMsg.startSFUConferenceCall(sFUModeStartReq, this.conference_callees, MediaInstance.getMediaManager().getAppContext());
}
String str2 = startSFUConferenceCall;
if (ObjJudge.isNull(str2)) {
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "param msg is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference param msg is null requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
if (MediaInstance.getMediaManager().getEglBase() == null) {
MediaInstance.getMediaManager().setEglBase(sFUModeStartReq.getEglBase());
}
if (ObjJudge.isNull(g_startReq_SFU)) {
g_startReq_SFU = sFUModeStartReq;
Log4jUtils.getConference().debug(sFUModeStartReq.toString());
String requestId = sFUModeStartReq.getRequestId();
Log4jUtils.getConference().debug(requestId + " " + str2);
if (MediaInstance.getMediaManager().isEnableLogcat()) {
MediaInstance.getMediaManager().setEnableLogcat(false);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).start();
}
PeerConnManager peerConnManager = new PeerConnManager();
peerConnManager.setRequestid(requestId);
peerConnManager.setRequesttype(g_cmdType.getValue());
HashMap hashMap = new HashMap();
Iterator<String> it = this.conference_callees.iterator();
while (it.hasNext()) {
String next = it.next();
SFUParam sFUParam = sFUModeStartReq.getCalleeMap().get(next);
Iterator<String> it2 = it;
if (sFUParam.eStreamType == SFUModeStartReq.StreamType.STREAM_TYPE_VIDEOAUDIO) {
View view3 = sFUParam.remoteView;
if (view3 != null) {
hashMap.put(next, view3);
} else {
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "startReq callee param null");
}
}
it = it2;
view = null;
}
PeerConnManager viewManager = viewManager(peerConnManager, hashMap, view);
Log4jUtils.getConference().debug("startSFUConference ing 1");
viewManager.setNMediaWebsocket(createShortNMediaLink(requestId, requestId, str2, 0, 0, true, false, false, true));
PeerConnection.DegradationPreference degradePre = sFUModeStartReq.getDegradePre();
int i = sFUModeStartReq.getnVideoType();
int width = sFUModeStartReq.getWidth();
int height = sFUModeStartReq.getHeight();
String szCallerID = sFUModeStartReq.getSzCallerID();
if (this.conference_callees.size() > 0) {
c = 0;
str = this.conference_callees.get(0);
} else {
c = 0;
}
char c2 = c;
peerConnect(viewManager, degradePre, i, width, height, completionCallbackWith, false, szCallerID, str, sFUModeStartReq.getisPauseSend(), sFUModeStartReq.getisPauseRecv(), true);
Log4jUtils.getConference().debug("startSFUConference ing 2");
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (ObjJudge.isNull(peerManager)) {
Log4jUtils.getConference().debug("startSFUConference ing 3");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference peerManager is null requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[c2].getFileName() + "-" + new Throwable().getStackTrace()[c2].getMethodName() + ":" + new Throwable().getStackTrace()[c2].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[c2].getClassName(), new Throwable().getStackTrace()[c2].getMethodName(), String.valueOf(new Throwable().getStackTrace()[c2].getLineNumber())));
return;
}
return;
}
Log4jUtils.getConference().debug("startSFUConference ing 4");
peerManager.getSdpObserver().setRequestid(requestId);
viewManager.getSdpEvent().addCallee(requestId, this.conference_callees);
viewManager.getSdpEvent().addType(requestId, SdpEvent.CALL_TYPE.CALL_TYPE_SFU);
viewManager.getNMediaWebsocket().connectNMWebsocket(this.m_streamCertificate);
for (Map.Entry<String, WsShortLinkEvent> entry2 : this.mWsShortLinkEventMap.entrySet()) {
Log4jUtils.getInstance().debug("ConferenceNewMedia_reqid item-ReqID=" + entry2.getKey() + " shortLink=" + entry2.getValue() + " shortLinkSize=" + this.mWsShortLinkEventMap.size());
}
Log4jUtils.getConference().debug("startSFUConference end");
return;
}
SFUModeStopReq sFUModeStopReq = new SFUModeStopReq();
sFUModeStopReq.setRequestid(g_startReq_SFU.getRequestId());
stopSFUConference(sFUModeStopReq, null);
SystemClock.sleep(200L);
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "start for same requestid start-stop dont make pair, please restart");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference start for same requestid start-stop dont make pair, please restart requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeStartReq.getRequestId(), 0, "startReq callee do not support empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "startSFUConference startReq callee map is null requestid:" + sFUModeStartReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStartReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
z = true;
if (z) {
}
Log4jUtils.getConference().debug("setAudioMode MODE_IN_COMMUNICATION");
String str3 = "";
if (!ObjJudge.isNull(sFUModeStartReq)) {
}
}
public boolean startSaveLocalYuv(String str) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
if (str == null || str.isEmpty()) {
return false;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("yuv filepath: " + str + " width:" + this.videoWidth + " height:" + this.videoHeight);
return MediaInstance.getMediaManager().getPeerConnectionClient().localAddSink(str, this.videoHeight, this.videoWidth);
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return false;
}
public boolean startSaveRemoteYuv(String str, String str2) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
if (str2 == null || str2.isEmpty()) {
return false;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("yuv filepath: " + str2 + " width:" + this.videoWidth + " height:" + this.videoHeight);
return MediaInstance.getMediaManager().getPeerConnectionClient().remoteAddSink(str, str2, this.videoHeight, this.videoWidth);
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return false;
}
public boolean startTranscode(WebrtcAppTranscode webrtcAppTranscode, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String reqestid = webrtcAppTranscode.getReqestid();
String transcode = nMrtcMsg.transcode(true, webrtcAppTranscode.getResolution(), reqestid);
Map<String, WebrtcCallback.CompletionCallbackWith> map = callbackWithMap;
map.put(reqestid + this.start_flag, completionCallbackWith);
if (!ObjJudge.isNull(this.mPeerConnManagerMap.get(reqestid)) && !this.mPeerConnManagerMap.get(reqestid).getNMediaWebsocket().getWebst().Send(transcode)) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn(reqestid + " msg send Failed");
}
return true;
}
public boolean startVideoAudioReq(final WSVideoAuidoReqParam wSVideoAuidoReqParam, final WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
if (!Log4jUtils.fileCreated) {
Log4jUtils.getInstance(MediaInstance.getMediaManager().getGlobalLogPath(), appName);
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug(" start begin fileCreated=" + Log4jUtils.fileCreated);
executor.execute(new Runnable() {
@Override
public final void run() {
kedamedia.this.m440x85f11edc(wSVideoAuidoReqParam, completionCallbackWith);
}
});
Log4jUtils.getInstance().debug(DescribeInfo.START_END);
return true;
}
public void startVideoSources() {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().startVideoSource();
} else {
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
}
public boolean stopMedaiCallReq(String str, byte b, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
ThirdReqParam thirdReqParam;
String str2;
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("szRequestID:" + str + " byRequestType:" + ((int) b));
if (!isKdcHacked && ((2 == b || 4 == b || 6 == b || 8 == b) && getAudioMode() == 3)) {
setAudioMode(false);
Log4jUtils.getInstance().debug("setAudioMode MODE_NORMAL");
}
synchronized (this) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (peerConnManager == null) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.warn("peerConnManager is null, requestid:" + str);
CallBack.errorParam(completionCallbackWith, str, 0, "peerConnManager is null");
return false;
} else if (reqIdMapNullresourceId.contains(str)) {
CallBack.errorReqResponse(str, Constantsdef.CALLBACK_REQ_RESOURCEID_NULL, "resourceid is null when start!", completionCallbackWith);
reqIdMapNullresourceId.remove(str);
return false;
} else {
if (!MediaInstance.getMediaManager().isMulti(str)) {
if (SinglePeerCon.getStartreqid() != null && SinglePeerCon.getStartreqid().equals(str)) {
SinglePeerCon.setStartreqid(null);
} else {
Log4jUtils.getInstance().warn("stop start_stop must paired appearance");
CallBack.errorReqResponse(str, -100, "start_stop must paired appearance or multi thread oper currreqId:" + str + " preReqId:" + SinglePeerCon.getStartreqid(), completionCallbackWith);
return false;
}
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "StreamCtrl", "stopMedaiCallReq requestid:" + str + " request_type:" + ((int) b), "", "200", "success").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
String stopMediaCall = nMrtcMsg.stopMediaCall(str, MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(str));
if (peerConnManager.getPcEvent() != null && completionCallbackWith != null) {
peerConnManager.getPcEvent().setLocalcallback(completionCallbackWith);
peerConnManager.getPcEvent().isStoped = true;
} else if (completionCallbackWith == null) {
Log4jUtils.getInstance().debug("callbackWith is null");
} else {
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.debug("getPcEvent not contain:" + str);
}
Log4jUtils.getInstance().debug(stopMediaCall);
if (MediaInstance.getMediaManager().isMulti(str) && (thirdReqParam = sThirdReqParam) != null && (str2 = thirdReqParam.strMapHistoryMsg) != null) {
stopMediaCall = str2;
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
PeerConnectionClient.getCommSource().getPeerConnectionParameters().reqType = b;
}
if (MediaInstance.getMediaManager().isMulti(str)) {
peerConnManager.getNMediaWebsocket().getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.getNMediaWebsocket().getNotifyImp().getWebsocketTimer().isManualStop = true;
peerConnManager.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(false);
if (!peerConnManager.getNMediaWebsocket().getWebst().Send(stopMediaCall)) {
Logger log4jUtils4 = Log4jUtils.getInstance();
log4jUtils4.error(str + peerConnManager.getNMediaWebsocket().getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
peerConnManager.getNMediaWebsocket().getWebst().strMsg = stopMediaCall;
}
disconnectWs(this.mPeerConnManagerMap.get(str).getNMediaWebsocket(), str);
} else {
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(str);
if (wsShortLinkEvent != null) {
wsShortLinkEvent.stop();
wsShortLinkEvent.start(60);
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
peerConnManager.setNMediaWebsocket(nMediaWebsocket);
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(false);
if (!nMediaWebsocket.getWebst().Send(stopMediaCall)) {
Logger log4jUtils5 = Log4jUtils.getInstance();
log4jUtils5.error(str + nMediaWebsocket.getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
nMediaWebsocket.getWebst().strMsg = stopMediaCall;
}
} else {
Logger log4jUtils6 = Log4jUtils.getInstance();
log4jUtils6.warn("szRequestID:" + str + " wsShortLinkEvent is null");
}
}
peerClose(str, b);
return true;
}
}
}
public void stopMultiConference(MultiConferenceStopReq multiConferenceStopReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
Log4jUtils.getConference().debug("stopMultiConference start");
if (getAudioMode() == 3) {
setAudioMode(false);
Log4jUtils.getConference().debug("setAudioMode MODE_NORMAL");
}
if (ObjJudge.isNull(multiConferenceStopReq)) {
CallBack.errorParam(completionCallbackWith, multiConferenceStopReq.getRequestid(), 0, " param stopReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "MultiConference", "stopMultiConference param stopReq is null>>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(g_startReq) && !g_startReq.getRequestId().equals(multiConferenceStopReq.getRequestid())) {
String requestid = multiConferenceStopReq.getRequestid();
CallBack.errorParam(completionCallbackWith, requestid, 0, "stop for same requestid start-stop dont make pair, before requestid=" + g_startReq.getRequestId());
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type2 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type2, "kedacommrtc", "", "MultiConference", "stopMultiConference stop for same requestid start-stop dont make pair, requestid=" + multiConferenceStopReq.getRequestid() + " before requestid=" + g_startReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type3 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type3, "kedacommrtc", "", "MultiConference", "stopMultiConference requestid:" + multiConferenceStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), multiConferenceStopReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getConference().debug(multiConferenceStopReq.toString());
String requestid2 = multiConferenceStopReq.getRequestid();
multiConferenceStopReq.getCmdType();
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(requestid2);
if (ObjJudge.isNull(peerConnManager)) {
CallBack.errorParam(completionCallbackWith, multiConferenceStopReq.getRequestid(), 0, "peerManager is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type4 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type4, "kedacommrtc", "", "MultiConference", "stopMultiConference peerManager is null requestid=" + multiConferenceStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
peerConnManager.getNMediaWebsocket().getPcEvent().setLocalcallback(completionCallbackWith);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestid2);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, multiConferenceStopReq.getRequestid(), 0, "sessionId is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type5 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type5, "kedacommrtc", "", "MultiConference", "stopMultiConference sessionId is null requestid=" + multiConferenceStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
String stopConference = nMrtcMsg.stopConference(g_cmdType, requestid2, sessionId);
if (ObjJudge.isNull(stopConference)) {
CallBack.errorParam(completionCallbackWith, multiConferenceStopReq.getRequestid(), 0, "msg is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type6 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type6, "kedacommrtc", "", "MultiConference", "stopMultiConference msg is null requestid=" + multiConferenceStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestid2);
if (wsShortLinkEvent != null) {
wsShortLinkEvent.start(5);
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
nMediaWebsocket.getNmediaevent().setReqId(requestid2);
peerConnManager.setNMediaWebsocket(nMediaWebsocket);
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(false);
if (!nMediaWebsocket.getWebst().Send(stopConference)) {
Logger conference = Log4jUtils.getConference();
conference.error(requestid2 + nMediaWebsocket.getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
nMediaWebsocket.getWebst().strMsg = stopConference;
}
} else {
Logger conference2 = Log4jUtils.getConference();
conference2.warn("requestid:" + requestid2 + " wsShortLinkEvent is null");
}
peerClose(requestid2, 6);
if (!MediaInstance.getMediaManager().isEnableLogcat()) {
MediaInstance.getMediaManager().setEnableLogcat(true);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).stop();
}
this.conference_callees.clear();
if (this.mWsShortLinkEventMap.get(requestid2) != null) {
this.mWsShortLinkEventMap.remove(requestid2);
}
g_startReq = null;
Log4jUtils.getConference().debug("stopMultiConference end");
return;
}
Log4jUtils.getConference().warn("peerClient is null");
CallBack.errorParam(completionCallbackWith, multiConferenceStopReq.getRequestid(), 0, "peerClient is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type7 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type7, "kedacommrtc", "", "MultiConference", "stopMultiConference getPeerConnectionClient is null requestid=" + multiConferenceStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(multiConferenceStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public void stopRecordLocalH264() {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().stopRecordEnStream();
} else {
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
}
public void stopRecordRemoteH264() {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient().stopRecordDeStream();
} else {
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
}
}
public void stopSFUConference(SFUModeStopReq sFUModeStopReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
Log4jUtils.getConference().debug("stopSFUConference start");
if (getAudioMode() == 3) {
setAudioMode(false);
Log4jUtils.getConference().debug("setAudioMode MODE_NORMAL");
}
if (ObjJudge.isNull(sFUModeStopReq)) {
CallBack.errorParam(completionCallbackWith, sFUModeStopReq.getRequestid(), 0, " param stopReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "SFUConference", "stopSFUConference param stopReq is null>>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(g_startReq_SFU) && !g_startReq_SFU.getRequestId().equals(sFUModeStopReq.getRequestid())) {
String requestid = sFUModeStopReq.getRequestid();
CallBack.errorParam(completionCallbackWith, requestid, 0, "stop for same requestid start-stop dont make pair, before requestid=" + g_startReq_SFU.getRequestId());
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type2 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type2, "kedacommrtc", "", "SFUConference", "stopSFUConference stop for same requestid start-stop dont make pair, requestid=" + sFUModeStopReq.getRequestid() + " before requestid=" + g_startReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type3 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type3, "kedacommrtc", "", "SFUConference", "stopSFUConference requestid:" + sFUModeStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), sFUModeStopReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(sFUModeStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getConference().debug(sFUModeStopReq.toString());
String requestid2 = sFUModeStopReq.getRequestid();
sFUModeStopReq.getCmdType();
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(requestid2);
if (ObjJudge.isNull(peerConnManager)) {
CallBack.errorParam(completionCallbackWith, sFUModeStopReq.getRequestid(), 0, "peerManager is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type4 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type4, "kedacommrtc", "", "SFUConference", "stopSFUConference peerManager is null requestid=" + sFUModeStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
peerConnManager.getNMediaWebsocket().getPcEvent().setLocalcallback(completionCallbackWith);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestid2);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, sFUModeStopReq.getRequestid(), 0, "sessionId is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type5 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type5, "kedacommrtc", "", "SFUConference", "stopSFUConference sessionId is null requestid=" + sFUModeStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
String stopConference = nMrtcMsg.stopConference(g_cmdType, requestid2, sessionId);
if (ObjJudge.isNull(stopConference)) {
CallBack.errorParam(completionCallbackWith, sFUModeStopReq.getRequestid(), 0, "msg is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type6 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type6, "kedacommrtc", "", "SFUConference", "stopSFUConference msg is null requestid=" + sFUModeStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestid2);
if (wsShortLinkEvent != null) {
wsShortLinkEvent.start(5);
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
nMediaWebsocket.getNmediaevent().setReqId(requestid2);
peerConnManager.setNMediaWebsocket(nMediaWebsocket);
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(false);
if (!nMediaWebsocket.getWebst().Send(stopConference)) {
Logger conference = Log4jUtils.getConference();
conference.error(requestid2 + nMediaWebsocket.getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
nMediaWebsocket.getWebst().strMsg = stopConference;
}
} else {
Logger conference2 = Log4jUtils.getConference();
conference2.warn("requestid:" + requestid2 + " wsShortLinkEvent is null");
}
peerClose(requestid2, 6);
if (!MediaInstance.getMediaManager().isEnableLogcat()) {
MediaInstance.getMediaManager().setEnableLogcat(true);
LogcatHelper.getInstance(MediaInstance.getMediaManager().getAppContext(), MediaInstance.getMediaManager().getGlobalLogPath()).stop();
}
this.conference_callees.clear();
if (this.mWsShortLinkEventMap.get(requestid2) != null) {
this.mWsShortLinkEventMap.remove(requestid2);
}
g_startReq_SFU = null;
Log4jUtils.getConference().debug("stopSFUConference end");
return;
}
Log4jUtils.getConference().warn("peerClient is null");
CallBack.errorParam(completionCallbackWith, sFUModeStopReq.getRequestid(), 0, "peerClient is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type7 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type7, "kedacommrtc", "", "SFUConference", "stopSFUConference getPeerConnectionClient is null requestid=" + sFUModeStopReq.getRequestid() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeStopReq.getRequestid()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public boolean stopSaveLocalYuv() {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
return MediaInstance.getMediaManager().getPeerConnectionClient().localRemoveSink();
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return false;
}
public boolean stopSaveRemoteYuv(String str) {
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
return MediaInstance.getMediaManager().getPeerConnectionClient().remoteRemoveSink(str);
}
Log4jUtils.getInstance().warn(DescribeInfo.PEER_CONNECTION_IS_NULL);
return false;
}
public boolean stopTranscode(String str, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String transcode = nMrtcMsg.transcode(false, null, str);
Map<String, WebrtcCallback.CompletionCallbackWith> map = callbackWithMap;
map.put(str + this.stop_flag, completionCallbackWith);
if (ObjJudge.isNull(this.mPeerConnManagerMap.get(str)) || this.mPeerConnManagerMap.get(str).getNMediaWebsocket().getWebst().Send(transcode)) {
return true;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn(str + " msg send Failed");
return true;
}
public boolean stopVideoAudioReq(String str, byte b, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
String stopLive;
ThirdReqParam thirdReqParam;
String str2;
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("szRequestID:" + str + " byRequestType:" + ((int) b));
if (!isKdcHacked && ((2 == b || 4 == b || 6 == b || 8 == b) && getAudioMode() == 3)) {
setAudioMode(false);
Log4jUtils.getInstance().debug("setAudioMode MODE_NORMAL");
}
synchronized (this) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (peerConnManager == null) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.warn("peerConnManager is null, requestid:" + str);
CallBack.errorParam(completionCallbackWith, str, 0, "peerConnManager is null");
return false;
} else if (reqIdMapNullresourceId.contains(str)) {
CallBack.errorReqResponse(str, Constantsdef.CALLBACK_REQ_RESOURCEID_NULL, "resourceid is null when start!", completionCallbackWith);
reqIdMapNullresourceId.remove(str);
return false;
} else {
String str3 = null;
if (!MediaInstance.getMediaManager().isMulti(str) && 9 != b) {
if (SinglePeerCon.getStartreqid() != null && SinglePeerCon.getStartreqid().equals(str)) {
SinglePeerCon.setStartreqid(null);
} else {
Log4jUtils.getInstance().warn("stop start_stop must paired appearance");
CallBack.errorReqResponse(str, -100, "start_stop must paired appearance or multi thread oper currreqId:" + str + " preReqId:" + SinglePeerCon.getStartreqid(), completionCallbackWith);
return false;
}
}
ThirdReqParam thirdReqParam2 = sThirdReqParam;
if (thirdReqParam2 != null) {
if (thirdReqParam2.getnThirdReq() == 30000) {
if (issxt) {
Logger log4jUtils3 = Log4jUtils.getInstance();
log4jUtils3.warn(" reqid:" + str + " issxt:" + issxt + " isplatformreq:" + isplatformreq);
CallBack.errorReqResponse(str, Constantsdef.CALLBACK_REQ_SXT_USE, "already sxt is running", completionCallbackWith);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type, "kedacommrtc", "", "StreamCtrl", "stopVideoAudioReq already sxt is running requestid:" + str + " request_type:" + ((int) b), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_SXT_USE), "error").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return false;
}
isplatformreq = false;
}
} else if (isKdcHacked) {
if (isplatformreq) {
Logger log4jUtils4 = Log4jUtils.getInstance();
log4jUtils4.warn(" reqid:" + str + " issxt:" + issxt + " isplatformreq:" + isplatformreq);
CallBack.errorReqResponse(str, Constantsdef.CALLBACK_REQ_PLATFORM_USE, "already platform is running", completionCallbackWith);
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type2 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type2, "kedacommrtc", "", "StreamCtrl", "stopVideoAudioReq already platform is running requestid:" + str + " request_type:" + ((int) b), "", String.valueOf((int) Constantsdef.CALLBACK_REQ_PLATFORM_USE), "error").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
return false;
}
issxt = false;
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.LOG_TYPE log_type3 = ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL;
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(log_type3, "kedacommrtc", "", "StreamCtrl", "stopVideoAudioReq requestid:" + str + " request_type:" + ((int) b), "", "200", "success").toString(), ClogSDKCallback.getExistTraceId(str), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
if (1 != b && 3 != b && 7 != b) {
if (b != 0 && 5 != b && 6 != b && 8 != b && 9 != b) {
if (2 == b || 4 == b) {
stopLive = nMrtcMsg.stopAudioCall(str, b);
str3 = stopLive;
}
if (peerConnManager.getPcEvent() == null && completionCallbackWith != null) {
peerConnManager.getPcEvent().setLocalcallback(completionCallbackWith);
peerConnManager.getPcEvent().isStoped = true;
} else if (completionCallbackWith == null) {
Log4jUtils.getInstance().debug("callbackWith is null");
} else {
Logger log4jUtils5 = Log4jUtils.getInstance();
log4jUtils5.debug("getPcEvent not contain:" + str);
}
Log4jUtils.getInstance().debug(str3);
if (MediaInstance.getMediaManager().isMulti(str) && (thirdReqParam = sThirdReqParam) != null && (str2 = thirdReqParam.strMapHistoryMsg) != null) {
str3 = str2;
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
PeerConnectionClient.getCommSource().getPeerConnectionParameters().reqType = b;
}
if (MediaInstance.getMediaManager().isMulti(str)) {
peerConnManager.getNMediaWebsocket().getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.getNMediaWebsocket().getNotifyImp().getWebsocketTimer().isManualStop = true;
peerConnManager.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(false);
if (!peerConnManager.getNMediaWebsocket().getWebst().Send(str3)) {
Logger log4jUtils6 = Log4jUtils.getInstance();
log4jUtils6.error(str + peerConnManager.getNMediaWebsocket().getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
peerConnManager.getNMediaWebsocket().getWebst().strMsg = str3;
}
disconnectWs(this.mPeerConnManagerMap.get(str).getNMediaWebsocket(), str);
} else {
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(str);
if (wsShortLinkEvent != null) {
wsShortLinkEvent.start(5);
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
peerConnManager.setNMediaWebsocket(nMediaWebsocket);
nMediaWebsocket.getNotifyImp().setCallbackWithMap(callbackWithMap);
peerConnManager.getNMediaWebsocket().getNmediaevent().setIsHandleMsg(false);
if (!nMediaWebsocket.getWebst().Send(str3)) {
Logger log4jUtils7 = Log4jUtils.getInstance();
log4jUtils7.error(str + nMediaWebsocket.getWebst().wsUrl + DescribeInfo.WS_SENDFAILED);
nMediaWebsocket.getWebst().strMsg = str3;
}
} else {
Logger log4jUtils8 = Log4jUtils.getInstance();
log4jUtils8.warn("szRequestID:" + str + " wsShortLinkEvent is null");
}
}
peerClose(str, b);
if (this.mWsShortLinkEventMap.get(str) != null) {
this.mWsShortLinkEventMap.remove(str);
}
return true;
}
ThirdReqParam thirdReqParam3 = sThirdReqParam;
if (thirdReqParam3 == null) {
stopLive = nMrtcMsg.stopVideoCall(str, null);
} else {
stopLive = nMrtcMsg.stopVideoCall(str, thirdReqParam3.getsThirdPartId());
sThirdReqParam = null;
}
str3 = stopLive;
if (peerConnManager.getPcEvent() == null) {
}
if (completionCallbackWith == null) {
}
Log4jUtils.getInstance().debug(str3);
if (MediaInstance.getMediaManager().isMulti(str)) {
str3 = str2;
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
}
if (MediaInstance.getMediaManager().isMulti(str)) {
}
peerClose(str, b);
if (this.mWsShortLinkEventMap.get(str) != null) {
}
return true;
}
ThirdReqParam thirdReqParam4 = sThirdReqParam;
if (thirdReqParam4 == null) {
stopLive = nMrtcMsg.stopLive(str, null, null);
} else {
stopLive = nMrtcMsg.stopLive(str, thirdReqParam4.getsThirdPartId(), null);
sThirdReqParam = null;
}
str3 = stopLive;
if (peerConnManager.getPcEvent() == null) {
}
if (completionCallbackWith == null) {
}
Log4jUtils.getInstance().debug(str3);
if (MediaInstance.getMediaManager().isMulti(str)) {
}
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
}
if (MediaInstance.getMediaManager().isMulti(str)) {
}
peerClose(str, b);
if (this.mWsShortLinkEventMap.get(str) != null) {
}
return true;
}
}
}
public boolean swapViewShow(SwapViewParam swapViewParam) {
if (swapViewParam == null) {
return false;
}
if (swapViewParam.getView() != null) {
if (swapViewParam.getView() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) swapViewParam.getView()).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
} else if (swapViewParam.getView() instanceof TextureViewRenderer) {
((TextureViewRenderer) swapViewParam.getView()).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i, int i2, int i3) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i + " videoHeight:" + i2 + " rotation:" + i3);
}
});
}
View view = null;
if (swapViewParam.getWhich() == 1) {
if (MediaInstance.getMediaManager().getPipRenderer() != null) {
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).release();
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer()).release();
}
MediaInstance.getMediaManager().setPipRenderer(null);
}
MediaInstance.getMediaManager().setPipRenderer(swapViewParam.getView());
} else if (swapViewParam.getWhich() == 2) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(swapViewParam.getReqId());
if (peerConnManager == null) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("peerConnManager is null requestid:" + swapViewParam.getReqId());
return false;
}
if (swapViewParam.getReqId() != null && this.mPeerConnManagerMap.containsKey(swapViewParam.getReqId())) {
RemoteViewShow remoteViewShow = peerConnManager.getRemoteViewShow();
if (remoteViewShow == null) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.warn("remoteViewShow is null requestid:" + swapViewParam.getReqId());
return false;
}
Map<String, View> remoteSurView = remoteViewShow.getRemoteSurView();
if (remoteSurView != null) {
for (Map.Entry<String, View> entry : remoteSurView.entrySet()) {
if (!ObjJudge.isNull(entry.getValue())) {
if (entry.getValue() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) entry.getValue()).release();
} else if (entry.getValue() instanceof TextureViewRenderer) {
((TextureViewRenderer) entry.getValue()).release();
}
}
}
}
HashMap hashMap = new HashMap();
hashMap.put(swapViewParam.getCallee(), swapViewParam.getView());
remoteViewShow.setRemoteSurView(hashMap);
peerConnManager.setRemoteViewShow(remoteViewShow);
}
if (MediaInstance.getMediaManager().isMulti(swapViewParam.getReqId())) {
List<ProxyVideoSinkRemote> remoteProxySink = peerConnManager.getRemoteViewShow().getRemoteProxySink();
Map<String, View> remoteSurView2 = peerConnManager.getRemoteViewShow().getRemoteSurView();
ProxyVideoSinkRemote proxyVideoSinkRemote = (remoteProxySink == null || remoteProxySink.size() != 1) ? null : remoteProxySink.get(0);
if (remoteSurView2 != null && remoteSurView2.size() == 1) {
for (String str : remoteSurView2.keySet()) {
view = remoteSurView2.get(str);
}
}
if (MediaInstance.getMediaManager().getPipRenderer() instanceof SurfaceViewRenderer) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().setTarget((SurfaceViewRenderer) MediaInstance.getMediaManager().getPipRenderer());
} else if (MediaInstance.getMediaManager().getPipRenderer() instanceof TextureViewRenderer) {
MediaInstance.getMediaManager().getLocalProxyVideoSink().setTarget((TextureViewRenderer) MediaInstance.getMediaManager().getPipRenderer());
}
if (view instanceof SurfaceViewRenderer) {
if (proxyVideoSinkRemote != null) {
SurfaceViewRenderer surfaceViewRenderer = (SurfaceViewRenderer) view;
proxyVideoSinkRemote.setTarget(surfaceViewRenderer);
if (view != null) {
surfaceViewRenderer.setMirror(false);
}
}
} else if ((view instanceof TextureViewRenderer) && proxyVideoSinkRemote != null) {
TextureViewRenderer textureViewRenderer = (TextureViewRenderer) view;
proxyVideoSinkRemote.setTarget(textureViewRenderer);
if (view != null) {
textureViewRenderer.setMirror(false);
}
}
}
}
setSwappedFeeds(false, swapViewParam.getReqId());
Log4jUtils.getInstance().debug("swap view successfully");
} else {
Log4jUtils.getInstance().warn("viewRenderer is null");
}
return true;
}
public int switchAudioFileCapture(boolean z, boolean z2) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("isAudioFile:" + z);
if (MediaInstance.getMediaManager().getPeerConnectionClient() == null) {
Log4jUtils.getInstance().warn("peerConnectionClient is null!");
return -2;
}
if (z) {
int sharedIntData = ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AUDIO_FILE_CHANNELS, 0);
int sharedIntData2 = ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, VADefaultConfig.AUDIO_FILE_SAMPLERATE, 0);
File file = new File(Log4jUtils.PCM_FILE);
if (sharedIntData2 > 0 && file.exists()) {
MediaInstance.getMediaManager().getPeerConnectionClient().reStartAudioRecord(z, sharedIntData2, sharedIntData, z2);
} else {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.debug("switchAudioFileCapture set failed samplerate:" + sharedIntData2);
return -1;
}
} else {
MediaInstance.getMediaManager().getPeerConnectionClient().reStartAudioRecord(z, 0, 0, z2);
}
return 0;
}
public void switchCamera() {
Log4jUtils.getInstance().debug("switchCamera ...");
MediaInstance.getMediaManager().getPeerConnectionClient().switchCamera(new CameraVideoCapturer.CameraSwitchHandler() {
@Override
public void onCameraSwitchDone(boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("isFrontCamera:" + z);
MediaInstance.getMediaManager().setIsFrontCam(z);
if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() != null) {
if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget()).setMirror(MediaInstance.getMediaManager().isIsFrontCam());
} else if (MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget() instanceof TextureViewRenderer) {
((TextureViewRenderer) MediaInstance.getMediaManager().getLocalProxyVideoSink().getTarget()).setMirror(MediaInstance.getMediaManager().isIsFrontCam());
}
}
CallBack.callbackInt(5, Constantsdef.BUNDLE_KEY_INT_CAMERA_SWITCH, MediaInstance.getMediaManager().isIsFrontCam() ? 1 : 2);
}
@Override
public void onCameraSwitchError(String str) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.error("onCameraSwitchError:" + str);
CallBack.callbackInt(5, Constantsdef.BUNDLE_KEY_INT_CAMERA_SWITCH, -1);
CallBack.upErrInfo(SinglePeerCon.getStartreqid(), 0, Constantsdef.ERR_CAMERA_SWITCH_FAILED, str);
}
});
}
public boolean switchCapturerSource(String str, Constantsdef.CapturerSource capturerSource) {
Log4jUtils.getInstance().debug("switchCapturerSource ...");
if (MediaInstance.getMediaManager().getPeerConnectionClient() == null) {
Log4jUtils.getInstance().debug("switchCapturerSource ... PeerConnectionClient is NULL");
return false;
} else if (capturerSource == this.currentCapSource) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("switchCapturerSource already is " + capturerSource.ordinal());
CallBack.callbackInt(22, Constantsdef.BUNDLE_KEY_INT_CAPTURER_SWITCH, Constantsdef.CapturerSource.CAPTURER_ALREADY.ordinal());
return false;
} else {
PeerConnectionClient peerConnectionClient = MediaInstance.getMediaManager().getPeerConnectionClient();
Constantsdef.CapturerSource capturerSource2 = Constantsdef.CapturerSource.CAPTURER_CAMERA;
if (capturerSource != capturerSource2) {
Constantsdef.CapturerSource capturerSource3 = Constantsdef.CapturerSource.CAPTURER_SCREEN;
if (capturerSource == capturerSource3) {
if (peerConnectionClient != null && this.screenCapturer != null) {
PeerConnectionClient.getCommSource().setScreenCapturer(this.screenCapturer);
if (peerConnectionClient.switchTrack(str, false)) {
this.currentCapSource = capturerSource3;
} else {
Log4jUtils.getInstance().debug("switchCapturerSource ... CAPTURER_SCREEN is failed");
CallBack.callbackInt(22, Constantsdef.BUNDLE_KEY_INT_CAPTURER_SWITCH, Constantsdef.CapturerSource.CAPTURER_FAILED.ordinal());
return false;
}
} else {
Log4jUtils.getInstance().debug("switchCapturerSource ... screenCapturer is NULL");
CallBack.callbackInt(22, Constantsdef.BUNDLE_KEY_INT_CAPTURER_SWITCH, Constantsdef.CapturerSource.CAPTURER_FAILED.ordinal());
return false;
}
} else {
Log4jUtils.getInstance().debug("switchCapturerSource ... unknow mode");
CallBack.callbackInt(22, Constantsdef.BUNDLE_KEY_INT_CAPTURER_SWITCH, Constantsdef.CapturerSource.CAPTURER_UNKNOW_CAP.ordinal());
return false;
}
} else if (peerConnectionClient != null) {
if (peerConnectionClient.switchTrack(str, true)) {
this.currentCapSource = capturerSource2;
} else {
Log4jUtils.getInstance().debug("switchCapturerSource ... CAPTURER_CAMERA is failed");
CallBack.callbackInt(22, Constantsdef.BUNDLE_KEY_INT_CAPTURER_SWITCH, Constantsdef.CapturerSource.CAPTURER_FAILED.ordinal());
return false;
}
}
CallBack.callbackInt(22, Constantsdef.BUNDLE_KEY_INT_CAPTURER_SWITCH, this.currentCapSource.ordinal());
return true;
}
}
public void updateSFUMembers(SFUModeMembersReq sFUModeMembersReq, WebrtcCallback.CompletionCallbackWith completionCallbackWith) {
boolean z;
Log4jUtils.getConference().debug("updateSFUMembers start");
if (ObjJudge.isNull(sFUModeMembersReq)) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "param updateReq is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers param addReq is null >>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), null, null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else if (!ObjJudge.isNull(sFUModeMembersReq.getCalleeMap()) && (ObjJudge.isNull(sFUModeMembersReq.getCalleeMap()) || ObjJudge.valid(sFUModeMembersReq.getCalleeMap()))) {
int size = sFUModeMembersReq.getCalleeMap().size();
Iterator<Map.Entry<String, SFUParam>> it = sFUModeMembersReq.getCalleeMap().entrySet().iterator();
int i = 0;
while (it.hasNext()) {
Map.Entry<String, SFUParam> next = it.next();
if (ObjJudge.isNull(next)) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "updateReq callee param null");
return;
}
SFUParam value = next.getValue();
if (value.eStreamType == SFUModeStartReq.StreamType.STREAM_TYPE_VIDEOAUDIO) {
if (!ObjJudge.isNull(value) && !ObjJudge.isNull(value.remoteView)) {
View view = value.remoteView;
if (view instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view).setUser(next.getKey());
} else if (view instanceof TextureViewRenderer) {
((TextureViewRenderer) view).setUser(next.getKey());
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "updateReq callee=" + next.getKey() + " view is null");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers uodateReq callee=" + next.getKey() + " view is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
}
if (this.conference_callees.contains(next.getKey())) {
i++;
} else {
it.remove();
}
}
if (i != size) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, 0, "addReq callee repetitive");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "addSFUMembers addReq callee repetitive requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), sFUModeMembersReq.toString(), "200", "success").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
Log4jUtils.getConference().debug(sFUModeMembersReq.toString());
String requestId = sFUModeMembersReq.getRequestId();
String str = CommUtils.getUUID() + "-update";
if (!ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient())) {
int sessionId = MediaInstance.getMediaManager().getPeerConnectionClient().getSessionId(requestId);
if (sessionId < 0) {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "sessionId param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers updateReq sessionId param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
String updateSFUMembers = nMrtcMsg.updateSFUMembers(g_cmdType, sFUModeMembersReq.getCalleeMap(), str, sessionId);
PeerConnManager peerConnManager = this.mPeerConnManagerMap.containsKey(requestId) ? this.mPeerConnManagerMap.get(requestId) : null;
if (!ObjJudge.isNull(peerConnManager) && !ObjJudge.isNull(sFUModeMembersReq.getCalleeMap())) {
boolean z2 = false;
for (Map.Entry<String, SFUParam> entry : sFUModeMembersReq.getCalleeMap().entrySet()) {
if (!ObjJudge.isNull(entry.getValue()) && entry.getValue().eStreamType == SFUModeStartReq.StreamType.STREAM_TYPE_VIDEOAUDIO) {
SFUParam value2 = entry.getValue();
View view2 = value2.remoteView;
if (view2 != null) {
if (view2 instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view2).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i2, int i3, int i4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i2 + " videoHeight:" + i3 + " rotation:" + i4);
}
});
} else if (view2 instanceof TextureViewRenderer) {
((TextureViewRenderer) view2).init(MediaInstance.getMediaManager().getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
}
@Override
public void onFrameResolutionChanged(int i2, int i3, int i4) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("RendererCommon full view videoWidth:" + i2 + " videoHeight:" + i3 + " rotation:" + i4);
}
});
}
Iterator<ProxyVideoSinkRemote> it2 = peerConnManager.getRemoteViewShow().getRemoteProxySink().iterator();
while (true) {
if (!it2.hasNext()) {
z = true;
break;
}
ProxyVideoSinkRemote next2 = it2.next();
if (next2.getCallee().equals(entry.getKey())) {
View view3 = value2.remoteView;
if (view3 instanceof SurfaceViewRenderer) {
next2.setTarget((SurfaceViewRenderer) view3);
} else if (view3 instanceof TextureViewRenderer) {
next2.setTarget((TextureViewRenderer) view3);
}
z = false;
}
}
if (z) {
ProxyVideoSinkRemote proxyVideoSinkRemote = new ProxyVideoSinkRemote();
proxyVideoSinkRemote.requestId = requestId;
proxyVideoSinkRemote.setListen(new RemoteVideoSinkEvent());
proxyVideoSinkRemote.setCallee(entry.getKey());
View view4 = value2.remoteView;
if (view4 instanceof SurfaceViewRenderer) {
proxyVideoSinkRemote.setTarget((SurfaceViewRenderer) view4);
} else if (view4 instanceof TextureViewRenderer) {
proxyVideoSinkRemote.setTarget((TextureViewRenderer) view4);
}
peerConnManager.getRemoteViewShow().getRemoteProxySink().add(proxyVideoSinkRemote);
}
peerConnManager.getRemoteViewShow().getRemoteSurView().put(entry.getKey(), value2.remoteView);
z2 = true;
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "remoteView param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers addReq remoteView param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
} else {
View view5 = peerConnManager.getRemoteViewShow().getRemoteSurView().get(entry.getKey());
if (peerConnManager.getRemoteViewShow().getRemoteSurView().containsKey(entry.getKey())) {
peerConnManager.getRemoteViewShow().getRemoteSurView().remove(entry.getKey());
}
if (!ObjJudge.isNull(view5)) {
Iterator<ProxyVideoSinkRemote> it3 = peerConnManager.getRemoteViewShow().getRemoteProxySink().iterator();
while (it3.hasNext()) {
ProxyVideoSinkRemote next3 = it3.next();
Iterator<ProxyVideoSinkRemote> it4 = it3;
if (next3.getCallee().equals(entry.getKey())) {
next3.setTarget(null);
}
it3 = it4;
}
Log4jUtils.getInstance().debug(" remove release callee=" + entry.getKey() + " view" + view5);
if (view5 instanceof SurfaceViewRenderer) {
((SurfaceViewRenderer) view5).release();
} else if (view5 instanceof TextureViewRenderer) {
((TextureViewRenderer) view5).release();
}
}
MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId).getPcObserver().getVideoSinks().remove(entry.getKey());
}
}
PeerManager peerManager = MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager(requestId);
if (!ObjJudge.isNull(peerManager) && z2) {
peerManager.getPcObserver().setVideoSinks(peerConnManager.getRemoteViewShow().getRemoteProxySink());
}
WsShortLinkEvent wsShortLinkEvent = this.mWsShortLinkEventMap.get(requestId);
if (ObjJudge.isNull(wsShortLinkEvent)) {
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers updateReq shortLinkEvent param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
NMediaWebsocket nMediaWebsocket = wsShortLinkEvent.getNMediaWebsocket();
LinkedList linkedList = new LinkedList();
Map<String, SFUParam> calleeMap = sFUModeMembersReq.getCalleeMap();
if (calleeMap != null) {
for (Map.Entry<String, SFUParam> entry2 : calleeMap.entrySet()) {
linkedList.add(entry2.getKey());
}
}
peerManager.getSdpObserver().setCallback(new SDPCallbackEvent(completionCallbackWith));
peerManager.getSdpObserver().setRequestid(str);
peerConnManager.getSdpEvent().addCallee(str, linkedList);
peerConnManager.getSdpEvent().addType(requestId, SdpEvent.CALL_TYPE.CALL_TYPE_SFU);
if (nMediaWebsocket != null) {
nMediaWebsocket.getWebst().Send(updateSFUMembers);
}
Log4jUtils.getConference().debug("updateSFUMembers end");
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "peerConnManager param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers updateReq peerConnManager param is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
return;
}
return;
}
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "param err");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers updateReq getPeerConnectionClient is null requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
} else {
CallBack.errorParam(completionCallbackWith, sFUModeMembersReq.getRequestId(), 1, "updateReq calleeMap param null or empty");
if (ClogSDKCallback.isClogSDK()) {
ClogSDKCallback.CLoggerLOG(Level.DEBUG, new ClogSDKCallback.MsgBody(ClogSDKCallback.LOG_TYPE.LOG_TYPE_GENERAL, "kedacommrtc", "", "SFUConference", "updateSFUMembers updateReq calleeMap param null or empty requestid:" + sFUModeMembersReq.getRequestId() + ">>" + new Throwable().getStackTrace()[0].getFileName() + "-" + new Throwable().getStackTrace()[0].getMethodName() + ":" + new Throwable().getStackTrace()[0].getLineNumber(), "", "-1", "error").toString(), ClogSDKCallback.getExistTraceId(sFUModeMembersReq.getRequestId()), null, new ClogSDKCallback.InvokeInfo(null, new Throwable().getStackTrace()[0].getClassName(), new Throwable().getStackTrace()[0].getMethodName(), String.valueOf(new Throwable().getStackTrace()[0].getLineNumber())));
}
}
}
public boolean setWebrtcCallback(String str, WebrtcCallback.CompletionCallback completionCallback) {
CallBack.addCompletionCallback(str, completionCallback);
return true;
}
public boolean setCallMute(String str, boolean z) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setCallMute callee:" + str + " isMute:" + z);
if (ObjJudge.isNull(MediaInstance.getMediaManager().getPeerConnectionClient())) {
return true;
}
MediaInstance.getMediaManager().getPeerConnectionClient().getPeerManager("");
return true;
}
private Logging.Severity setNativeLogLevel() {
int sharedIntData = ShareDataUtils.getSharedIntData(MediaInstance.getMediaManager().getAppContext(), Constantsdef.RTC_XML_FILE, Constantsdef.RTC_ENABLE_NATIVE_LOG, Logging.Severity.LS_INFO.ordinal());
Logging.Severity severity = Logging.Severity.LS_INFO;
if (sharedIntData == 0) {
severity = Logging.Severity.LS_VERBOSE;
} else if (sharedIntData == 2) {
severity = Logging.Severity.LS_WARNING;
} else if (sharedIntData == 3) {
severity = Logging.Severity.LS_ERROR;
} else if (sharedIntData == 4) {
severity = Logging.Severity.LS_NONE;
}
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.debug("setNativeLogLevel level=" + severity);
if (MediaInstance.getMediaManager().getPeerConnectionClient() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
if (PeerConnectionClient.getCommSource() != null) {
MediaInstance.getMediaManager().getPeerConnectionClient();
if (PeerConnectionClient.getCommSource().getFactory() != null) {
Logging.enableLogToDebugOutput(severity);
}
}
}
return severity;
}
public String getVAQualityReport(String str, String str2) {
PeerConnManager peerConnManager = this.mPeerConnManagerMap.get(str);
if (ObjJudge.isNull(peerConnManager)) {
Logger log4jUtils = Log4jUtils.getInstance();
log4jUtils.warn("peerConnManager is null, requestid:" + str);
return "";
}
PcEvents pcEvent = peerConnManager.getPcEvent();
if (ObjJudge.isNull(pcEvent)) {
Logger log4jUtils2 = Log4jUtils.getInstance();
log4jUtils2.warn("peerConnManager getPcEvent is null, requestid:" + str);
return "";
}
return pcEvent.getVAQualityReport(str2);
}
public void printLog(String str, String str2) {
Log4jUtils.getInstance().debug(str + " " + str2);
}
}