Skip to content

Commit

Permalink
Select non-primary tunneling decoder
Browse files Browse the repository at this point in the history
Issue: #3100
Issue: #5547
PiperOrigin-RevId: 243181217
  • Loading branch information
andrewlewis authored and ojw28 committed Apr 13, 2019
1 parent b84c514 commit 53934c1
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 90 deletions.
11 changes: 8 additions & 3 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
present or newly absent.
* Add support for reading AC-4 streams
([#5303](https://github.com/google/ExoPlayer/pull/5303)).
* Video:
* Remove `MediaCodecSelector.DEFAULT_WITH_FALLBACK`. Apps should instead
signal that fallback should be used by passing `true` as the
`enableDecoderFallback` parameter when instantiating the video renderer.
* Support video tunneling when the decoder is not listed first for the MIME
type ([#3100](https://github.com/google/ExoPlayer/issues/3100)).
* Query `MediaCodecList.ALL_CODECS` when selecting a tunneling decoder
([#5547](https://github.com/google/ExoPlayer/issues/5547)).
* Add support for SHOUTcast ICY metadata
([#3735](https://github.com/google/ExoPlayer/issues/3735)).
* CEA-608: Improved conformance to the specification
Expand Down Expand Up @@ -102,9 +110,6 @@
([#5698](https://github.com/google/ExoPlayer/issues/5698),
[#5694](https://github.com/google/ExoPlayer/issues/5694)).
* Move `PriorityTaskManager` from `DefaultLoadControl` to `SimpleExoPlayer`.
* Remove `MediaCodecSelector.DEFAULT_WITH_FALLBACK`. Apps should instead signal
that fallback should be used by passing `true` as the `enableDecoderFallback`
parameter when instantiating the video renderer.

### 2.9.6 ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,15 @@ && allowPassthrough(format.channelCount, mimeType)
}
}
List<MediaCodecInfo> decoderInfos =
mediaCodecSelector.getDecoderInfos(format.sampleMimeType, requiresSecureDecryption);
mediaCodecSelector.getDecoderInfos(
format.sampleMimeType, requiresSecureDecryption, /* requiresTunnelingDecoder= */ false);
if (decoderInfos.isEmpty()) {
return requiresSecureDecryption
&& !mediaCodecSelector
.getDecoderInfos(format.sampleMimeType, /* requiresSecureDecoder= */ false)
.getDecoderInfos(
format.sampleMimeType,
/* requiresSecureDecoder= */ false,
/* requiresTunnelingDecoder= */ false)
.isEmpty()
? FORMAT_UNSUPPORTED_DRM
: FORMAT_UNSUPPORTED_SUBTYPE;
Expand Down Expand Up @@ -322,7 +326,8 @@ protected List<MediaCodecInfo> getDecoderInfos(
return Collections.singletonList(passthroughDecoderInfo);
}
}
return super.getDecoderInfos(mediaCodecSelector, format, requiresSecureDecoder);
return mediaCodecSelector.getDecoderInfos(
format.sampleMimeType, requiresSecureDecoder, /* requiresTunnelingDecoder= */ false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,9 @@ protected abstract int supportsFormat(MediaCodecSelector mediaCodecSelector,
* @return A list of {@link MediaCodecInfo}s corresponding to decoders. May be empty.
* @throws DecoderQueryException Thrown if there was an error querying decoders.
*/
protected List<MediaCodecInfo> getDecoderInfos(
protected abstract List<MediaCodecInfo> getDecoderInfos(
MediaCodecSelector mediaCodecSelector, Format format, boolean requiresSecureDecoder)
throws DecoderQueryException {
return mediaCodecSelector.getDecoderInfos(format.sampleMimeType, requiresSecureDecoder);
}
throws DecoderQueryException;

/**
* Configures a newly created {@link MediaCodec}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public interface MediaCodecSelector {
MediaCodecSelector DEFAULT =
new MediaCodecSelector() {
@Override
public List<MediaCodecInfo> getDecoderInfos(String mimeType, boolean requiresSecureDecoder)
public List<MediaCodecInfo> getDecoderInfos(
String mimeType, boolean requiresSecureDecoder, boolean requiresTunnelingDecoder)
throws DecoderQueryException {
return MediaCodecUtil.getDecoderInfos(mimeType, requiresSecureDecoder);
return MediaCodecUtil.getDecoderInfos(
mimeType, requiresSecureDecoder, requiresTunnelingDecoder);
}

@Override
Expand All @@ -48,10 +50,12 @@ public List<MediaCodecInfo> getDecoderInfos(String mimeType, boolean requiresSec
*
* @param mimeType The MIME type for which a decoder is required.
* @param requiresSecureDecoder Whether a secure decoder is required.
* @param requiresTunnelingDecoder Whether a tunneling decoder is required.
* @return A list of {@link MediaCodecInfo}s corresponding to decoders. May be empty.
* @throws DecoderQueryException Thrown if there was an error querying decoders.
*/
List<MediaCodecInfo> getDecoderInfos(String mimeType, boolean requiresSecureDecoder)
List<MediaCodecInfo> getDecoderInfos(
String mimeType, boolean requiresSecureDecoder, boolean requiresTunnelingDecoder)
throws DecoderQueryException;

/**
Expand Down
Loading

0 comments on commit 53934c1

Please sign in to comment.