mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Transformer: Improve misc javadocs and exception logs.
PiperOrigin-RevId: 463971447
This commit is contained in:
parent
c8089ead42
commit
534740fd46
4 changed files with 14 additions and 11 deletions
|
|
@ -1046,23 +1046,23 @@ 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}.
|
||||||
*/
|
*/
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@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
|
|
||||||
*/
|
|
||||||
@UnstableApi public static final int COLOR_SPACE_BT709 = MediaFormat.COLOR_STANDARD_BT709;
|
|
||||||
/**
|
/**
|
||||||
* @see MediaFormat#COLOR_STANDARD_BT601_PAL
|
* @see MediaFormat#COLOR_STANDARD_BT601_PAL
|
||||||
*/
|
*/
|
||||||
@UnstableApi public static final int COLOR_SPACE_BT601 = MediaFormat.COLOR_STANDARD_BT601_PAL;
|
@UnstableApi public static final int COLOR_SPACE_BT601 = MediaFormat.COLOR_STANDARD_BT601_PAL;
|
||||||
|
/**
|
||||||
|
* @see MediaFormat#COLOR_STANDARD_BT709
|
||||||
|
*/
|
||||||
|
@UnstableApi public static final int COLOR_SPACE_BT709 = MediaFormat.COLOR_STANDARD_BT709;
|
||||||
/**
|
/**
|
||||||
* @see MediaFormat#COLOR_STANDARD_BT2020
|
* @see MediaFormat#COLOR_STANDARD_BT2020
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -303,8 +303,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 androidx.media3.common.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;
|
||||||
|
|
@ -327,7 +328,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));
|
||||||
}
|
}
|
||||||
|
|
@ -445,6 +446,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,
|
||||||
|
|
@ -459,6 +461,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();
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,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…
Reference in a new issue