Skip to content

Commit

Permalink
Updated golden file tests and readded constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
microkatz committed Oct 13, 2023
1 parent 2043970 commit d0b84da
Show file tree
Hide file tree
Showing 129 changed files with 306 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.Arrays;
import org.checkerframework.dataflow.qual.Pure;

// copybara:exo-only import com.google.android.exoplayer2.Bundleable;
// copybara:exo-only import com.google.android.exoplayer2.C;
// copybara:exo-only import com.google.android.exoplayer2.Format;
Expand Down Expand Up @@ -256,6 +257,24 @@ public static boolean isTransferHdr(@Nullable ColorInfo colorInfo) {
// Lazily initialized hashcode.
private int hashCode;

/**
* Constructs the ColorInfo.
*
* @param colorSpace The color space of the video.
* @param colorRange The color range of the video.
* @param colorTransfer The color transfer characteristics of the video.
* @param hdrStaticInfo HdrStaticInfo as defined in CTA-861.3, or null if none specified.
* @deprecated Use {@link Builder}.
*/
@Deprecated
public ColorInfo(
@C.ColorSpace int colorSpace,
@C.ColorRange int colorRange,
@C.ColorTransfer int colorTransfer,
@Nullable byte[] hdrStaticInfo) {
this(colorSpace, colorRange, colorTransfer, hdrStaticInfo, Format.NO_VALUE, Format.NO_VALUE);
}

/**
* Constructs the ColorInfo.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,10 @@ private static MediaCodecInfo buildAacCodecInfo() {
}

private static ColorInfo buildColorInfo(@C.ColorSpace int colorSpace) {
return new ColorInfo.Builder().setColorSpace(
colorSpace).setColorRange(C.COLOR_RANGE_FULL).setColorTransfer(C.COLOR_TRANSFER_HLG).build();
return new ColorInfo.Builder()
.setColorSpace(colorSpace)
.setColorRange(C.COLOR_RANGE_FULL)
.setColorTransfer(C.COLOR_TRANSFER_HLG)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ public void generatePayloadFormat_withH264MediaDescription_succeeds() {
.setHeight(544)
.setWidth(960)
.setCodecs("avc1.64001F")
.setColorInfo(new ColorInfo.Builder()
.setColorRange(1)
.setLumaBitdepth(8)
.setChromaBitdepth(8)
.build())
.setColorInfo(
new ColorInfo.Builder()
.setColorRange(1)
.setLumaBitdepth(8)
.setChromaBitdepth(8)
.build())
.setInitializationData(
ImmutableList.of(
new byte[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 120
pixelWidthHeightRatio = 0.5
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf58.42.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 32, hash 1F3D6E87
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 120
pixelWidthHeightRatio = 0.5
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf58.42.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 32, hash 1F3D6E87
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 120
pixelWidthHeightRatio = 0.5
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf58.42.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 32, hash 1F3D6E87
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 120
pixelWidthHeightRatio = 0.5
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf58.42.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 32, hash 1F3D6E87
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 720
frameRate = 29.970028
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0], xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 720
frameRate = 29.970028
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0], xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 720
frameRate = 29.970028
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0], xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 720
frameRate = 29.970028
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0], xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ track 0:
height = 720
frameRate = 29.970028
colorInfo:
colorSpace = -1
colorRange = -1
colorTransfer = -1
hdrStaticInfo = length 0, hash 0
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0], xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ track 0:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ track 0:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ track 0:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ track 0:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ track 0:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000]
initializationData:
data = length 29, hash 4746B5D9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ track 0:
colorInfo:
colorSpace = 2
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=major_brand, value=mp42, mdta: key=minor_version, value=0, mdta: key=compatible_brands, value=isommp42, mdta: key=com.android.capture.fps, value=240.0, mdta: key=com.android.version, value=10, mdta: key=encoder, value=Lavf58.29.100, Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 22, hash 4CF81805
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ track 0:
colorInfo:
colorSpace = 2
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=major_brand, value=mp42, mdta: key=minor_version, value=0, mdta: key=compatible_brands, value=isommp42, mdta: key=com.android.capture.fps, value=240.0, mdta: key=com.android.version, value=10, mdta: key=encoder, value=Lavf58.29.100, Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 22, hash 4CF81805
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ track 0:
colorInfo:
colorSpace = 2
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=major_brand, value=mp42, mdta: key=minor_version, value=0, mdta: key=compatible_brands, value=isommp42, mdta: key=com.android.capture.fps, value=240.0, mdta: key=com.android.version, value=10, mdta: key=encoder, value=Lavf58.29.100, Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 22, hash 4CF81805
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ track 0:
colorInfo:
colorSpace = 2
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=major_brand, value=mp42, mdta: key=minor_version, value=0, mdta: key=compatible_brands, value=isommp42, mdta: key=com.android.capture.fps, value=240.0, mdta: key=com.android.version, value=10, mdta: key=encoder, value=Lavf58.29.100, Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 22, hash 4CF81805
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ track 0:
colorInfo:
colorSpace = 2
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=major_brand, value=mp42, mdta: key=minor_version, value=0, mdta: key=compatible_brands, value=isommp42, mdta: key=com.android.capture.fps, value=240.0, mdta: key=com.android.version, value=10, mdta: key=encoder, value=Lavf58.29.100, Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData:
data = length 22, hash 4CF81805
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ track 0:
codecs = avc1.64001F
width = 1080
height = 720
colorInfo:
lumaBitdepth = 8
chromaBitdepth = 8
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
Expand Down
Loading

0 comments on commit d0b84da

Please sign in to comment.