public abstract class

GraphicDeviceInfo

extends java.lang.Object

 java.lang.Object

↳androidx.camera.core.processing.util.GraphicDeviceInfo

Gradle dependencies

compile group: 'androidx.camera', name: 'camera-core', version: '1.5.0-alpha01'

  • groupId: androidx.camera
  • artifactId: camera-core
  • version: 1.5.0-alpha01

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

Overview

Information about an initialized graphics device.

This information can be used to determine which version or extensions of OpenGL and EGL are supported on the device to ensure the attached output surface will have expected characteristics.

Summary

Methods
public static GraphicDeviceInfo.Builderbuilder()

Returns the Builder.

public abstract java.lang.StringgetEglExtensions()

Returns a space separated list of EGL extensions or an empty string if extensions could not be retrieved.

public abstract java.lang.StringgetEglVersion()

Returns the EGL version this graphics device has been initialized to.

public abstract java.lang.StringgetGlExtensions()

Returns a space separated list of OpenGL extensions or an empty string if extensions could not be retrieved.

public abstract java.lang.StringgetGlVersion()

Returns the OpenGL version this graphics device has been initialized to.

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

Methods

public abstract java.lang.String getGlVersion()

Returns the OpenGL version this graphics device has been initialized to.

The version is in the form <major>.<minor>.

Returns GLUtils.VERSION_UNKNOWN if version information can't be retrieved.

public abstract java.lang.String getEglVersion()

Returns the EGL version this graphics device has been initialized to.

The version is in the form <major>.<minor>.

Returns GLUtils.VERSION_UNKNOWN if version information can't be retrieved.

public abstract java.lang.String getGlExtensions()

Returns a space separated list of OpenGL extensions or an empty string if extensions could not be retrieved.

public abstract java.lang.String getEglExtensions()

Returns a space separated list of EGL extensions or an empty string if extensions could not be retrieved.

public static GraphicDeviceInfo.Builder builder()

Returns the Builder.

Source

/*
 * Copyright 2024 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.camera.core.processing.util;

import static androidx.camera.core.processing.util.GLUtils.VERSION_UNKNOWN;

import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;

import com.google.auto.value.AutoValue;

/**
 * Information about an initialized graphics device.
 *
 * <p>This information can be used to determine which version or extensions of OpenGL and EGL
 * are supported on the device to ensure the attached output surface will have expected
 * characteristics.
 */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@AutoValue
public abstract class GraphicDeviceInfo {
    /**
     * Returns the OpenGL version this graphics device has been initialized to.
     *
     * <p>The version is in the form &lt;major&gt;.&lt;minor&gt;.
     *
     * <p>Returns {@link GLUtils#VERSION_UNKNOWN} if version information can't be
     * retrieved.
     */
    @NonNull
    public abstract String getGlVersion();

    /**
     * Returns the EGL version this graphics device has been initialized to.
     *
     * <p>The version is in the form &lt;major&gt;.&lt;minor&gt;.
     *
     * <p>Returns {@link GLUtils#VERSION_UNKNOWN} if version information can't be
     * retrieved.
     */
    @NonNull
    public abstract String getEglVersion();

    /**
     * Returns a space separated list of OpenGL extensions or an empty string if extensions
     * could not be retrieved.
     */
    @NonNull
    public abstract String getGlExtensions();

    /**
     * Returns a space separated list of EGL extensions or an empty string if extensions
     * could not be retrieved.
     */
    @NonNull
    public abstract String getEglExtensions();

    /**
     * Returns the Builder.
     */
    @NonNull
    public static Builder builder() {
        return new AutoValue_GraphicDeviceInfo.Builder()
                .setGlVersion(VERSION_UNKNOWN)
                .setEglVersion(VERSION_UNKNOWN)
                .setGlExtensions("")
                .setEglExtensions("");
    }

    // Should not be instantiated directly
    GraphicDeviceInfo() {
    }

    /**
     * Builder for {@link GraphicDeviceInfo}.
     */
    @AutoValue.Builder
    public abstract static class Builder {
        /**
         * Sets the gl version.
         */
        @NonNull
        public abstract Builder setGlVersion(@NonNull String version);

        /**
         * Sets the egl version.
         */
        @NonNull
        public abstract Builder setEglVersion(@NonNull String version);

        /**
         * Sets the gl extensions.
         */
        @NonNull
        public abstract Builder setGlExtensions(@NonNull String extensions);

        /**
         * Sets the egl extensions.
         */
        @NonNull
        public abstract Builder setEglExtensions(@NonNull String extensions);

        /**
         * Builds the {@link GraphicDeviceInfo}.
         */
        @NonNull
        public abstract GraphicDeviceInfo build();
    }
}