Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RTSP Mp4a-Latm #162

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Fix review comment in Mp4a-Latm reader
Moved getNumOfSubframesFromMpeg4AudioConfig() function call inside
constructor.

Change-Id: If952ea641327dcfe10de50094ca35f3baae985de
  • Loading branch information
rakeshnitb committed Oct 6, 2022
commit cee05d37113f08a606cda7a4224d804c9ff7fdec
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
private int fragmentedSampleSizeBytes;
private long startTimeOffsetUs;
private long sampleTimeUsOfFragmentedSample;
private int numberOfSubframes;
private final int numberOfSubframes;

/** Creates an instance. */
public RtpMp4aReader(RtpPayloadFormat payloadFormat) {
Expand All @@ -65,6 +65,11 @@ public RtpMp4aReader(RtpPayloadFormat payloadFormat) {
// The start time offset must be 0 until the first seek.
startTimeOffsetUs = 0;
sampleTimeUsOfFragmentedSample = C.TIME_UNSET;
try {
numberOfSubframes = getNumOfSubframesFromMpeg4AudioConfig(payloadFormat.fmtpParameters);
} catch (ParserException e) {
throw new IllegalArgumentException(e);
}
}

@Override
Expand All @@ -77,11 +82,6 @@ public void createTracks(ExtractorOutput extractorOutput, int trackId) {
public void onReceivingFirstPacket(long timestamp, int sequenceNumber) {
checkState(firstReceivedTimestamp == C.TIME_UNSET);
firstReceivedTimestamp = timestamp;
try {
numberOfSubframes = getNumOfSubframesFromMpeg4AudioConfig(payloadFormat.fmtpParameters);
} catch (ParserException e) {
throw new IllegalArgumentException(e);
}
}

@Override
Expand Down