Commit 3730639c by olly Committed by Oliver Woodman

Don't set decoded bitrate on audio/flac format

PiperOrigin-RevId: 297864386
parent 1ca9a061
Showing with 28 additions and 128 deletions
......@@ -270,7 +270,7 @@ public final class FlacExtractor implements Extractor {
/* id= */ null,
MimeTypes.AUDIO_RAW,
/* codecs= */ null,
streamMetadata.getBitRate(),
streamMetadata.getDecodedBitrate(),
streamMetadata.getMaxDecodedFrameSize(),
streamMetadata.channels,
streamMetadata.sampleRate,
......
......@@ -644,34 +644,42 @@ public final class Format implements Parcelable {
/** Track role flags. */
@C.RoleFlags public final int roleFlags;
/**
* The average bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. This
* field may be populated from the following sources, depending on media type and the type of the
* track within the media:
* The average bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. The
* way in which this field is populated depends on the type of media to which the format
* corresponds:
*
* <ul>
* <li>DASH: Always {@link Format#NO_VALUE}.
* <li>HLS: The {@code AVERAGE-BANDWIDTH} attribute defined on the corresponding {@code
* <li>DASH representations: Always {@link Format#NO_VALUE}.
* <li>HLS variants: The {@code AVERAGE-BANDWIDTH} attribute defined on the corresponding {@code
* EXT-X-STREAM-INF} tag in the master playlist, or {@link Format#NO_VALUE} if not present.
* <li>SmoothStreaming: The {@code Bitrate} attribute defined on the corresponding {@code
* TrackElement} in the manifest, or {@link Format#NO_VALUE} if not present.
* <li>SmoothStreaming track elements: The {@code Bitrate} attribute defined on the
* corresponding {@code TrackElement} in the manifest, or {@link Format#NO_VALUE} if not
* present.
* <li>Progressive container formats: Often {@link Format#NO_VALUE}, but may be populated with
* the average bitrate if defined by the container.
* the average bitrate of the container if known.
* <li>Sample formats: Often {@link Format#NO_VALUE}, but may be populated with the average
* bitrate of the stream of samples with type {@link #sampleMimeType} if known. Note that if
* {@link #sampleMimeType} is a compressed format (e.g., {@link MimeTypes#AUDIO_AAC}), then
* this bitrate is for the stream of still compressed samples.
* </ul>
*/
public final int averageBitrate;
/**
* The peak bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. This
* field may be populated from the following sources, depending on media type and the type of the
* track within the media:
* The peak bitrate in bits per second, or {@link #NO_VALUE} if unknown or not applicable. The way
* in which this field is populated depends on the type of media to which the format corresponds:
*
* <ul>
* <li>DASH: The {@code @bandwidth} attribute of the corresponding {@code Representation}
* element in the manifest.
* <li>HLS: The {@code BANDWIDTH} attribute defined on the corresponding {@code
* <li>DASH representations: The {@code @bandwidth} attribute of the corresponding {@code
* Representation} element in the manifest.
* <li>HLS variants: The {@code BANDWIDTH} attribute defined on the corresponding {@code
* EXT-X-STREAM-INF} tag.
* <li>SmoothStreaming: Always {@link Format#NO_VALUE}.
* <li>SmoothStreaming track elements: Always {@link Format#NO_VALUE}.
* <li>Progressive container formats: Often {@link Format#NO_VALUE}, but may be populated with
* the peak bitrate if defined by the container.
* the peak bitrate of the container if known.
* <li>Sample formats: Often {@link Format#NO_VALUE}, but may be populated with the peak bitrate
* of the stream of samples with type {@link #sampleMimeType} if known. Note that if {@link
* #sampleMimeType} is a compressed format (e.g., {@link MimeTypes#AUDIO_AAC}), then this
* bitrate is for the stream of still compressed samples.
* </ul>
*/
public final int peakBitrate;
......
......@@ -182,8 +182,8 @@ public final class FlacStreamMetadata {
return maxBlockSizeSamples * channels * (bitsPerSample / 8);
}
/** Returns the bit-rate of the FLAC stream. */
public int getBitRate() {
/** Returns the bitrate of the stream after it's decoded into PCM. */
public int getDecodedBitrate() {
return bitsPerSample * sampleRate * channels;
}
......@@ -244,7 +244,7 @@ public final class FlacStreamMetadata {
/* id= */ null,
MimeTypes.AUDIO_FLAC,
/* codecs= */ null,
getBitRate(),
/* bitrate= */ Format.NO_VALUE,
maxInputSize,
channels,
sampleRate,
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3829
sample count = 2
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
channelCount = 2
sampleRate = 48000
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
channelCount = 2
sampleRate = 48000
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
channelCount = 2
sampleRate = 48000
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3829
sample count = 2
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
channelCount = 2
sampleRate = 48000
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
channelCount = 2
sampleRate = 48000
......
......@@ -8,8 +8,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -8,8 +8,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -7,8 +7,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -7,8 +7,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 445
sample count = 1
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -7,8 +7,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 144086
sample count = 27
format 0:
averageBitrate = 1408000
peakBitrate = 1408000
sampleMimeType = audio/flac
maxInputSize = 6456
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 100240
sample count = 19
format 0:
averageBitrate = 1408000
peakBitrate = 1408000
sampleMimeType = audio/flac
maxInputSize = 6456
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 48500
sample count = 10
format 0:
averageBitrate = 1408000
peakBitrate = 1408000
sampleMimeType = audio/flac
maxInputSize = 6456
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3385
sample count = 2
format 0:
averageBitrate = 1408000
peakBitrate = 1408000
sampleMimeType = audio/flac
maxInputSize = 6456
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 144086
sample count = 27
format 0:
averageBitrate = 1408000
peakBitrate = 1408000
sampleMimeType = audio/flac
maxInputSize = 6456
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3829
sample count = 2
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3829
sample count = 2
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3829
sample count = 2
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 3829
sample count = 2
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 445
sample count = 1
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 113666
sample count = 23
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 55652
sample count = 12
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -10,8 +10,6 @@ track 0:
total output bytes = 445
sample count = 1
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
......@@ -7,8 +7,6 @@ track 0:
total output bytes = 164431
sample count = 33
format 0:
averageBitrate = 1536000
peakBitrate = 1536000
sampleMimeType = audio/flac
maxInputSize = 5776
channelCount = 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment