public final class

VideoFrameProcessingException

extends java.lang.Exception

 java.lang.Object

↳java.lang.Throwable

↳java.lang.Exception

↳androidx.media3.common.VideoFrameProcessingException

Gradle dependencies

compile group: 'androidx.media3', name: 'media3-common', version: '1.5.0-alpha01'

  • groupId: androidx.media3
  • artifactId: media3-common
  • version: 1.5.0-alpha01

Artifact androidx.media3:media3-common:1.5.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

Thrown when an exception occurs while preparing an Effect, or applying an Effect to video frames.

Summary

Fields
public final longpresentationTimeUs

The microsecond timestamp of the frame being processed while the exception occurred or C.TIME_UNSET if unknown.

Constructors
publicVideoFrameProcessingException(java.lang.String message)

Creates an instance.

publicVideoFrameProcessingException(java.lang.String message, long presentationTimeUs)

Creates an instance.

publicVideoFrameProcessingException(java.lang.String message, java.lang.Throwable cause)

Creates an instance.

publicVideoFrameProcessingException(java.lang.String message, java.lang.Throwable cause, long presentationTimeUs)

Creates an instance.

publicVideoFrameProcessingException(java.lang.Throwable cause)

Creates an instance.

publicVideoFrameProcessingException(java.lang.Throwable cause, long presentationTimeUs)

Creates an instance.

Methods
public static VideoFrameProcessingExceptionfrom(java.lang.Exception exception)

Wraps the given exception in a VideoFrameProcessingException if it is not already a VideoFrameProcessingException and returns the exception otherwise.

public static VideoFrameProcessingExceptionfrom(java.lang.Exception exception, long presentationTimeUs)

Wraps the given exception in a VideoFrameProcessingException with the given timestamp if it is not already a VideoFrameProcessingException and returns the exception otherwise.

from java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Fields

public final long presentationTimeUs

The microsecond timestamp of the frame being processed while the exception occurred or C.TIME_UNSET if unknown.

Constructors

public VideoFrameProcessingException(java.lang.String message)

Creates an instance.

Parameters:

message: The detail message for this exception.

public VideoFrameProcessingException(java.lang.String message, long presentationTimeUs)

Creates an instance.

Parameters:

message: The detail message for this exception.
presentationTimeUs: The timestamp of the frame for which the exception occurred.

public VideoFrameProcessingException(java.lang.String message, java.lang.Throwable cause)

Creates an instance.

Parameters:

message: The detail message for this exception.
cause: The cause of this exception.

public VideoFrameProcessingException(java.lang.String message, java.lang.Throwable cause, long presentationTimeUs)

Creates an instance.

Parameters:

message: The detail message for this exception.
cause: The cause of this exception.
presentationTimeUs: The timestamp of the frame for which the exception occurred.

public VideoFrameProcessingException(java.lang.Throwable cause)

Creates an instance.

Parameters:

cause: The cause of this exception.

public VideoFrameProcessingException(java.lang.Throwable cause, long presentationTimeUs)

Creates an instance.

Parameters:

cause: The cause of this exception.
presentationTimeUs: The timestamp of the frame for which the exception occurred.

Methods

public static VideoFrameProcessingException from(java.lang.Exception exception)

Wraps the given exception in a VideoFrameProcessingException if it is not already a VideoFrameProcessingException and returns the exception otherwise.

public static VideoFrameProcessingException from(java.lang.Exception exception, long presentationTimeUs)

Wraps the given exception in a VideoFrameProcessingException with the given timestamp if it is not already a VideoFrameProcessingException and returns the exception otherwise.

Source

/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package androidx.media3.common;

import androidx.media3.common.util.UnstableApi;

/**
 * Thrown when an exception occurs while preparing an {@link Effect}, or applying an {@link Effect}
 * to video frames.
 */
@UnstableApi
public final class VideoFrameProcessingException extends Exception {

  /**
   * Wraps the given exception in a {@code VideoFrameProcessingException} if it is not already a
   * {@code VideoFrameProcessingException} and returns the exception otherwise.
   */
  public static VideoFrameProcessingException from(Exception exception) {
    return from(exception, /* presentationTimeUs= */ C.TIME_UNSET);
  }

  /**
   * Wraps the given exception in a {@code VideoFrameProcessingException} with the given timestamp
   * if it is not already a {@code VideoFrameProcessingException} and returns the exception
   * otherwise.
   */
  public static VideoFrameProcessingException from(Exception exception, long presentationTimeUs) {
    if (exception instanceof VideoFrameProcessingException) {
      return (VideoFrameProcessingException) exception;
    } else {
      return new VideoFrameProcessingException(exception, presentationTimeUs);
    }
  }

  /**
   * The microsecond timestamp of the frame being processed while the exception occurred or {@link
   * C#TIME_UNSET} if unknown.
   */
  public final long presentationTimeUs;

  /**
   * Creates an instance.
   *
   * @param message The detail message for this exception.
   */
  public VideoFrameProcessingException(String message) {
    this(message, /* presentationTimeUs= */ C.TIME_UNSET);
  }

  /**
   * Creates an instance.
   *
   * @param message The detail message for this exception.
   * @param presentationTimeUs The timestamp of the frame for which the exception occurred.
   */
  public VideoFrameProcessingException(String message, long presentationTimeUs) {
    super(message);
    this.presentationTimeUs = presentationTimeUs;
  }

  /**
   * Creates an instance.
   *
   * @param message The detail message for this exception.
   * @param cause The cause of this exception.
   */
  public VideoFrameProcessingException(String message, Throwable cause) {
    this(message, cause, /* presentationTimeUs= */ C.TIME_UNSET);
  }

  /**
   * Creates an instance.
   *
   * @param message The detail message for this exception.
   * @param cause The cause of this exception.
   * @param presentationTimeUs The timestamp of the frame for which the exception occurred.
   */
  public VideoFrameProcessingException(String message, Throwable cause, long presentationTimeUs) {
    super(message, cause);
    this.presentationTimeUs = presentationTimeUs;
  }

  /**
   * Creates an instance.
   *
   * @param cause The cause of this exception.
   */
  public VideoFrameProcessingException(Throwable cause) {
    this(cause, /* presentationTimeUs= */ C.TIME_UNSET);
  }

  /**
   * Creates an instance.
   *
   * @param cause The cause of this exception.
   * @param presentationTimeUs The timestamp of the frame for which the exception occurred.
   */
  public VideoFrameProcessingException(Throwable cause, long presentationTimeUs) {
    super(cause);
    this.presentationTimeUs = presentationTimeUs;
  }
}