Ejemplo n.º 1
0
 public bool IsRecording()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     return(GameJoySDK.mQMiObj != null && GameJoySDK.mQMiObj.CallStatic <bool>("isRecording", new object[0]));
 }
Ejemplo n.º 2
0
 public static GameJoySDK getGameJoyInstance()
 {
     if (gameJoy == null)
     {
         gameJoy = new GameJoySDK();
     }
     return(gameJoy);
 }
Ejemplo n.º 3
0
 public override void Init()
 {
     base.Init();
     if (GameJoySDK.SetupGameJoySDK() == null)
     {
         Debug.LogError("GameRecorder Failed Setup GameRecorder!");
     }
 }
Ejemplo n.º 4
0
    void OnPreRender()
    {
        int result = GameJoySDK.getGameJoyInstance().BeginDraw();

        if (hasPrintLog == false)
        {
            Debug.Log("GameJoy on pre render | result = " + result);
            hasPrintLog = true;
        }
    }
Ejemplo n.º 5
0
 public void closeVideoListDialog()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("closeVideoListDialog", new object[0]);
     }
 }
Ejemplo n.º 6
0
 public void endMomentRecording()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("endMomentRecording", new object[0]);
     }
 }
Ejemplo n.º 7
0
 public static void CheckRecorderAvailability()
 {
     try
     {
         GameJoySDK.CheckSupportRecord();
     }
     catch (Exception var_0_0A)
     {
         GameJoySDK.Log("GameRecorder call Exception ");
         GameJoy.onUnSupport();
     }
 }
Ejemplo n.º 8
0
    public static GameJoySDK SetupGameJoySDK()
    {
        if (GameJoySDK.singletonInstance != null)
        {
            return(GameJoySDK.singletonInstance);
        }
        GameObject gameObject = new GameObject("GameJoySDK");

        Object.DontDestroyOnLoad(gameObject);
        GameJoySDK.singletonInstance = gameObject.AddComponent <GameJoySDK>();
        return(GameJoySDK.instance);
    }
Ejemplo n.º 9
0
 public static void CheckSDKFeature()
 {
     try
     {
         GameJoySDK.CheckSDKFeature();
     }
     catch (Exception var_0_0A)
     {
         GameJoySDK.Log("GameRecorder call Exception ");
         GameJoy.OnCheckSDKFeature(0);
     }
 }
Ejemplo n.º 10
0
 public static long getSystemCurrentTimeMillis()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         return(GameJoySDK.mQMiObj.CallStatic <long>("getSystemCurrentTimeMillis", new object[0]));
     }
     return(0L);
 }
Ejemplo n.º 11
0
 private static AndroidJavaClass mQMiObjJavaClass()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = new AndroidJavaClass("com.tencent.qqgamemi.QmiSdkApi");
     }
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.Log("GameJoySDK: Unable to find GameJoySDK java class.");
     }
     return(GameJoySDK.mQMiObj);
 }
Ejemplo n.º 12
0
 public void showUploadShareDialog()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("showUploadShareVideoDialog", new object[0]);
         GameJoySDK.Log("GameRecorder showUploadShareDialog end call ");
     }
 }
Ejemplo n.º 13
0
 public static void CheckRecorderAvailability()
 {
     try
     {
         GameJoySDK.CheckSupportRecord();
     }
     catch (Exception exception)
     {
         object[] inParameters = new object[] { exception.Message, exception.StackTrace, exception.GetType().ToString() };
         DebugHelper.Assert(false, "CheckRecorderAvailability {2} {0} {1}", inParameters);
         onUnSupport();
     }
 }
Ejemplo n.º 14
0
 public string getCurRecorderPosition()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         return(GameJoySDK.mQMiObj.CallStatic <string>("getCurRecorderPosition", new object[0]));
     }
     GameJoySDK.Log("getCurRecorderPosition get mQMiObj fail");
     return(null);
 }
Ejemplo n.º 15
0
 public bool IsShowed()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         return(GameJoySDK.mQMiObj.CallStatic <bool>("isShowed", new object[0]));
     }
     GameJoySDK.Log("GameRecorder IsShowed get mQMiObj fail");
     return(false);
 }
Ejemplo n.º 16
0
 public bool isRecordingMoments()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         return(GameJoySDK.mQMiObj.CallStatic <bool>("isRecordingMoment", new object[0]));
     }
     GameJoySDK.Log("IsRecordingMoment get mQMiObj fail");
     return(false);
 }
Ejemplo n.º 17
0
 public void setVideoQuality(int flag)
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("setVideoQuality", new object[]
         {
             flag
         });
     }
 }
Ejemplo n.º 18
0
 public void lockRecorderPosition()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("lockRecorderPosition", new object[0]);
     }
     else
     {
         GameJoySDK.Log("lockRecorderPosition get mQMiObj fail");
     }
 }
Ejemplo n.º 19
0
 public void setCurRecorderPosition(float x, float y)
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("setCurRecorderPosition", new object[]
         {
             x,
             y
         });
     }
 }
Ejemplo n.º 20
0
 public void setUploadShareDialogDefaultPosition(float x, float y)
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("setUploadShareDialogPosition", new object[]
         {
             x,
             y
         });
     }
 }
Ejemplo n.º 21
0
 private void Awake()
 {
     GameJoySDK.Log("GameRecorder Awake: SDK Version:2015-09-22-0002-Camera-Render");
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.Log("GameRecorder: Java class not accessible from C#.");
     }
     else
     {
         this.InitializeRenderCamera("Pre");
     }
 }
Ejemplo n.º 22
0
 public void StopRecord()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("onStopRecordVideo", new object[0]);
         GameJoySDK.mRecorderStatus = GameJoySDK.RECORER_STATUS.RS_STOPED;
     }
     else
     {
         GameJoySDK.Log("StopRecord mQMiObj = null");
     }
 }
Ejemplo n.º 23
0
 public void StartRecord()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.mQMiObj.CallStatic("onStartRecordVideo", new object[0]);
         int num = GameJoySDK.mQMiObj.CallStatic <int>("getSRPpluginVersionCode", new object[0]);
         GameJoySDK.mSDKVersion     = num;
         GameJoySDK.mRecorderStatus = GameJoySDK.RECORER_STATUS.RS_STARTED;
     }
     else
     {
         GameJoySDK.Log("StartRecord mQMiObj = null");
     }
 }
Ejemplo n.º 24
0
 private void InitializeRenderCamera(string type)
 {
     if (type.Equals("Pre") && GameObject.Find("GameJoy" + type + "Camera") == null)
     {
         GameObject gameObject = new GameObject();
         Camera     camera     = (Camera)gameObject.AddComponent("Camera");
         camera.name        = "GameJoy" + type + "Camera";
         camera.clearFlags  = CameraClearFlags.Nothing;
         camera.cullingMask = 0;
         if (type.Equals("Pre"))
         {
             camera.depth = -3.40282347E+38f;
         }
         GameJoySDK.Log("InitializeRenderCamera start add GameJoySDK render");
         camera.gameObject.AddComponent("GameJoyAndroid" + type + "Render");
         GameJoySDK.Log("InitializeRenderCamera start SetActive");
         Object.DontDestroyOnLoad(gameObject);
     }
 }
Ejemplo n.º 25
0
 private static AndroidJavaObject getActivityContext()
 {
     if (GameJoySDK.playerActivityContext == null)
     {
         AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
         if (androidJavaClass == null)
         {
             GameJoySDK.Log("Get UnityPlayer Class failed");
             return(null);
         }
         GameJoySDK.playerActivityContext = androidJavaClass.GetStatic <AndroidJavaObject>("currentActivity");
         if (GameJoySDK.playerActivityContext == null)
         {
             GameJoySDK.Log("get context failed");
             return(null);
         }
     }
     return(GameJoySDK.playerActivityContext);
 }
Ejemplo n.º 26
0
 public void GetGameEngineType()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         string text = "Unity3D_" + Application.unityVersion;
         GameJoySDK.mQMiObj.CallStatic("setGameEngineType", new object[]
         {
             text
         });
     }
     else
     {
         GameJoySDK.Log("GetGameEngineType mQMiObj = null");
     }
 }
Ejemplo n.º 27
0
 public void initQMi()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         GameJoySDK.playerActivityContext = GameJoySDK.getActivityContext();
         if (GameJoySDK.playerActivityContext == null)
         {
             GameJoySDK.Log("startqmi get context failed");
             return;
         }
     }
     else
     {
         GameJoySDK.Log("GameRecorder StartQMi mqmiobj = null");
     }
 }
Ejemplo n.º 28
0
 public void showVideoListDialog()
 {
     if (GameJoySDK.mQMiObj == null)
     {
         GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
     }
     if (GameJoySDK.mQMiObj != null)
     {
         if (GameJoySDK.playerActivityContext == null)
         {
             GameJoySDK.playerActivityContext = GameJoySDK.getActivityContext();
         }
         if (GameJoySDK.playerActivityContext != null)
         {
             GameJoySDK.mQMiObj.CallStatic("showVideoListDialog", new object[]
             {
                 GameJoySDK.playerActivityContext
             });
         }
     }
 }
    private bool DoCaptureFrame()
    {
        bool result = false;
        int  num    = GameJoyAndroidPreRender.Java_com_tencent_qqgamemi_srp_agent_sdk_MMCodecSdk_OnRecordeFrame(IntPtr.Zero, IntPtr.Zero);

        num = GameJoyAndroidPreRender.Java_com_tencent_qqgamemi_srp_agent_sdk_MMCodecSdk_BeginDraw(IntPtr.Zero, IntPtr.Zero);
        if (num == 1)
        {
            if (this.bLogPostRender)
            {
                GameJoySDK.Log("GameRecorder: DoCaptureFrame Render 1 Frame.");
            }
            this.RerenderCameraFrame();
            if (this.bLogPostRender)
            {
                this.bLogPostRender = false;
            }
            result = true;
        }
        num = GameJoyAndroidPreRender.Java_com_tencent_qqgamemi_srp_agent_sdk_MMCodecSdk_EndDraw(IntPtr.Zero, IntPtr.Zero);
        return(result);
    }
Ejemplo n.º 30
0
    public int EndDraw()
    {
        if (GameJoySDK.mRecorderStatus != GameJoySDK.RECORER_STATUS.RS_STARTED)
        {
            return(0);
        }
        int result = 0;

        if (GameJoySDK.mQMiObj == null)
        {
            GameJoySDK.mQMiObj = GameJoySDK.mQMiObjJavaClass();
        }
        if (GameJoySDK.mQMiObj != null)
        {
            result = GameJoySDK.mQMiObj.CallStatic <int>("endDraw", new object[0]);
        }
        else
        {
            GameJoySDK.Log("EndDraw mQMiObj = null");
        }
        return(result);
    }