mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix HLS' mime type propagation
Issue:#3653 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=182064250
This commit is contained in:
parent
a4114f59b6
commit
be304486e0
3 changed files with 13 additions and 2 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
### dev-v2 (not yet released) ###
|
### dev-v2 (not yet released) ###
|
||||||
|
|
||||||
|
* HLS: Fix mime type propagation
|
||||||
|
([#3653](https://github.com/google/ExoPlayer/issues/3653)).
|
||||||
* SimpleExoPlayerView: Automatically apply video rotation if
|
* SimpleExoPlayerView: Automatically apply video rotation if
|
||||||
`SimpleExoPlayerView` is configured to use `TextureView`
|
`SimpleExoPlayerView` is configured to use `TextureView`
|
||||||
([#91](https://github.com/google/ExoPlayer/issues/91)).
|
([#91](https://github.com/google/ExoPlayer/issues/91)).
|
||||||
|
|
|
||||||
|
|
@ -474,8 +474,15 @@ public final class Format implements Parcelable {
|
||||||
drmInitData, metadata);
|
drmInitData, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Format copyWithContainerInfo(String id, String codecs, int bitrate, int width, int height,
|
public Format copyWithContainerInfo(
|
||||||
@C.SelectionFlags int selectionFlags, String language) {
|
String id,
|
||||||
|
String sampleMimeType,
|
||||||
|
String codecs,
|
||||||
|
int bitrate,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
@C.SelectionFlags int selectionFlags,
|
||||||
|
String language) {
|
||||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize, width,
|
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize, width,
|
||||||
height, frameRate, rotationDegrees, pixelWidthHeightRatio, projectionData, stereoMode,
|
height, frameRate, rotationDegrees, pixelWidthHeightRatio, projectionData, stereoMode,
|
||||||
colorInfo, channelCount, sampleRate, pcmEncoding, encoderDelay, encoderPadding,
|
colorInfo, channelCount, sampleRate, pcmEncoding, encoderDelay, encoderPadding,
|
||||||
|
|
|
||||||
|
|
@ -882,8 +882,10 @@ import java.util.Arrays;
|
||||||
int bitrate = propagateBitrate ? playlistFormat.bitrate : Format.NO_VALUE;
|
int bitrate = propagateBitrate ? playlistFormat.bitrate : Format.NO_VALUE;
|
||||||
int sampleTrackType = MimeTypes.getTrackType(sampleFormat.sampleMimeType);
|
int sampleTrackType = MimeTypes.getTrackType(sampleFormat.sampleMimeType);
|
||||||
String codecs = Util.getCodecsOfType(playlistFormat.codecs, sampleTrackType);
|
String codecs = Util.getCodecsOfType(playlistFormat.codecs, sampleTrackType);
|
||||||
|
String mimeType = MimeTypes.getMediaMimeType(codecs);
|
||||||
return sampleFormat.copyWithContainerInfo(
|
return sampleFormat.copyWithContainerInfo(
|
||||||
playlistFormat.id,
|
playlistFormat.id,
|
||||||
|
mimeType,
|
||||||
codecs,
|
codecs,
|
||||||
bitrate,
|
bitrate,
|
||||||
playlistFormat.width,
|
playlistFormat.width,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue