Skip to content

Commit a9444c8

Browse files
authored
Merge pull request #10806 from google/release-v2-r2.18.2
r2.18.2
2 parents ab4d37f + a114b0e commit a9444c8

File tree

852 files changed

+53359
-12657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

852 files changed

+53359
-12657
lines changed

.github/ISSUE_TEMPLATE/bug.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ body:
1818
label: ExoPlayer Version
1919
description: What version of ExoPlayer are you using?
2020
options:
21+
- 2.18.2
2122
- 2.18.1
2223
- 2.18.0
2324
- 2.17.1

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ extensions/cronet/jniLibs/*
7676
!extensions/cronet/jniLibs/README.md
7777
extensions/cronet/libs/*
7878
!extensions/cronet/libs/README.md
79+
80+
# MIDI extension
81+
extensions/midi/lib

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ all of the information requested in the issue template.
1515

1616
## Pull requests ##
1717

18-
We will also consider high quality pull requests. These should normally merge
18+
We will also consider high quality pull requests. These should merge
1919
into the `dev-v2` branch. Before a pull request can be accepted you must submit
2020
a Contributor License Agreement, as described below.
2121

RELEASENOTES.md

+111
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,116 @@
11
# Release notes
22

3+
### 2.18.2 (2022-11-22)
4+
5+
This release corresponds to the
6+
[AndroidX Media3 1.0.0-beta03 release](https://github.com/androidx/media/releases/tag/1.0.0-beta03).
7+
8+
* Core library:
9+
* Add `ExoPlayer.isTunnelingEnabled` to check if tunneling is enabled for
10+
the currently selected tracks
11+
([#2518](https://github.com/google/ExoPlayer/issues/2518)).
12+
* Add `WrappingMediaSource` to simplify wrapping a single `MediaSource`
13+
([#7279](https://github.com/google/ExoPlayer/issues/7279)).
14+
* Discard back buffer before playback gets stuck due to insufficient
15+
available memory.
16+
* Close the Tracing "doSomeWork" block when offload is enabled.
17+
* Fix session tracking problem with fast seeks in `PlaybackStatsListener`
18+
([#180](https://github.com/androidx/media/issues/180)).
19+
* Send missing `onMediaItemTransition` callback when calling `seekToNext`
20+
or `seekToPrevious` in a single-item playlist
21+
([#10667](https://github.com/google/ExoPlayer/issues/10667)).
22+
* Add `Player.getSurfaceSize` that returns the size of the surface on
23+
which the video is rendered.
24+
* Fix bug where removing listeners during the player release can cause an
25+
`IllegalStateException`
26+
([#10758](https://github.com/google/ExoPlayer/issues/10758)).
27+
* Build:
28+
* Enforce minimum `compileSdkVersion` to avoid compilation errors
29+
([#10684](https://github.com/google/ExoPlayer/issues/10684)).
30+
* Avoid publishing block when included in another gradle build.
31+
* Track selection:
32+
* Prefer other tracks to Dolby Vision if display does not support it.
33+
([#8944](https://github.com/google/ExoPlayer/issues/8944)).
34+
* Downloads:
35+
* Fix potential infinite loop in `ProgressiveDownloader` caused by
36+
simultaneous download and playback with the same `PriorityTaskManager`
37+
([#10570](https://github.com/google/ExoPlayer/pull/10570)).
38+
* Make download notification appear immediately
39+
([#183](https://github.com/androidx/media/pull/183)).
40+
* Limit parallel download removals to 1 to avoid excessive thread creation
41+
([#10458](https://github.com/google/ExoPlayer/issues/10458)).
42+
* Video:
43+
* Try alternative decoder for Dolby Vision if display does not support it.
44+
([#9794](https://github.com/google/ExoPlayer/issues/9794)).
45+
* Audio:
46+
* Use `SingleThreadExecutor` for releasing `AudioTrack` instances to avoid
47+
OutOfMemory errors when releasing multiple players at the same time
48+
([#10057](https://github.com/google/ExoPlayer/issues/10057)).
49+
* Adds `AudioOffloadListener.onExperimentalOffloadedPlayback` for the
50+
AudioTrack offload state.
51+
([#134](https://github.com/androidx/media/issues/134)).
52+
* Make `AudioTrackBufferSizeProvider` a public interface.
53+
* Add `ExoPlayer.setPreferredAudioDevice` to set the preferred audio
54+
output device ([#135](https://github.com/androidx/media/issues/135)).
55+
* Rename `com.google.android.exoplayer2.audio.AudioProcessor` to
56+
`com.google.android.exoplayer2.audio.AudioProcessor`.
57+
* Map 8-channel and 12-channel audio to the 7.1 and 7.1.4 channel masks
58+
respectively on all Android versions
59+
([#10701](https://github.com/google/ExoPlayer/issues/10701)).
60+
* Metadata:
61+
* `MetadataRenderer` can now be configured to render metadata as soon as
62+
they are available. Create an instance with
63+
`MetadataRenderer(MetadataOutput, Looper, MetadataDecoderFactory,
64+
boolean)` to specify whether the renderer will output metadata early or
65+
in sync with the player position.
66+
* DRM:
67+
* Work around a bug in the Android 13 ClearKey implementation that returns
68+
a non-empty but invalid license URL.
69+
* Fix `setMediaDrmSession failed: session not opened` error when switching
70+
between DRM schemes in a playlist (e.g. Widevine to ClearKey).
71+
* Text:
72+
* CEA-608: Ensure service switch commands on field 2 are handled correctly
73+
([#10666](https://github.com/google/ExoPlayer/issues/10666)).
74+
* DASH:
75+
* Parse `EventStream.presentationTimeOffset` from manifests
76+
([#10460](https://github.com/google/ExoPlayer/issues/10460)).
77+
* UI:
78+
* Use current overrides of the player as preset in
79+
`TrackSelectionDialogBuilder`
80+
([#10429](https://github.com/google/ExoPlayer/issues/10429)).
81+
* RTSP:
82+
* Add H263 fragmented packet handling
83+
([#119](https://github.com/androidx/media/pull/119)).
84+
* Add support for MP4A-LATM
85+
([#162](https://github.com/androidx/media/pull/162)).
86+
* IMA:
87+
* Add timeout for loading ad information to handle cases where the IMA SDK
88+
gets stuck loading an ad
89+
([#10510](https://github.com/google/ExoPlayer/issues/10510)).
90+
* Prevent skipping mid-roll ads when seeking to the end of the content
91+
([#10685](https://github.com/google/ExoPlayer/issues/10685)).
92+
* Correctly calculate window duration for live streams with server-side
93+
inserted ads, for example IMA DAI
94+
([#10764](https://github.com/google/ExoPlayer/issues/10764)).
95+
* FFmpeg extension:
96+
* Add newly required flags to link FFmpeg libraries with NDK 23.1.7779620
97+
and above ([#9933](https://github.com/google/ExoPlayer/issues/9933)).
98+
* AV1 extension:
99+
* Update CMake version to avoid incompatibilities with the latest Android
100+
Studio releases
101+
([#9933](https://github.com/google/ExoPlayer/issues/9933)).
102+
* Cast extension:
103+
* Implement `getDeviceInfo()` to be able to identify `CastPlayer` when
104+
controlling playback with a `MediaController`
105+
([#142](https://github.com/androidx/media/issues/142)).
106+
* Transformer:
107+
* Add muxer watchdog timer to detect when generating an output sample is
108+
too slow.
109+
* Remove deprecated symbols:
110+
* Remove `Transformer.Builder.setOutputMimeType(String)`. This feature has
111+
been removed. The MIME type will always be MP4 when the default muxer is
112+
used.
113+
3114
### 2.18.1 (2022-07-21)
4115

5116
This release corresponds to the

common_library_config.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ android {
2222
targetSdkVersion project.ext.targetSdkVersion
2323
consumerProguardFiles 'proguard-rules.txt'
2424
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
25+
aarMetadata {
26+
minCompileSdk = project.ext.compileSdkVersion
27+
}
2528
}
2629

2730
compileOptions {

constants.gradle

+9-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@
1313
// limitations under the License.
1414
project.ext {
1515
// ExoPlayer version and version code.
16-
releaseVersion = '2.18.1'
17-
releaseVersionCode = 2_018_001
16+
releaseVersion = '2.18.2'
17+
releaseVersionCode = 2_018_002
1818
minSdkVersion = 16
19-
appTargetSdkVersion = 29
19+
appTargetSdkVersion = 33
20+
// API version before restricting local file access.
21+
// https://developer.android.com/training/data-storage/app-specific
22+
mainDemoAppTargetSdkVersion = 29
2023
// Upgrading this requires [Internal ref: b/193254928] to be fixed, or some
2124
// additional robolectric config.
2225
targetSdkVersion = 30
23-
compileSdkVersion = 32
24-
dexmakerVersion = '2.28.1'
26+
compileSdkVersion = 33
27+
dexmakerVersion = '2.28.3'
2528
junitVersion = '4.13.2'
2629
// Use the same Guava version as the Android repo:
2730
// https://cs.android.com/android/platform/superproject/+/master:external/guava/METADATA
@@ -40,7 +43,7 @@ project.ext {
4043
androidxConstraintLayoutVersion = '2.0.4'
4144
androidxCoreVersion = '1.7.0'
4245
androidxFuturesVersion = '1.1.0'
43-
androidxMediaVersion = '1.4.3'
46+
androidxMediaVersion = '1.6.0'
4447
androidxMedia2Version = '1.2.0'
4548
androidxMultidexVersion = '2.0.1'
4649
androidxRecyclerViewVersion = '1.2.1'

core_settings.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ project(modulePrefix + 'library-extractor').projectDir = new File(rootDir, 'libr
8282
include modulePrefix + 'extension-cast'
8383
project(modulePrefix + 'extension-cast').projectDir = new File(rootDir, 'extensions/cast')
8484

85+
include modulePrefix + 'library-effect'
86+
project(modulePrefix + 'library-effect').projectDir = new File(rootDir, 'library/effect')
87+
8588
include modulePrefix + 'library-transformer'
8689
project(modulePrefix + 'library-transformer').projectDir = new File(rootDir, 'library/transformer')
8790

demos/cast/src/main/AndroidManifest.xml

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@
2222

2323
<uses-sdk/>
2424

25-
<application android:label="@string/application_name" android:icon="@mipmap/ic_launcher"
26-
android:largeHeap="true" android:allowBackup="false">
25+
<application
26+
android:name="androidx.multidex.MultiDexApplication"
27+
android:label="@string/application_name"
28+
android:icon="@mipmap/ic_launcher"
29+
android:largeHeap="true"
30+
android:allowBackup="false"
31+
android:taskAffinity="">
2732

2833
<meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
2934
android:value="com.google.android.exoplayer2.ext.cast.DefaultCastOptionsProvider"/>

demos/gl/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ dependencies {
5252
implementation project(modulePrefix + 'library-smoothstreaming')
5353
implementation project(modulePrefix + 'library-ui')
5454
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
55+
implementation 'androidx.multidex:multidex:' + androidxMultidexVersion
5556
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
5657
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
5758
}

demos/gl/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<uses-sdk/>
2323

2424
<application
25+
android:name="androidx.multidex.MultiDexApplication"
2526
android:allowBackup="false"
2627
android:icon="@mipmap/ic_launcher"
2728
android:label="@string/application_name">

demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java

+25-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.google.android.exoplayer2.C;
3030
import com.google.android.exoplayer2.util.GlProgram;
3131
import com.google.android.exoplayer2.util.GlUtil;
32+
import com.google.android.exoplayer2.util.Log;
3233
import java.io.IOException;
3334
import java.util.Locale;
3435
import javax.microedition.khronos.opengles.GL10;
@@ -41,6 +42,7 @@
4142
/* package */ final class BitmapOverlayVideoProcessor
4243
implements VideoProcessingGLSurfaceView.VideoProcessor {
4344

45+
private static final String TAG = "BitmapOverlayVP";
4446
private static final int OVERLAY_WIDTH = 512;
4547
private static final int OVERLAY_HEIGHT = 256;
4648

@@ -85,6 +87,9 @@ public void initialize() {
8587
/* fragmentShaderFilePath= */ "bitmap_overlay_video_processor_fragment.glsl");
8688
} catch (IOException e) {
8789
throw new IllegalStateException(e);
90+
} catch (GlUtil.GlException e) {
91+
Log.e(TAG, "Failed to initialize the shader program", e);
92+
return;
8893
}
8994
program.setBufferAttribute(
9095
"aFramePosition",
@@ -119,7 +124,11 @@ public void draw(int frameTexture, long frameTimestampUs, float[] transformMatri
119124
GLES20.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
120125
GLUtils.texSubImage2D(
121126
GL10.GL_TEXTURE_2D, /* level= */ 0, /* xoffset= */ 0, /* yoffset= */ 0, overlayBitmap);
122-
GlUtil.checkGlError();
127+
try {
128+
GlUtil.checkGlError();
129+
} catch (GlUtil.GlException e) {
130+
Log.e(TAG, "Failed to populate the texture", e);
131+
}
123132

124133
// Run the shader program.
125134
GlProgram program = checkNotNull(this.program);
@@ -128,16 +137,28 @@ public void draw(int frameTexture, long frameTimestampUs, float[] transformMatri
128137
program.setFloatUniform("uScaleX", bitmapScaleX);
129138
program.setFloatUniform("uScaleY", bitmapScaleY);
130139
program.setFloatsUniform("uTexTransform", transformMatrix);
131-
program.bindAttributesAndUniforms();
140+
try {
141+
program.bindAttributesAndUniforms();
142+
} catch (GlUtil.GlException e) {
143+
Log.e(TAG, "Failed to update the shader program", e);
144+
}
132145
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
133146
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, /* first= */ 0, /* count= */ 4);
134-
GlUtil.checkGlError();
147+
try {
148+
GlUtil.checkGlError();
149+
} catch (GlUtil.GlException e) {
150+
Log.e(TAG, "Failed to draw a frame", e);
151+
}
135152
}
136153

137154
@Override
138155
public void release() {
139156
if (program != null) {
140-
program.delete();
157+
try {
158+
program.delete();
159+
} catch (GlUtil.GlException e) {
160+
Log.e(TAG, "Failed to delete the shader program", e);
161+
}
141162
}
142163
}
143164
}

demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/MainActivity.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package com.google.android.exoplayer2.gldemo;
1717

18+
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
19+
1820
import android.app.Activity;
1921
import android.content.Context;
2022
import android.content.Intent;
@@ -83,7 +85,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
8385
VideoProcessingGLSurfaceView videoProcessingGLSurfaceView =
8486
new VideoProcessingGLSurfaceView(
8587
context, requestSecureSurface, new BitmapOverlayVideoProcessor(context));
86-
FrameLayout contentFrame = findViewById(R.id.exo_content_frame);
88+
checkNotNull(playerView);
89+
FrameLayout contentFrame = playerView.findViewById(R.id.exo_content_frame);
8790
contentFrame.addView(videoProcessingGLSurfaceView);
8891
this.videoProcessingGLSurfaceView = videoProcessingGLSurfaceView;
8992
}

demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/VideoProcessingGLSurfaceView.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.google.android.exoplayer2.Format;
3030
import com.google.android.exoplayer2.util.Assertions;
3131
import com.google.android.exoplayer2.util.GlUtil;
32+
import com.google.android.exoplayer2.util.Log;
3233
import com.google.android.exoplayer2.util.TimedValueQueue;
3334
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
3435
import java.util.concurrent.atomic.AtomicBoolean;
@@ -70,6 +71,7 @@ public interface VideoProcessor {
7071
}
7172

7273
private static final int EGL_PROTECTED_CONTENT_EXT = 0x32C0;
74+
private static final String TAG = "VPGlSurfaceView";
7375

7476
private final VideoRenderer renderer;
7577
private final Handler mainHandler;
@@ -239,7 +241,11 @@ public VideoRenderer(VideoProcessor videoProcessor) {
239241

240242
@Override
241243
public synchronized void onSurfaceCreated(GL10 gl, EGLConfig config) {
242-
texture = GlUtil.createExternalTexture();
244+
try {
245+
texture = GlUtil.createExternalTexture();
246+
} catch (GlUtil.GlException e) {
247+
Log.e(TAG, "Failed to create an external texture", e);
248+
}
243249
surfaceTexture = new SurfaceTexture(texture);
244250
surfaceTexture.setOnFrameAvailableListener(
245251
surfaceTexture -> {

demos/main/build.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
apply from: '../../constants.gradle'
1516
apply plugin: 'com.android.application'
1617

@@ -26,7 +27,9 @@ android {
2627
versionName project.ext.releaseVersion
2728
versionCode project.ext.releaseVersionCode
2829
minSdkVersion project.ext.minSdkVersion
29-
targetSdkVersion project.ext.appTargetSdkVersion
30+
// Not using appTargetSDKVersion to allow local file access on API 29
31+
// and higher [Internal ref: b/191644662]
32+
targetSdkVersion project.ext.mainDemoAppTargetSdkVersion
3033
multiDexEnabled true
3134
}
3235

demos/main/src/main/assets/media.exolist.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
"uri": "ssai://dai.google.com/?contentSourceId=2528370&videoId=tears-of-steel&format=2&adsId=1"
400400
},
401401
{
402-
"name": "HLS Live: Big Buck Bunny (mid), 3 ads each [10 s]",
402+
"name": "HLS Live: Big Buck Bunny (mid), 3 ads [10/10/10s]",
403403
"uri": "ssai://dai.google.com/?assetKey=sN_IYUG8STe1ZzhIIE_ksA&format=2&adsId=3"
404404
},
405405
{

demos/transformer/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ android {
2020
compileSdkVersion project.ext.compileSdkVersion
2121

2222
compileOptions {
23+
coreLibraryDesugaringEnabled true
2324
sourceCompatibility JavaVersion.VERSION_1_8
2425
targetCompatibility JavaVersion.VERSION_1_8
2526
}
@@ -76,11 +77,14 @@ dependencies {
7677
implementation 'androidx.constraintlayout:constraintlayout:' + androidxConstraintLayoutVersion
7778
implementation 'androidx.multidex:multidex:' + androidxMultidexVersion
7879
implementation 'com.google.android.material:material:' + androidxMaterialVersion
80+
implementation project(modulePrefix + 'library-effect')
7981
implementation project(modulePrefix + 'library-core')
8082
implementation project(modulePrefix + 'library-dash')
8183
implementation project(modulePrefix + 'library-transformer')
8284
implementation project(modulePrefix + 'library-ui')
8385

86+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
87+
8488
// For MediaPipe and its dependencies:
8589
withMediaPipeImplementation fileTree(dir: 'libs', include: ['*.aar'])
8690
withMediaPipeImplementation 'com.google.flogger:flogger:latest.release'

0 commit comments

Comments
 (0)