Update addMetadata method in Transformer/Muxer.java

This is to align the interface with Muxer/Muxer.java and
then finally replace it.

PiperOrigin-RevId: 625283725
This commit is contained in:
sheenachhabra 2024-04-16 04:37:55 -07:00 committed by Copybara-Service
parent 236c341168
commit 794900bfb8
44 changed files with 161 additions and 83 deletions

View File

@ -36,7 +36,7 @@ public interface Muxer {
TrackToken trackToken, ByteBuffer byteBuffer, MediaCodec.BufferInfo bufferInfo) TrackToken trackToken, ByteBuffer byteBuffer, MediaCodec.BufferInfo bufferInfo)
throws IOException; throws IOException;
/** Adds metadata for the output file. */ /** Adds {@linkplain Metadata.Entry metadata} about the output file. */
void addMetadata(Metadata.Entry metadata); void addMetadata(Metadata.Entry metadata);
/** Closes the file. */ /** Closes the file. */

View File

@ -25,8 +25,9 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.45.100]] entry = Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000
entry = TSSE: description=null: values=[Lavf58.45.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1582745311 dataHashCode = 1582745311

View File

@ -13,7 +13,9 @@ format video:
initializationData: initializationData:
data = length 30, hash 9DFD8D5 data = length 30, hash 9DFD8D5
data = length 9, hash FBADD682 data = length 9, hash FBADD682
container metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf60.3.100]
sample: sample:
trackType = video trackType = video
dataHashCode = 1491581480 dataHashCode = 1491581480

View File

@ -11,7 +11,9 @@ format audio:
metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000]
initializationData: initializationData:
data = length 2, hash 5FF data = length 2, hash 5FF
container metadata = entries=[TSSE: description=null: values=[Lavf60.3.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf60.3.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = -620111888 dataHashCode = -620111888

View File

@ -13,7 +13,10 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container 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] container metadata:
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = video trackType = video
dataHashCode = -770308242 dataHashCode = -770308242

View File

@ -10,7 +10,10 @@ format audio:
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] 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: initializationData:
data = length 2, hash 5F7 data = length 2, hash 5F7
container 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] container metadata:
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1205768497 dataHashCode = 1205768497

View File

@ -25,8 +25,13 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container 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] container metadata:
container 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] entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1205768497 dataHashCode = 1205768497

View File

@ -25,8 +25,13 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container 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] container metadata:
container 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] entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1205768497 dataHashCode = 1205768497

View File

@ -26,8 +26,13 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container 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] container metadata:
container 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] entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1205768497 dataHashCode = 1205768497

View File

@ -19,7 +19,10 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container 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] container metadata:
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -19,7 +19,10 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container 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] container metadata:
entry = Mp4Timestamp: creation time=3547558895, modification time=3547558895, timescale=1000
entry = TSSE: description=null: values=[Lavf56.1.0]
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -25,8 +25,9 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.45.100]] entry = Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000
entry = TSSE: description=null: values=[Lavf58.45.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1582745311 dataHashCode = 1582745311

View File

@ -16,7 +16,8 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000
sample: sample:
trackType = video trackType = video
dataHashCode = -770308242 dataHashCode = -770308242

View File

@ -22,7 +22,8 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=3718109610, modification time=3718109610, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -13,7 +13,13 @@ format video:
initializationData: initializationData:
data = length 33, hash D3FB879D data = length 33, hash D3FB879D
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[mdta: key=com.android.version, value=10, mdta: key=com.android.video.temporal_layers_count, value=4, mdta: key=com.android.capture.fps, value=240.0, SlowMotion: segments=[Segment: startTimeMs=88, endTimeMs=879, speedDivisor=2, Segment: startTimeMs=1255, endTimeMs=1970, speedDivisor=8], smta: captureFrameRate=240.0, svcTemporalLayerCount=4, Mp4Timestamp: creation time=3686904890, modification time=3686904890, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=3686904890, modification time=3686904890, timescale=1000
entry = SlowMotion: segments=[Segment: startTimeMs=88, endTimeMs=879, speedDivisor=2, Segment: startTimeMs=1255, endTimeMs=1970, speedDivisor=8]
entry = mdta: key=com.android.capture.fps, value=240.0
entry = mdta: key=com.android.version, value=10
entry = mdta: key=com.android.video.temporal_layers_count, value=4
entry = smta: captureFrameRate=240.0, svcTemporalLayerCount=4
sample: sample:
trackType = video trackType = video
dataHashCode = 1949079733 dataHashCode = 1949079733

View File

@ -20,8 +20,11 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = xyz: latitude=40.68, longitude=-74.5
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = -1438864202 dataHashCode = -1438864202

View File

@ -19,7 +19,9 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -20,8 +20,11 @@ format video:
initializationData: initializationData:
data = length 29, hash 4746B5D9 data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[xyz: latitude=40.68, longitude=-74.5, Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = xyz: latitude=40.68, longitude=-74.5
entry = xyz: latitude=40.68, longitude=-74.5
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -29,8 +29,11 @@ format video:
initializationData: initializationData:
data = length 31, hash 4B108214 data = length 31, hash 4B108214
data = length 9, hash FBA158BB data = length 9, hash FBA158BB
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf58.76.100]
entry = TSSE: description=null: values=[Lavf58.76.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = 620415738 dataHashCode = 620415738

View File

@ -29,8 +29,11 @@ format video:
initializationData: initializationData:
data = length 31, hash 4B108214 data = length 31, hash 4B108214
data = length 9, hash FBA158BB data = length 9, hash FBA158BB
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf58.76.100]
entry = TSSE: description=null: values=[Lavf58.76.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = -119592194 dataHashCode = -119592194

View File

@ -29,6 +29,9 @@ format video:
initializationData: initializationData:
data = length 31, hash 4B108214 data = length 31, hash 4B108214
data = length 9, hash FBA158BB data = length 9, hash FBA158BB
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf58.76.100]
entry = TSSE: description=null: values=[Lavf58.76.100]
released = true released = true

View File

@ -29,8 +29,11 @@ format video:
initializationData: initializationData:
data = length 31, hash 4B108214 data = length 31, hash 4B108214
data = length 9, hash FBA158BB data = length 9, hash FBA158BB
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf58.76.100]
entry = TSSE: description=null: values=[Lavf58.76.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = -119592194 dataHashCode = -119592194

View File

@ -30,8 +30,11 @@ format video:
initializationData: initializationData:
data = length 31, hash 4B108214 data = length 31, hash 4B108214
data = length 9, hash FBA158BB data = length 9, hash FBA158BB
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[TSSE: description=null: values=[Lavf58.76.100], Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = TSSE: description=null: values=[Lavf58.76.100]
entry = TSSE: description=null: values=[Lavf58.76.100]
sample: sample:
trackType = audio trackType = audio
dataHashCode = -119592194 dataHashCode = -119592194

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 215569108 dataHashCode = 215569108

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1831484889 dataHashCode = 1831484889

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1831484889 dataHashCode = 1831484889

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1831484889 dataHashCode = 1831484889

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1831484889 dataHashCode = 1831484889

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = -1687632261 dataHashCode = -1687632261

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -22,8 +22,9 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -21,7 +21,8 @@ format video:
initializationData: initializationData:
data = length 34, hash 8D738018 data = length 34, hash 8D738018
data = length 10, hash 7A0D0F2B data = length 10, hash 7A0D0F2B
container metadata = entries=[Mp4Timestamp: creation time=0, modification time=0, timescale=1000] container metadata:
entry = Mp4Timestamp: creation time=0, modification time=0, timescale=1000
sample: sample:
trackType = audio trackType = audio
dataHashCode = 1742602241 dataHashCode = 1742602241

View File

@ -463,8 +463,8 @@ public class TransformerPauseResumeTest {
} }
@Override @Override
public void addMetadata(Metadata metadata) { public void addMetadataEntry(Metadata.Entry metadataEntry) {
wrappedMuxer.addMetadata(metadata); wrappedMuxer.addMetadataEntry(metadataEntry);
} }
@Override @Override

View File

@ -76,8 +76,8 @@ public final class DefaultMuxer implements Muxer {
} }
@Override @Override
public void addMetadata(Metadata metadata) { public void addMetadataEntry(Metadata.Entry metadataEntry) {
muxer.addMetadata(metadata); muxer.addMetadataEntry(metadataEntry);
} }
@Override @Override

View File

@ -188,13 +188,10 @@ import java.nio.ByteBuffer;
} }
@Override @Override
public void addMetadata(Metadata metadata) { public void addMetadataEntry(Metadata.Entry metadataEntry) {
for (int i = 0; i < metadata.length(); i++) { if (metadataEntry instanceof Mp4LocationData) {
Metadata.Entry entry = metadata.get(i); mediaMuxer.setLocation(
if (entry instanceof Mp4LocationData) { ((Mp4LocationData) metadataEntry).latitude, ((Mp4LocationData) metadataEntry).longitude);
mediaMuxer.setLocation(
((Mp4LocationData) entry).latitude, ((Mp4LocationData) entry).longitude);
}
} }
} }

View File

@ -220,12 +220,9 @@ public final class InAppMuxer implements Muxer {
} }
@Override @Override
public void addMetadata(Metadata metadata) { public void addMetadataEntry(Metadata.Entry metadataEntry) {
for (int i = 0; i < metadata.length(); i++) { if (Mp4Utils.isMetadataSupported(metadataEntry)) {
Metadata.Entry entry = metadata.get(i); metadataEntries.add(metadataEntry);
if (Mp4Utils.isMetadataSupported(entry)) {
metadataEntries.add(entry);
}
} }
} }

View File

@ -90,8 +90,8 @@ public interface Muxer {
int trackIndex, ByteBuffer data, long presentationTimeUs, @C.BufferFlags int flags) int trackIndex, ByteBuffer data, long presentationTimeUs, @C.BufferFlags int flags)
throws MuxerException; throws MuxerException;
/** Adds {@link Metadata} about the output file. */ /** Adds {@linkplain Metadata.Entry metadata} about the output file. */
void addMetadata(Metadata metadata); void addMetadataEntry(Metadata.Entry metadataEntry);
/** /**
* Finishes writing the output and releases any resources associated with muxing. * Finishes writing the output and releases any resources associated with muxing.

View File

@ -472,7 +472,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
trackTypeToInfo.put(trackType, trackInfo); trackTypeToInfo.put(trackType, trackInfo);
if (format.metadata != null) { if (format.metadata != null) {
muxer.addMetadata(format.metadata); for (int i = 0; i < format.metadata.length(); i++) {
muxer.addMetadataEntry(format.metadata.get(i));
}
} }
if (trackTypeToInfo.size() == trackCount) { if (trackTypeToInfo.size() == trackCount) {

View File

@ -86,7 +86,7 @@ public final class CapturingMuxer implements Muxer, Dumpable {
private final SparseArray<DumpableFormat> dumpableFormatByTrackType; private final SparseArray<DumpableFormat> dumpableFormatByTrackType;
private final SparseArray<DumpableStream> dumpableStreamByTrackType; private final SparseArray<DumpableStream> dumpableStreamByTrackType;
private final Map<Integer, Integer> trackIndexToType; private final Map<Integer, Integer> trackIndexToType;
private final ArrayList<Metadata> metadataList; private final ArrayList<Metadata.Entry> metadataList;
private boolean released; private boolean released;
/** Creates a new test muxer. */ /** Creates a new test muxer. */
@ -133,9 +133,9 @@ public final class CapturingMuxer implements Muxer, Dumpable {
} }
@Override @Override
public void addMetadata(Metadata metadata) { public void addMetadataEntry(Metadata.Entry metadataEntry) {
metadataList.add(metadata); metadataList.add(metadataEntry);
wrappedMuxer.addMetadata(metadata); wrappedMuxer.addMetadataEntry(metadataEntry);
} }
@Override @Override
@ -152,9 +152,13 @@ public final class CapturingMuxer implements Muxer, Dumpable {
dumpableFormatByTrackType.valueAt(i).dump(dumper); dumpableFormatByTrackType.valueAt(i).dump(dumper);
} }
Collections.sort(metadataList, Comparator.comparing(Metadata::toString)); if (!metadataList.isEmpty()) {
for (Metadata metadata : metadataList) { Collections.sort(metadataList, Comparator.comparing(Metadata.Entry::toString));
dumper.add("container metadata", metadata); dumper.startBlock("container metadata");
for (Metadata.Entry metadata : metadataList) {
dumper.add("entry", metadata);
}
dumper.endBlock();
} }
for (int i = 0; i < dumpableStreamByTrackType.size(); i++) { for (int i = 0; i < dumpableStreamByTrackType.size(); i++) {