mirror of
https://github.com/androidx/media.git
synced 2025-05-16 12:09:50 +08:00
Transformer: Improve misc javadocs and exception logs.
PiperOrigin-RevId: 463971447 (cherry picked from commit 810f451ec6ac83311f5ae902aba12428877bd809)
This commit is contained in:
parent
6a3d7f6079
commit
c09dccc8b0
@ -1024,22 +1024,22 @@ public final class C {
|
|||||||
|
|
||||||
// LINT.IfChange(color_space)
|
// LINT.IfChange(color_space)
|
||||||
/**
|
/**
|
||||||
* Video colorspaces. One of {@link Format#NO_VALUE}, {@link #COLOR_SPACE_BT709}, {@link
|
* Video colorspaces. One of {@link Format#NO_VALUE}, {@link #COLOR_SPACE_BT601}, {@link
|
||||||
* #COLOR_SPACE_BT601} or {@link #COLOR_SPACE_BT2020}.
|
* #COLOR_SPACE_BT709} or {@link #COLOR_SPACE_BT2020}.
|
||||||
*/
|
*/
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@Target(TYPE_USE)
|
@Target(TYPE_USE)
|
||||||
@IntDef({Format.NO_VALUE, COLOR_SPACE_BT709, COLOR_SPACE_BT601, COLOR_SPACE_BT2020})
|
@IntDef({Format.NO_VALUE, COLOR_SPACE_BT601, COLOR_SPACE_BT709, COLOR_SPACE_BT2020})
|
||||||
public @interface ColorSpace {}
|
public @interface ColorSpace {}
|
||||||
/**
|
|
||||||
* @see MediaFormat#COLOR_STANDARD_BT709
|
|
||||||
*/
|
|
||||||
public static final int COLOR_SPACE_BT709 = MediaFormat.COLOR_STANDARD_BT709;
|
|
||||||
/**
|
/**
|
||||||
* @see MediaFormat#COLOR_STANDARD_BT601_PAL
|
* @see MediaFormat#COLOR_STANDARD_BT601_PAL
|
||||||
*/
|
*/
|
||||||
public static final int COLOR_SPACE_BT601 = MediaFormat.COLOR_STANDARD_BT601_PAL;
|
public static final int COLOR_SPACE_BT601 = MediaFormat.COLOR_STANDARD_BT601_PAL;
|
||||||
|
/**
|
||||||
|
* @see MediaFormat#COLOR_STANDARD_BT709
|
||||||
|
*/
|
||||||
|
public static final int COLOR_SPACE_BT709 = MediaFormat.COLOR_STANDARD_BT709;
|
||||||
/**
|
/**
|
||||||
* @see MediaFormat#COLOR_STANDARD_BT2020
|
* @see MediaFormat#COLOR_STANDARD_BT2020
|
||||||
*/
|
*/
|
||||||
|
@ -302,8 +302,8 @@ public final class MediaFormatUtil {
|
|||||||
/** Whether this is a valid {@link C.ColorSpace} instance. */
|
/** Whether this is a valid {@link C.ColorSpace} instance. */
|
||||||
private static boolean isValidColorSpace(int colorSpace) {
|
private static boolean isValidColorSpace(int colorSpace) {
|
||||||
// LINT.IfChange(color_space)
|
// LINT.IfChange(color_space)
|
||||||
return colorSpace == C.COLOR_SPACE_BT709
|
return colorSpace == C.COLOR_SPACE_BT601
|
||||||
|| colorSpace == C.COLOR_SPACE_BT601
|
|| colorSpace == C.COLOR_SPACE_BT709
|
||||||
|| colorSpace == C.COLOR_SPACE_BT2020
|
|| colorSpace == C.COLOR_SPACE_BT2020
|
||||||
|| colorSpace == Format.NO_VALUE;
|
|| colorSpace == Format.NO_VALUE;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import static com.google.android.exoplayer2.util.Util.SDK_INT;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.MediaCodec;
|
import android.media.MediaCodec;
|
||||||
import android.media.MediaCodec.BufferInfo;
|
import android.media.MediaCodec.BufferInfo;
|
||||||
|
import android.media.MediaCrypto;
|
||||||
import android.media.MediaFormat;
|
import android.media.MediaFormat;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@ -325,7 +326,7 @@ public final class DefaultCodec implements Codec {
|
|||||||
throw createTransformationException(
|
throw createTransformationException(
|
||||||
new IllegalStateException(
|
new IllegalStateException(
|
||||||
"Codec output color format does not match configured color format. Configured: "
|
"Codec output color format does not match configured color format. Configured: "
|
||||||
+ configurationFormat.colorInfo
|
+ configuredOutputColor
|
||||||
+ ". Actual: "
|
+ ". Actual: "
|
||||||
+ outputFormat.colorInfo));
|
+ outputFormat.colorInfo));
|
||||||
}
|
}
|
||||||
@ -443,6 +444,7 @@ public final class DefaultCodec implements Codec {
|
|||||||
return formatBuilder.build();
|
return formatBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Calls and traces {@link MediaCodec#configure(MediaFormat, Surface, MediaCrypto, int)}. */
|
||||||
private static void configureCodec(
|
private static void configureCodec(
|
||||||
MediaCodec codec,
|
MediaCodec codec,
|
||||||
MediaFormat mediaFormat,
|
MediaFormat mediaFormat,
|
||||||
@ -457,6 +459,7 @@ public final class DefaultCodec implements Codec {
|
|||||||
TraceUtil.endSection();
|
TraceUtil.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Calls and traces {@link MediaCodec#start()}. */
|
||||||
private static void startCodec(MediaCodec codec) {
|
private static void startCodec(MediaCodec codec) {
|
||||||
TraceUtil.beginSection("startCodec");
|
TraceUtil.beginSection("startCodec");
|
||||||
codec.start();
|
codec.start();
|
||||||
|
@ -401,7 +401,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
|
|||||||
/**
|
/**
|
||||||
* Expands or shrinks the frame based on the {@link FrameInfo#pixelWidthHeightRatio} and returns a
|
* Expands or shrinks the frame based on the {@link FrameInfo#pixelWidthHeightRatio} and returns a
|
||||||
* new {@link FrameInfo} instance with scaled dimensions and {@link
|
* new {@link FrameInfo} instance with scaled dimensions and {@link
|
||||||
* FrameInfo#pixelWidthHeightRatio} 1.
|
* FrameInfo#pixelWidthHeightRatio} of {@code 1}.
|
||||||
*/
|
*/
|
||||||
private FrameInfo adjustForPixelWidthHeightRatio(FrameInfo frameInfo) {
|
private FrameInfo adjustForPixelWidthHeightRatio(FrameInfo frameInfo) {
|
||||||
if (frameInfo.pixelWidthHeightRatio > 1f) {
|
if (frameInfo.pixelWidthHeightRatio > 1f) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user