mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove useHdr from overlaySettings
useHdr is unused option and doesn't make sense is the dynamic range of the overlay and video must match Also reorders and adds javadoc in line with coding conventions PiperOrigin-RevId: 642555396
This commit is contained in:
parent
5a24f40a66
commit
20d56341fc
@ -19,6 +19,8 @@
|
||||
* Metadata:
|
||||
* DRM:
|
||||
* Effect:
|
||||
* Remove unused `OverlaySettings.useHdr` since dynamic range of overlay
|
||||
and frame must match.
|
||||
* Muxers:
|
||||
* IMA extension:
|
||||
* Session:
|
||||
|
@ -28,36 +28,9 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class OverlaySettings {
|
||||
public final boolean useHdr;
|
||||
public final float alphaScale;
|
||||
public final Pair<Float, Float> backgroundFrameAnchor;
|
||||
public final Pair<Float, Float> overlayFrameAnchor;
|
||||
public final Pair<Float, Float> scale;
|
||||
public final float rotationDegrees;
|
||||
|
||||
private OverlaySettings(
|
||||
boolean useHdr,
|
||||
float alphaScale,
|
||||
Pair<Float, Float> backgroundFrameAnchor,
|
||||
Pair<Float, Float> overlayFrameAnchor,
|
||||
Pair<Float, Float> scale,
|
||||
float rotationDegrees) {
|
||||
this.useHdr = useHdr;
|
||||
this.alphaScale = alphaScale;
|
||||
this.backgroundFrameAnchor = backgroundFrameAnchor;
|
||||
this.overlayFrameAnchor = overlayFrameAnchor;
|
||||
this.scale = scale;
|
||||
this.rotationDegrees = rotationDegrees;
|
||||
}
|
||||
|
||||
/** Returns a new {@link Builder} initialized with the values of this instance. */
|
||||
/* package */ Builder buildUpon() {
|
||||
return new Builder(this);
|
||||
}
|
||||
|
||||
/** A builder for {@link OverlaySettings} instances. */
|
||||
public static final class Builder {
|
||||
private boolean useHdr;
|
||||
private float alphaScale;
|
||||
private Pair<Float, Float> backgroundFrameAnchor;
|
||||
private Pair<Float, Float> overlayFrameAnchor;
|
||||
@ -74,7 +47,6 @@ public final class OverlaySettings {
|
||||
}
|
||||
|
||||
private Builder(OverlaySettings overlaySettings) {
|
||||
this.useHdr = overlaySettings.useHdr;
|
||||
this.alphaScale = overlaySettings.alphaScale;
|
||||
this.backgroundFrameAnchor = overlaySettings.backgroundFrameAnchor;
|
||||
this.overlayFrameAnchor = overlaySettings.overlayFrameAnchor;
|
||||
@ -82,18 +54,6 @@ public final class OverlaySettings {
|
||||
this.rotationDegrees = overlaySettings.rotationDegrees;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether input overlay comes from an HDR source. If {@code true}, colors will be in
|
||||
* linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
|
||||
*
|
||||
* <p>Set to {@code false} by default.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
public Builder setUsesHdr(boolean useHdr) {
|
||||
this.useHdr = useHdr;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the alpha scale value of the overlay, altering its translucency.
|
||||
*
|
||||
@ -183,7 +143,40 @@ public final class OverlaySettings {
|
||||
/** Creates an instance of {@link OverlaySettings}, using defaults if values are unset. */
|
||||
public OverlaySettings build() {
|
||||
return new OverlaySettings(
|
||||
useHdr, alphaScale, backgroundFrameAnchor, overlayFrameAnchor, scale, rotationDegrees);
|
||||
alphaScale, backgroundFrameAnchor, overlayFrameAnchor, scale, rotationDegrees);
|
||||
}
|
||||
}
|
||||
|
||||
/** The alpha scale value of the overlay, altering its translucency. */
|
||||
public final float alphaScale;
|
||||
|
||||
/** The coordinates for the anchor point of the overlay within the background frame. */
|
||||
public final Pair<Float, Float> backgroundFrameAnchor;
|
||||
|
||||
/** The coordinates for the anchor point of the overlay frame. */
|
||||
public final Pair<Float, Float> overlayFrameAnchor;
|
||||
|
||||
/** The scaling of the overlay. */
|
||||
public final Pair<Float, Float> scale;
|
||||
|
||||
/** The rotation of the overlay, counter-clockwise. */
|
||||
public final float rotationDegrees;
|
||||
|
||||
private OverlaySettings(
|
||||
float alphaScale,
|
||||
Pair<Float, Float> backgroundFrameAnchor,
|
||||
Pair<Float, Float> overlayFrameAnchor,
|
||||
Pair<Float, Float> scale,
|
||||
float rotationDegrees) {
|
||||
this.alphaScale = alphaScale;
|
||||
this.backgroundFrameAnchor = backgroundFrameAnchor;
|
||||
this.overlayFrameAnchor = overlayFrameAnchor;
|
||||
this.scale = scale;
|
||||
this.rotationDegrees = rotationDegrees;
|
||||
}
|
||||
|
||||
/** Returns a new {@link Builder} initialized with the values of this instance. */
|
||||
/* package */ Builder buildUpon() {
|
||||
return new Builder(this);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user