public final class

MediaLibraryInfo

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.MediaLibraryInfo

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

Information about the media libraries.

Summary

Fields
public static final booleanASSERTIONS_ENABLED

Whether the library was compiled with Assertions checks enabled.

public static final java.lang.StringTAG

A tag to use when logging library information.

public static final booleanTRACE_ENABLED

Whether the library was compiled with TraceUtil trace enabled.

public static final java.lang.StringVERSION

The version of the library expressed as a string, for example "1.2.3" or "1.2.0-beta01".

public static final intVERSION_INT

The version of the library expressed as an integer, for example 1002003300.

public static final java.lang.StringVERSION_SLASHY

The version of the library expressed as TAG + "/" + VERSION.

Methods
public static synchronized java.lang.StringregisteredModules()

Returns a string consisting of registered module names separated by ", ".

public static synchronized voidregisterModule(java.lang.String name)

Registers a module to be returned in the MediaLibraryInfo.registeredModules() string.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final java.lang.String TAG

A tag to use when logging library information.

public static final java.lang.String VERSION

The version of the library expressed as a string, for example "1.2.3" or "1.2.0-beta01".

public static final java.lang.String VERSION_SLASHY

The version of the library expressed as TAG + "/" + VERSION.

public static final int VERSION_INT

The version of the library expressed as an integer, for example 1002003300.

Three digits are used for each of the first three components of MediaLibraryInfo.VERSION, then a single digit represents the cycle of this version: alpha (0), beta (1), rc (2) or stable (3). Finally two digits are used for the cycle number (always 00 for stable releases).

For example "1.2.0-rc05" has the corresponding integer version 1002000205 (001-002-000-2-05), and "123.45.6" has the corresponding integer version 123045006300 (123-045-006-3-00).

public static final boolean ASSERTIONS_ENABLED

Whether the library was compiled with Assertions checks enabled.

public static final boolean TRACE_ENABLED

Whether the library was compiled with TraceUtil trace enabled.

Methods

public static synchronized java.lang.String registeredModules()

Returns a string consisting of registered module names separated by ", ".

public static synchronized void registerModule(java.lang.String name)

Registers a module to be returned in the MediaLibraryInfo.registeredModules() string.

Parameters:

name: The name of the module being registered.

Source

/*
 * Copyright (C) 2016 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.Assertions;
import androidx.media3.common.util.TraceUtil;
import androidx.media3.common.util.UnstableApi;
import java.util.HashSet;

/** Information about the media libraries. */
@UnstableApi
public final class MediaLibraryInfo {

  /** A tag to use when logging library information. */
  public static final String TAG = "AndroidXMedia3";

  /** The version of the library expressed as a string, for example "1.2.3" or "1.2.0-beta01". */
  // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION_INT) or vice versa.
  public static final String VERSION = "1.5.0-alpha01";

  /** The version of the library expressed as {@code TAG + "/" + VERSION}. */
  // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
  public static final String VERSION_SLASHY = "AndroidXMedia3/1.5.0-alpha01";

  /**
   * The version of the library expressed as an integer, for example 1002003300.
   *
   * <p>Three digits are used for each of the first three components of {@link #VERSION}, then a
   * single digit represents the cycle of this version: alpha (0), beta (1), rc (2) or stable (3).
   * Finally two digits are used for the cycle number (always 00 for stable releases).
   *
   * <p>For example "1.2.0-rc05" has the corresponding integer version 1002000205
   * (001-002-000-2-05), and "123.45.6" has the corresponding integer version 123045006300
   * (123-045-006-3-00).
   */
  // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
  public static final int VERSION_INT = 1_005_000_0_01;

  /** Whether the library was compiled with {@link Assertions} checks enabled. */
  public static final boolean ASSERTIONS_ENABLED = true;

  /** Whether the library was compiled with {@link TraceUtil} trace enabled. */
  public static final boolean TRACE_ENABLED = true;

  private static final HashSet<String> registeredModules = new HashSet<>();
  private static String registeredModulesString = "media3.common";

  private MediaLibraryInfo() {} // Prevents instantiation.

  /** Returns a string consisting of registered module names separated by ", ". */
  public static synchronized String registeredModules() {
    return registeredModulesString;
  }

  /**
   * Registers a module to be returned in the {@link #registeredModules()} string.
   *
   * @param name The name of the module being registered.
   */
  public static synchronized void registerModule(String name) {
    if (registeredModules.add(name)) {
      registeredModulesString = registeredModulesString + ", " + name;
    }
  }
}