exoplayer: upd sabr classes

This commit is contained in:
Yuriy Liskov
2025-11-03 22:38:26 +02:00
parent 3f473a58aa
commit 31eef77cf1
6 changed files with 39 additions and 31 deletions

View File

@@ -41,7 +41,7 @@ public class VideoLoaderController extends BasePlayerController {
private static final long BUFFERING_THRESHOLD_MS = 3_000;
private static final long BUFFERING_WINDOW_MS = 60_000;
private static final long BUFFERING_RECURRENCE_COUNT = 5;
private static final long BUFFERING_CONTINUATION_MS = 15_000;
private static final long BUFFERING_CONTINUATION_MS = 20_000;
private final Playlist mPlaylist;
private Video mPendingVideo;
private int mLastErrorType = -1;

View File

@@ -27,6 +27,7 @@ import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.liskovsoft.sharedutils.helpers.AppInfoHelpers;
import com.liskovsoft.sharedutils.helpers.DeviceHelpers;
import com.liskovsoft.sharedutils.helpers.FileHelpers;
import com.liskovsoft.sharedutils.helpers.Helpers;
import com.liskovsoft.sharedutils.querystringparser.UrlQueryStringFactory;
@@ -359,10 +360,8 @@ public final class DebugInfoManager implements Runnable, Player.EventListener {
}
private void appendMemoryInfo() {
long maxMemory = Runtime.getRuntime().maxMemory();
long allocatedMemory = Runtime.getRuntime().totalMemory();
appendRow("Memory limit (MB)", (int)(maxMemory / (1024 * 1024))); // Growth Limit
appendRow("Allocated memory (MB)", (int)(allocatedMemory / (1024 * 1024)));
appendRow("Max heap memory (MB)", DeviceHelpers.getMaxHeapMemoryMB()); // Growth Limit
appendRow("Allocated heap memory (MB)", DeviceHelpers.getAllocatedHeapMemoryMB());
}
private void appendWebViewInfo() {

View File

@@ -32,6 +32,7 @@ import com.google.android.exoplayer2.source.sabr.manifest.RangedUri;
import com.google.android.exoplayer2.source.sabr.manifest.Representation;
import com.google.android.exoplayer2.source.sabr.manifest.SabrManifest;
import com.google.android.exoplayer2.source.sabr.parser.SabrExtractor;
import com.google.android.exoplayer2.source.sabr.parser.SabrStream;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DataSpec;
@@ -111,6 +112,8 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
private boolean missingLastSegment;
private long liveEdgeTimeUs;
private final SabrStream sabrStream;
/**
* @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
* @param manifest The initial manifest.
@@ -157,6 +160,22 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
long periodDurationUs = manifest.getPeriodDurationUs(periodIndex);
liveEdgeTimeUs = C.TIME_UNSET;
// TODO: replace nulls with the actual values
sabrStream = new SabrStream(
null,
null,
null,
null,
null,
null,
-1,
-1,
-1,
null,
false,
null
);
List<Representation> representations = getRepresentations();
representationHolders = new RepresentationHolder[trackSelection.length()];
for (int i = 0; i < representationHolders.length; i++) {
@@ -168,7 +187,8 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
representation,
enableEventMessageTrack,
closedCaptionFormats,
playerTrackEmsgHandler);
playerTrackEmsgHandler,
sabrStream);
}
}
@@ -611,7 +631,8 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
Representation representation,
boolean enableEventMessageTrack,
List<Format> closedCaptionFormats,
TrackOutput playerEmsgTrackOutput) {
TrackOutput playerEmsgTrackOutput,
SabrStream sabrStream) {
this(
periodDurationUs,
representation,
@@ -620,7 +641,8 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
representation,
enableEventMessageTrack,
closedCaptionFormats,
playerEmsgTrackOutput),
playerEmsgTrackOutput,
sabrStream),
/* segmentNumShift= */ 0,
representation.getIndex());
}
@@ -773,7 +795,8 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
Representation representation,
boolean enableEventMessageTrack,
List<Format> closedCaptionFormats,
TrackOutput playerEmsgTrackOutput) {
TrackOutput playerEmsgTrackOutput,
SabrStream sabrStream) {
String containerMimeType = representation.format.containerMimeType;
if (mimeTypeIsRawText(containerMimeType)) {
return null;
@@ -795,7 +818,7 @@ public class DefaultSabrChunkSource implements SabrChunkSource {
// flags, null, null, null, closedCaptionFormats, playerEmsgTrackOutput);
//}
Extractor extractor = new SabrExtractor(trackType, representation.format); // TODO: add more params (from the manifest) into the constructor
Extractor extractor = new SabrExtractor(trackType, representation.format, sabrStream); // TODO: add more params (from the manifest) into the constructor
// Prefer drmInitData obtained from the manifest over drmInitData obtained from the stream,
// as per DASH IF Interoperability Recommendations V3.0, 7.5.3.

View File

@@ -274,26 +274,12 @@ public class SabrExtractor implements Extractor {
* @param trackType The type of the track. Typically one of the {@link com.google.android.exoplayer2.C}
* {@code TRACK_TYPE_*} constants.
*/
public SabrExtractor(int trackType, @NonNull Format format) {
this(0, trackType, format);
public SabrExtractor(int trackType, @NonNull Format format, @NonNull SabrStream sabrStream) {
this(0, trackType, format, sabrStream);
}
private SabrExtractor(@Flags int flags, int trackType, @NonNull Format format) {
// TODO: replace nulls with the actual values
sabrStream = new SabrStream(
null,
null,
null,
null,
null,
null,
-1,
-1,
-1,
null,
false,
null
);
private SabrExtractor(@Flags int flags, int trackType, @NonNull Format format, @NonNull SabrStream sabrStream) {
this.sabrStream = sabrStream;
this.format = format;
this.trackType = trackType;
seekForCuesEnabled = (flags & FLAG_DISABLE_SEEK_FOR_CUES) == 0;

View File

@@ -60,8 +60,8 @@ android {
applicationId "com.liskovsoft.smarttubetv"
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
versionCode 2214
versionName "30.24"
versionCode 2215
versionName "30.25"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"