Class LeiaMediaSDK

java.lang.Object
com.leiainc.leiamediasdk.LeiaMediaSDK

public class LeiaMediaSDK extends Object
  • Method Details

    • getAppWrapper

      public static LeiaMediaSDK.AppWrapper getAppWrapper()
    • getInstance

      public static LeiaMediaSDK getInstance(android.content.Context context)
      Get LeiaMediaSDK singleton instance
      Parameters:
      context -
      Returns:
      current LeiaMediaSDK instance
    • verifyMediaServiceInstallation

      public static void verifyMediaServiceInstallation(androidx.appcompat.app.AppCompatActivity activity)
      Verifies if the Leia MediaService is installed on the device. If not installed, it shows a non-cancellable system update prompt. This provides a default behavior that most Leia apps need. If you need to customize the behavior, you can use the overloaded function by passing in your own implementation of [PromptUpdateDialogListener]

      On Positive response, the dialog and app are closed and the user is navigated to the Settings page. On Negative response, the calling app is closed.

    • verifyMediaServiceInstallation

      public static void verifyMediaServiceInstallation(androidx.appcompat.app.AppCompatActivity activity, com.leiainc.leiamediasdk.services.ui.PromptUpdateDialogListener responseListener)
      Verifies if the Leia MediaService is installed on the device. If not installed, it shows a non-cancellable system update prompt. This provides a default behavior that most Leia apps need. If you need to customize the behavior, you can use the overloaded function by passing in your own implementation of [PromptUpdateDialogListener]

      On Positive response, the dialog and app are closed and the user is navigated to the Settings page. On Negative response, the calling app is closed.

    • createMonoVideoSurfaceRenderer

      public MonoVideoSurfaceRenderer createMonoVideoSurfaceRenderer(android.content.Context context, android.view.Surface surface, MonoVideoSurfaceRenderer.SurfaceTextureCallback surfaceTextureCallback)
      Creates surface renderer that is responsible for real-time 2d-3d transformation and playback of regular mono (not sbs) video content. Usage example could be found @see MonoVideoActivity example
      Parameters:
      context - app context
      surface - surface that will be used for rendering
      surfaceTextureCallback - surface callback provided by video player (ExoPlayer in all our demos)
      Returns:
      class instance
    • createStereoVideoSurfaceRenderer

      public StereoVideoSurfaceRenderer createStereoVideoSurfaceRenderer(android.content.Context context, android.view.Surface surface, StereoVideoSurfaceRenderer.SurfaceTextureCallback surfaceTextureCallback)
      Creates surface renderer that is responsible playback of sbs video content with optional convergence estimation (parallax control). Usage example could be found @see MonoVideoActivity example
      Parameters:
      context - app context
      surface - surface that will be used for rendering
      surfaceTextureCallback - surface callback provided by video player (ExoPlayer in all our demos)
      Returns:
      class instance
    • createMonoPhotoSurfaceRenderer

      public MonoPhotoSurfaceRenderer createMonoPhotoSurfaceRenderer(android.content.Context context, android.view.Surface surface, com.leiainc.androidsdk.photoformat.MultiviewImage image)
      Creates surface renderer that is responsible for real-time 2d-3d transformation and playback of regular mono image content. This renderer has optional interactive viewpoint position control (X,Y,Z) and simple animation control.
      Parameters:
      context - app context
      surface - surface that will be used for rendering
      image - Multiview image containing single albedo (RGB image) and disparity map
      Returns:
      class instance
    • createMultiviewSynthesizer

      public MultiviewSynthesizer createMultiviewSynthesizer(android.content.Context context, boolean initMono, boolean initStereo, boolean initNnConvergence, boolean useNeuralDisparity)
      Creates class that provides functionality of transforming mono and stereo images to stereo or multiview tapestry (MxN layout) apply parallax reduction (convergence) and calculate optimal 3d effect parameters like (gain and convergence) for MultiviewImage
      Parameters:
      context - app context
      initMono - LazyLoad mono estimation networks? (500-1000ms)
      initStereo - LazyLoad stereo estimation networks? (500-1000ms)
      initNnConvergence - LazyLoad convergence networks? (500-1000ms)
      useNeuralDisparity -
      Returns:
      class instance
    • createLayoutDetection

      public LayoutDetection createLayoutDetection(android.content.Context context)
      Creates layout detection class that could be used for auto-detecting content layout mono, sbs, 360, 360 top/bottom, 180, 180SBS
      Parameters:
      context - app context
      Returns:
      class instance