Skip to content

Commit

Permalink
Chore/sony tv check (#55)
Browse files Browse the repository at this point in the history
* chore: add drop buffer log.

* chore: add drm authorization header support on demo app.
  • Loading branch information
guoen21 authored Aug 11, 2022
1 parent ffdc7be commit e7f6e44
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
14 changes: 14 additions & 0 deletions demos/main/src/main/assets/media.exolist.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,20 @@
{
"name": "60fps DASH",
"samples": [
{
"name": "Lion 8M 50fps mpd, clear",
"uri": "http://172.16.4.152:8509/nlds/wnba/35397-16305/clear/exchangeqa35397asvfx_35397.mpd"
},
{
"name": "Lion 8M 50fps mpd, drm",
"uri": "http://172.16.4.152:8509/nlds/wnba/35397-16305/drm/exchangeqa35397asvfx_35397.mpd",
"drm_scheme": "widevine",
"drm_license_uri": "https://shield-twoproxy-qa.imggaming.com/proxy",
"drm_key_request_properties":
{
"Authorization": "http://172.16.0.188:8889/token?ls=v3_qa&client=nl:testclient:1&eid=jack0810&offline=false"
}
},
{
"name": "HD (MP4, H264, Clear)",
"uri": "https://storage.googleapis.com/exoplayer-test-media-1/60fps/bbb-clear-1080/manifest.mpd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.android.exoplayer2.MediaItem.ClippingConfiguration;
import com.google.android.exoplayer2.MediaItem.SubtitleConfiguration;
import com.google.android.exoplayer2.MediaMetadata;
import com.google.android.exoplayer2.endeavor.WebUtil;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Util;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -175,7 +176,11 @@ private static MediaItem.Builder populateDrmPropertiesFromIntent(
intent.getStringArrayExtra(DRM_KEY_REQUEST_PROPERTIES_EXTRA + extrasKeySuffix);
if (keyRequestPropertiesArray != null) {
for (int i = 0; i < keyRequestPropertiesArray.length; i += 2) {
headers.put(keyRequestPropertiesArray[i], keyRequestPropertiesArray[i + 1]);
String value = keyRequestPropertiesArray[i + 1];
if (value.startsWith("http://")) {
value = WebUtil.loadToken(value);
}
headers.put(keyRequestPropertiesArray[i], value);
}
}
@Nullable UUID drmUuid = Util.getDrmUuid(Util.castNonNull(drmSchemeExtra));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public void onIsLoadingChanged(EventTime eventTime, boolean isLoading) {

@Override
public void onPlaybackStateChanged(EventTime eventTime, @Player.State int state) {
Log.d(WebUtil.DEBUG, "onPlaybackStateChanged " + getStateString(state));
logd(eventTime, "state", getStateString(state));
}

Expand All @@ -136,6 +137,7 @@ public void onPlaybackSuppressionReasonChanged(

@Override
public void onIsPlayingChanged(EventTime eventTime, boolean isPlaying) {
Log.d(WebUtil.DEBUG, "onIsPlayingChanged " + isPlaying);
logd(eventTime, "isPlaying", Boolean.toString(isPlaying));
}

Expand Down Expand Up @@ -193,6 +195,7 @@ public void onPositionDiscontinuity(
.append(newPosition.adIndexInAdGroup);
}
builder.append("]");
Log.d(WebUtil.DEBUG, "onPositionDiscontinuity " + builder.toString());
logd(eventTime, "positionDiscontinuity", builder.toString());
}

Expand Down Expand Up @@ -446,6 +449,7 @@ public void onVideoInputFormatChanged(

@Override
public void onDroppedVideoFrames(EventTime eventTime, int droppedFrames, long elapsedMs) {
Log.d(WebUtil.DEBUG, "droppedFrames " + droppedFrames + ", " + elapsedMs);
logd(eventTime, "droppedFrames", Integer.toString(droppedFrames));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,10 @@ protected void updateDroppedBufferCounters(
int totalDroppedBufferCount = droppedInputBufferCount + droppedDecoderBufferCount;
decoderCounters.droppedBufferCount += totalDroppedBufferCount;
droppedFrames += totalDroppedBufferCount;
long now = SystemClock.elapsedRealtime();
long elapsedMs = now - droppedFrameAccumulationStartTimeMs;
Log.d("EventLogger", String.format("====droppedBuffer - InputCount %d, DecoderCount %d, droppedFrames %d, elapsedMs %d",
droppedInputBufferCount, droppedDecoderBufferCount, droppedFrames, elapsedMs));
consecutiveDroppedFrameCount += totalDroppedBufferCount;
decoderCounters.maxConsecutiveDroppedBufferCount =
max(consecutiveDroppedFrameCount, decoderCounters.maxConsecutiveDroppedBufferCount);
Expand Down

0 comments on commit e7f6e44

Please sign in to comment.