/// <summary>
        /// Register to get Tango image events for getting the texture byte buffer callback.
        ///
        /// NOTE: Tango image events happen on a different thread than the main
        /// Unity thread.
        /// </summary>
        internal static void SetCallbackByteBufferMethod()
        {
            if (m_onImageAvailable != null)
            {
                Debug.Log("VideoOverlayProvider.SetCallbackByteBufferMethod() called when a callback is already set.");
                return;
            }

            Debug.Log("VideoOverlayProvider.SetCallbackByteBufferMethod()");
            m_onImageAvailable = new VideoOverlayProvider.APIOnImageAvailable(_OnImageAvailable);
            VideoOverlayProvider.SetCallback(COLOR_CAMERA_ID, m_onImageAvailable);
        }
        /// <summary>
        /// Stop getting Tango image or texture callbacks.
        /// </summary>
        internal static void Reset()
        {
            // Avoid calling into tango_client_api before the correct library is loaded.
            if (m_onImageAvailable != null || m_onTextureAvailable != null || m_onYUVTextureAvailable != null)
            {
                VideoOverlayProvider.ClearCallback(COLOR_CAMERA_ID);
            }

            m_onImageAvailable                   = null;
            m_onTextureAvailable                 = null;
            m_onYUVTextureAvailable              = null;
            m_previousImageBuffer                = new TangoUnityImageData();
            m_shouldSendTextureMethodEvent       = false;
            m_shouldSendByteBufferMethodEvent    = false;
            m_shouldSendYUVTextureIdMethodEvent  = false;
            m_onTangoImageAvailable              = null;
            m_onTangoCameraTextureAvailable      = null;
            m_onTangoYUVTextureAvailable         = null;
            m_onTangoImageMultithreadedAvailable = null;
        }
        /// <summary>
        /// Register to get Tango image events for getting the texture byte buffer callback.
        /// 
        /// NOTE: Tango image events happen on a different thread than the main
        /// Unity thread.
        /// </summary>
        internal static void SetCallbackByteBufferMethod()
        {
            if (m_onImageAvailable != null)
            {
                Debug.Log("VideoOverlayProvider.SetCallbackByteBufferMethod() called when a callback is already set.");
                return;
            }

            Debug.Log("VideoOverlayProvider.SetCallbackByteBufferMethod()");
            m_onImageAvailable = new VideoOverlayProvider.APIOnImageAvailable(_OnImageAvailable);
            VideoOverlayProvider.SetCallback(COLOR_CAMERA_ID, m_onImageAvailable);
        }
 /// <summary>
 /// Clear just the Tango callbacks. External registered listeners are kept.
 /// </summary>
 internal static void ClearTangoCallbacks()
 {
     m_onTextureAvailable = null;
     m_onYUVTextureAvailable = null;
     m_onImageAvailable = null;
 }
        /// <summary>
        /// Stop getting Tango image or texture callbacks.
        /// </summary>
        internal static void Reset()
        {
            // Avoid calling into tango_client_api before the correct library is loaded.
            if (m_onImageAvailable != null || m_onTextureAvailable != null || m_onYUVTextureAvailable != null)
            {
                VideoOverlayProvider.ClearCallback(COLOR_CAMERA_ID);
            }

            m_onImageAvailable = null;
            m_onTextureAvailable = null;
            m_onYUVTextureAvailable = null;
            m_previousImageBuffer = new TangoUnityImageData();
            m_shouldSendTextureMethodEvent = false;
            m_shouldSendByteBufferMethodEvent = false;
            m_shouldSendYUVTextureIdMethodEvent = false;
            m_onTangoImageAvailable = null;
            m_onTangoCameraTextureAvailable = null;
            m_onTangoYUVTextureAvailable = null;
            m_onTangoImageMultithreadedAvailable = null;
        }
 /// <summary>
 /// Clear just the Tango callbacks. External registered listeners are kept.
 /// </summary>
 internal static void ClearTangoCallbacks()
 {
     m_onTextureAvailable    = null;
     m_onYUVTextureAvailable = null;
     m_onImageAvailable      = null;
 }