Ejemplo n.º 1
0
        /** Listens for the {@link agora_gaming_rtc.VideoRawDataManager.OnRenderVideoFrameHandler OnRenderVideoFrameHandler} delegate.
         *
         * @param action The implementation of the `OnRenderVideoFrameHandler` delegate.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetOnRenderVideoFrameCallback(OnRenderVideoFrameHandler action)
        {
            if (_irtcEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            if (action == null)
            {
                OnRenderVideoFrame = null;
                IRtcEngineNative.initEventOnRenderVideoFrame(null);
            }
            else
            {
                OnRenderVideoFrame = action;
                IRtcEngineNative.initEventOnRenderVideoFrame(OnRenderVideoFrameCallback);
            }
            return((int)ERROR_CODE.ERROR_OK);
        }