Skip to content

Commit

Permalink
Merge pull request #10349 from google/dev-v2-r2.18.0
Browse files Browse the repository at this point in the history
r2.18.0
  • Loading branch information
icbaker committed Jun 17, 2022
2 parents a308c69 + 85d8682 commit 03569f9
Show file tree
Hide file tree
Showing 825 changed files with 56,460 additions and 15,683 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Expand Up @@ -18,6 +18,7 @@ body:
label: ExoPlayer Version
description: What version of ExoPlayer are you using?
options:
- 2.18.0
- 2.17.1
- 2.17.0
- 2.16.1
Expand Down
189 changes: 189 additions & 0 deletions RELEASENOTES.md
@@ -1,5 +1,194 @@
# Release notes

### 2.18.0 (2022-06-16)

This release corresponds to the
[AndroidX media3 1.0.0-beta01 release](https://github.com/androidx/media/releases/tag/1.0.0-beta01).

* Core library:
* Enable support for Android platform diagnostics via
`MediaMetricsManager`. ExoPlayer will forward playback events and
performance data to the platform, which helps to provide system
performance and debugging information on the device. This data may also
be collected by Google
[if sharing usage and diagnostics data is enabled](https://support.google.com/accounts/answer/6078260)
by the user of the device. Apps can opt-out of contributing to platform
diagnostics for ExoPlayer with
`ExoPlayer.Builder.setUsePlatformDiagnostics(false)`.
* Fix bug that tracks are reset too often when using `MergingMediaSource`,
for example when side-loading subtitles and changing the selected
subtitle mid-playback
([#10248](https://github.com/google/ExoPlayer/issues/10248)).
* Stop detecting 5G-NSA network type on API 29 and 30. These playbacks
will assume a 4G network.
* Disallow passing `null` to
`MediaSource.Factory.setDrmSessionManagerProvider` and
`MediaSource.Factory.setLoadErrorHandlingPolicy`. Instances of
`DefaultDrmSessionManagerProvider` and `DefaultLoadErrorHandlingPolicy`
can be passed explicitly if required.
* Add `MediaItem.RequestMetadata` to represent metadata needed to play
media when the exact `LocalConfiguration` is not known. Also remove
`MediaMetadata.mediaUrl` as this is now included in `RequestMetadata`.
* Add `Player.Command.COMMAND_SET_MEDIA_ITEM` to enable players to allow
setting a single item.
* Track selection:
* Flatten `TrackSelectionOverrides` class into `TrackSelectionParameters`,
and promote `TrackSelectionOverride` to a top level class.
* Rename `TracksInfo` to `Tracks` and `TracksInfo.TrackGroupInfo` to
`Tracks.Group`. `Player.getCurrentTracksInfo` and
`Player.Listener.onTracksInfoChanged` have also been renamed to
`Player.getCurrentTracks` and `Player.Listener.onTracksChanged`.
* Change `DefaultTrackSelector.buildUponParameters` and
`DefaultTrackSelector.Parameters.buildUpon` to return
`DefaultTrackSelector.Parameters.Builder` instead of the deprecated
`DefaultTrackSelector.ParametersBuilder`.
* Add
`DefaultTrackSelector.Parameters.constrainAudioChannelCountToDeviceCapabilities`
which is enabled by default. When enabled, the `DefaultTrackSelector`
will prefer audio tracks whose channel count does not exceed the device
output capabilities. On handheld devices, the `DefaultTrackSelector`
will prefer stereo/mono over multichannel audio formats, unless the
multichannel format can be
[Spatialized](https://developer.android.com/reference/android/media/Spatializer)
(Android 12L+) or is a Dolby surround sound format. In addition, on
devices that support audio spatialization, the `DefaultTrackSelector`
will monitor for changes in the
[Spatializer properties](https://developer.android.com/reference/android/media/Spatializer.OnSpatializerStateChangedListener)
and trigger a new track selection upon these. Devices with a
`television`
[UI mode](https://developer.android.com/guide/topics/resources/providing-resources#UiModeQualifier)
are excluded from these constraints and the format with the highest
channel count will be preferred. To enable this feature, the
`DefaultTrackSelector` instance must be constructed with a `Context`.
* Video:
* Rename `DummySurface` to `PlaceholderSurface`.
* Add AV1 support to the `MediaCodecVideoRenderer.getCodecMaxInputSize`.
* Audio:
* Use LG AC3 audio decoder advertising non-standard MIME type.
* Change the return type of `AudioAttributes.getAudioAttributesV21()` from
`android.media.AudioAttributes` to a new `AudioAttributesV21` wrapper
class, to prevent slow ART verification on API < 21.
* Query the platform (API 29+) or assume the audio encoding channel count
for audio passthrough when the format audio channel count is unset,
which occurs with HLS chunkless preparation
([10204](https://github.com/google/ExoPlayer/issues/10204)).
* Configure `AudioTrack` with channel mask
`AudioFormat.CHANNEL_OUT_7POINT1POINT4` if the decoder outputs 12
channel PCM audio
([#10322](#https://github.com/google/ExoPlayer/pull/10322).
* DRM
* Ensure the DRM session is always correctly updated when seeking
immediately after a format change
([10274](https://github.com/google/ExoPlayer/issues/10274)).
* Text:
* Change `Player.getCurrentCues()` to return `CueGroup` instead of
`List<Cue>`.
* SSA: Support `OutlineColour` style setting when `BorderStyle == 3` (i.e.
`OutlineColour` sets the background of the cue)
([#8435](https://github.com/google/ExoPlayer/issues/8435)).
* CEA-708: Parse data into multiple service blocks and ignore blocks not
associated with the currently selected service number.
* Remove `RawCcExtractor`, which was only used to handle a Google-internal
subtitle format.
* Extractors:
* Matroska: Parse `DiscardPadding` for Opus tracks.
* MP4: Parse bitrates from `esds` boxes.
* Ogg: Allow duplicate Opus ID and comment headers
([#10038](https://github.com/google/ExoPlayer/issues/10038)).
* UI:
* Fix delivery of events to `OnClickListener`s set on `StyledPlayerView`
and `PlayerView`, in the case that `useController=false`
([#9605](https://github.com/google/ExoPlayer/issues/9605)). Also fix
delivery of events to `OnLongClickListener` for all view configurations.
* Fix incorrectly treating a sequence of touch events that exit the bounds
of `StyledPlayerView` and `PlayerView` before `ACTION_UP` as a click
([#9861](https://github.com/google/ExoPlayer/issues/9861)).
* Fix `PlayerView` accessibility issue where tapping might toggle playback
rather than hiding the controls
([#8627](https://github.com/google/ExoPlayer/issues/8627)).
* Rewrite `TrackSelectionView` and `TrackSelectionDialogBuilder` to work
with the `Player` interface rather than `ExoPlayer`. This allows the
views to be used with other `Player` implementations, and removes the
dependency from the UI module to the ExoPlayer module. This is a
breaking change.
* Don't show forced text tracks in the `PlayerView` track selector, and
keep a suitable forced text track selected if "None" is selected
([#9432](https://github.com/google/ExoPlayer/issues/9432)).
* DASH:
* Parse channel count from DTS `AudioChannelConfiguration` elements. This
re-enables audio passthrough for DTS streams
([#10159](https://github.com/google/ExoPlayer/issues/10159)).
* Disallow passing `null` to
`DashMediaSource.Factory.setCompositeSequenceableLoaderFactory`.
Instances of `DefaultCompositeSequenceableLoaderFactory` can be passed
explicitly if required.
* HLS:
* Fallback to chunkful preparation if the playlist CODECS attribute does
not contain the audio codec
([#10065](https://github.com/google/ExoPlayer/issues/10065)).
* Disallow passing `null` to
`HlsMediaSource.Factory.setCompositeSequenceableLoaderFactory`,
`HlsMediaSource.Factory.setPlaylistParserFactory`, and
`HlsMediaSource.Factory.setPlaylistTrackerFactory`. Instances of
`DefaultCompositeSequenceableLoaderFactory`,
`DefaultHlsPlaylistParserFactory`, or a reference to
`DefaultHlsPlaylistTracker.FACTORY` can be passed explicitly if
required.
* Smooth Streaming:
* Disallow passing `null` to
`SsMediaSource.Factory.setCompositeSequenceableLoaderFactory`. Instances
of `DefaultCompositeSequenceableLoaderFactory` can be passed explicitly
if required.
* RTSP:
* Add RTP reader for MPEG4
([#35](https://github.com/androidx/media/pull/35)).
* Add RTP reader for HEVC
([#36](https://github.com/androidx/media/pull/36)).
* Add RTP reader for AMR. Currently only mono-channel, non-interleaved AMR
streams are supported. Compound AMR RTP payload is not supported.
([#46](https://github.com/androidx/media/pull/46))
* Add RTP reader for VP8
([#47](https://github.com/androidx/media/pull/47)).
* Add RTP reader for WAV
([#56](https://github.com/androidx/media/pull/56)).
* Fix RTSP basic authorization header.
([#9544](https://github.com/google/ExoPlayer/issues/9544)).
* Stop checking mandatory SDP fields as ExoPlayer doesn't need them
([#10049](https://github.com/google/ExoPlayer/issues/10049)).
* Throw checked exception when parsing RTSP timing
([#10165](https://github.com/google/ExoPlayer/issues/10165)).
* Add RTP reader for VP9
([#47](https://github.com/androidx/media/pull/64)).
* Add RTP reader for OPUS
([#53](https://github.com/androidx/media/pull/53)).
* Data sources:
* Rename `DummyDataSource` to `PlaceholderDataSource`.
* Workaround OkHttp interrupt handling.
* Ad playback / IMA:
* Decrease ad polling rate from every 100ms to every 200ms, to line up
with Media Rating Council (MRC) recommendations.
* FFmpeg extension:
* Update CMake version to `3.21.0+` to avoid a CMake bug causing
AndroidStudio's gradle sync to fail
([#9933](https://github.com/google/ExoPlayer/issues/9933)).
* Remove deprecated symbols:
* Remove `Player.Listener.onTracksChanged`. Use
`Player.Listener.onTracksInfoChanged` instead.
* Remove `Player.getCurrentTrackGroups` and
`Player.getCurrentTrackSelections`. Use `Player.getCurrentTracksInfo`
instead. You can also continue to use `ExoPlayer.getCurrentTrackGroups`
and `ExoPlayer.getCurrentTrackSelections`, although these methods remain
deprecated.
* Remove `DownloadHelper`
`DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT` and
`DEFAULT_TRACK_SELECTOR_PARAMETERS` constants. Use
`getDefaultTrackSelectorParameters(Context)` instead when possible, and
`DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT` otherwise.
* Remove constructor `DefaultTrackSelector(ExoTrackSelection.Factory)`.
Use `DefaultTrackSelector(Context, ExoTrackSelection.Factory)` instead.
* Remove `Transformer.Builder.setContext`. The `Context` should be passed
to the `Transformer.Builder` constructor instead.

### 2.17.1 (2022-03-10)

This release corresponds to the
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -17,7 +17,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.2'
}
}
Expand Down
7 changes: 6 additions & 1 deletion common_library_config.gradle
Expand Up @@ -29,5 +29,10 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

testOptions.unitTests.includeAndroidResources = true
testOptions {
unitTests.all {
jvmArgs "-Xmx2g"
}
unitTests.includeAndroidResources true
}
}
8 changes: 4 additions & 4 deletions constants.gradle
Expand Up @@ -13,21 +13,21 @@
// limitations under the License.
project.ext {
// ExoPlayer version and version code.
releaseVersion = '2.17.1'
releaseVersionCode = 2_017_001
releaseVersion = '2.18.0'
releaseVersionCode = 2_018_000
minSdkVersion = 16
appTargetSdkVersion = 29
// Upgrading this requires [Internal ref: b/193254928] to be fixed, or some
// additional robolectric config.
targetSdkVersion = 30
compileSdkVersion = 31
compileSdkVersion = 32
dexmakerVersion = '2.28.1'
junitVersion = '4.13.2'
// Use the same Guava version as the Android repo:
// https://cs.android.com/android/platform/superproject/+/master:external/guava/METADATA
guavaVersion = '31.0.1-android'
mockitoVersion = '3.12.4'
robolectricVersion = '4.6.1'
robolectricVersion = '4.8.1'
// Keep this in sync with Google's internal Checker Framework version.
checkerframeworkVersion = '3.13.0'
checkerframeworkCompatVersion = '2.5.5'
Expand Down
Expand Up @@ -230,8 +230,8 @@ public RecyclerViewCallback() {
@Override
public boolean onMove(
RecyclerView list, RecyclerView.ViewHolder origin, RecyclerView.ViewHolder target) {
int fromPosition = origin.getAdapterPosition();
int toPosition = target.getAdapterPosition();
int fromPosition = origin.getBindingAdapterPosition();
int toPosition = target.getBindingAdapterPosition();
if (draggingFromPosition == C.INDEX_UNSET) {
// A drag has started, but changes to the media queue will be reflected in clearView().
draggingFromPosition = fromPosition;
Expand All @@ -243,7 +243,7 @@ public boolean onMove(

@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
int position = viewHolder.getAdapterPosition();
int position = viewHolder.getBindingAdapterPosition();
QueueItemViewHolder queueItemHolder = (QueueItemViewHolder) viewHolder;
if (playerManager.removeItem(queueItemHolder.item)) {
mediaQueueListAdapter.notifyItemRemoved(position);
Expand Down Expand Up @@ -282,7 +282,7 @@ public QueueItemViewHolder(TextView textView) {

@Override
public void onClick(View v) {
playerManager.selectQueueItem(getAdapterPosition());
playerManager.selectQueueItem(getBindingAdapterPosition());
}
}

Expand Down
Expand Up @@ -25,7 +25,7 @@
import com.google.android.exoplayer2.Player.DiscontinuityReason;
import com.google.android.exoplayer2.Player.TimelineChangeReason;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.TracksInfo;
import com.google.android.exoplayer2.Tracks;
import com.google.android.exoplayer2.ext.cast.CastPlayer;
import com.google.android.exoplayer2.ext.cast.SessionAvailabilityListener;
import com.google.android.exoplayer2.ui.StyledPlayerControlView;
Expand Down Expand Up @@ -57,7 +57,7 @@ interface Listener {
private final ArrayList<MediaItem> mediaQueue;
private final Listener listener;

private TracksInfo lastSeenTrackGroupInfo;
private Tracks lastSeenTracks;
private int currentItemIndex;
private Player currentPlayer;

Expand Down Expand Up @@ -219,19 +219,19 @@ public void onTimelineChanged(Timeline timeline, @TimelineChangeReason int reaso
}

@Override
public void onTracksInfoChanged(TracksInfo tracksInfo) {
if (currentPlayer != localPlayer || tracksInfo == lastSeenTrackGroupInfo) {
public void onTracksChanged(Tracks tracks) {
if (currentPlayer != localPlayer || tracks == lastSeenTracks) {
return;
}
if (!tracksInfo.isTypeSupportedOrEmpty(
C.TRACK_TYPE_VIDEO, /* allowExceedsCapabilities= */ true)) {
if (tracks.containsType(C.TRACK_TYPE_VIDEO)
&& !tracks.isTypeSupported(C.TRACK_TYPE_VIDEO, /* allowExceedsCapabilities= */ true)) {
listener.onUnsupportedTrack(C.TRACK_TYPE_VIDEO);
}
if (!tracksInfo.isTypeSupportedOrEmpty(
C.TRACK_TYPE_AUDIO, /* allowExceedsCapabilities= */ true)) {
if (tracks.containsType(C.TRACK_TYPE_AUDIO)
&& !tracks.isTypeSupported(C.TRACK_TYPE_AUDIO, /* allowExceedsCapabilities= */ true)) {
listener.onUnsupportedTrack(C.TRACK_TYPE_AUDIO);
}
lastSeenTrackGroupInfo = tracksInfo;
lastSeenTracks = tracks;
}

// CastPlayer.SessionAvailabilityListener implementation.
Expand Down
Expand Up @@ -27,6 +27,7 @@
import android.opengl.GLES20;
import android.opengl.GLUtils;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.util.GlProgram;
import com.google.android.exoplayer2.util.GlUtil;
import java.io.IOException;
import java.util.Locale;
Expand All @@ -50,7 +51,7 @@
private final Bitmap logoBitmap;
private final Canvas overlayCanvas;

private GlUtil.@MonotonicNonNull Program program;
private @MonotonicNonNull GlProgram program;

private float bitmapScaleX;
private float bitmapScaleY;
Expand Down Expand Up @@ -78,17 +79,21 @@ public BitmapOverlayVideoProcessor(Context context) {
public void initialize() {
try {
program =
new GlUtil.Program(
new GlProgram(
context,
/* vertexShaderFilePath= */ "bitmap_overlay_video_processor_vertex.glsl",
/* fragmentShaderFilePath= */ "bitmap_overlay_video_processor_fragment.glsl");
} catch (IOException e) {
throw new IllegalStateException(e);
}
program.setBufferAttribute(
"aFramePosition", GlUtil.getNormalizedCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
"aFramePosition",
GlUtil.getNormalizedCoordinateBounds(),
GlUtil.HOMOGENEOUS_COORDINATE_VECTOR_SIZE);
program.setBufferAttribute(
"aTexCoords", GlUtil.getTextureCoordinateBounds(), GlUtil.RECTANGLE_VERTICES_COUNT);
"aTexCoords",
GlUtil.getTextureCoordinateBounds(),
GlUtil.HOMOGENEOUS_COORDINATE_VECTOR_SIZE);
GLES20.glGenTextures(1, textures, 0);
GLES20.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
GLES20.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
Expand Down Expand Up @@ -117,9 +122,9 @@ public void draw(int frameTexture, long frameTimestampUs, float[] transformMatri
GlUtil.checkGlError();

// Run the shader program.
GlUtil.Program program = checkNotNull(this.program);
program.setSamplerTexIdUniform("uTexSampler0", frameTexture, /* unit= */ 0);
program.setSamplerTexIdUniform("uTexSampler1", textures[0], /* unit= */ 1);
GlProgram program = checkNotNull(this.program);
program.setSamplerTexIdUniform("uTexSampler0", frameTexture, /* texUnitIndex= */ 0);
program.setSamplerTexIdUniform("uTexSampler1", textures[0], /* texUnitIndex= */ 1);
program.setFloatUniform("uScaleX", bitmapScaleX);
program.setFloatUniform("uScaleY", bitmapScaleY);
program.setFloatsUniform("uTexTransform", transformMatrix);
Expand Down

0 comments on commit 03569f9

Please sign in to comment.