Skip to content

Commit 1b3b4c5

Browse files
authored
Merge branch 'androidx:release' into dlb/ac4-level4/dev
2 parents 2dfe330 + d833d59 commit 1b3b4c5

File tree

1,091 files changed

+71576
-12630
lines changed

Some content is hidden

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

1,091 files changed

+71576
-12630
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,29 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8-
We can only process bug reports that are actionable. Unclear bug reports or reports with
9-
insufficient information may not get attention.
8+
We can only process bug reports that are actionable. Unclear bug reports or reports with insufficient information may not get attention.
109
1110
Before filing a bug:
1211
-------------------------
1312
14-
- Search existing issues, including issues that are closed:
15-
https://github.com/androidx/media/issues?q=is%3Aissue
16-
- For ExoPlayer-related bugs, please also check for existing issues on the ExoPlayer
17-
tracker: https://github.com/google/ExoPlayer/issues?q=is%3Aissue
13+
- Search existing issues, including issues that are closed: https://github.com/androidx/media/issues?q=is%3Aissue
14+
- For ExoPlayer-related bugs, please also check for existing issues on the ExoPlayer tracker: https://github.com/google/ExoPlayer/issues?q=is%3Aissue
1815
- type: dropdown
1916
attributes:
2017
label: Version
2118
description: What version of Media3 (or ExoPlayer) are you using?
2219
options:
23-
- Media3 1.2.0
24-
- Media3 1.1.1
25-
- Media3 1.1.0
26-
- Media3 1.0.2
27-
- Media3 1.0.1
28-
- Media3 1.0.0
29-
- Media3 `main` branch
20+
- Media3 main branch
3021
- Media3 pre-release (alpha, beta or RC not in this list)
31-
- ExoPlayer 2.19.1
32-
- ExoPlayer 2.19.0
33-
- ExoPlayer 2.18.7
34-
- ExoPlayer 2.18.6
35-
- ExoPlayer 2.18.5
22+
- Media3 1.3.1
23+
- Media3 1.3.0
24+
- Media3 1.2.1
25+
- Media3 1.2.0
26+
- Media3 1.1.1 / ExoPlayer 2.19.1
27+
- Media3 1.1.0 / ExoPlayer 2.19.0
28+
- Media3 1.0.2 / ExoPlayer 2.18.7
29+
- Media3 1.0.1 / ExoPlayer 2.18.6
30+
- Media3 1.0.0 / ExoPlayer 2.18.5
3631
- ExoPlayer 2.18.4
3732
- ExoPlayer 2.18.3
3833
- ExoPlayer 2.18.2
@@ -47,14 +42,14 @@ body:
4742
- ExoPlayer 2.14.2
4843
- ExoPlayer 2.14.1
4944
- ExoPlayer 2.14.0
50-
- ExoPlayer `dev-v2` branch
45+
- ExoPlayer dev-v2 branch
5146
- Older (unsupported)
5247
validations:
5348
required: true
5449
- type: textarea
5550
attributes:
5651
label: More version details
57-
description: |
52+
description: >
5853
Required if you selected `main` or `dev-v2` (please provide an exact commit SHA),
5954
or 'pre-release' or 'older' (please provide the version).
6055
- type: textarea

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,26 @@ implementation project(':media-lib-exoplayer-dash')
154154
implementation project(':media-lib-ui')
155155
```
156156

157+
#### MIDI module
158+
159+
By default the [MIDI module](libraries/decoder_midi) is disabled as a local
160+
dependency, because it requires additional Maven repository config. If you want
161+
to use it as a local dependency, please configure the JitPack repository as
162+
[described in the module README](libraries/decoder_midi/README.md#getting-the-module),
163+
and then enable building the module in your `settings.gradle.kts` file:
164+
165+
```kotlin
166+
gradle.extra.apply {
167+
set("androidxMediaEnableMidiModule", true)
168+
}
169+
```
170+
171+
Or in Gradle Groovy DSL `settings.gradle`:
172+
173+
```groovy
174+
gradle.ext.androidxMediaEnableMidiModule = true
175+
```
176+
157177
## Developing AndroidX Media
158178

159179
#### Project branches

RELEASENOTES.md

Lines changed: 293 additions & 41 deletions
Large diffs are not rendered by default.

api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ package androidx.media3.common {
763763
method @Deprecated public void setDeviceMuted(boolean);
764764
method public void setDeviceMuted(boolean, @androidx.media3.common.C.VolumeFlags int);
765765
method @Deprecated public void setDeviceVolume(@IntRange(from=0) int);
766-
method public void setDeviceVolume(@IntRange(from=0) int, int);
766+
method public void setDeviceVolume(@IntRange(from=0) int, @androidx.media3.common.C.VolumeFlags int);
767767
method public void setMediaItem(androidx.media3.common.MediaItem);
768768
method public void setMediaItem(androidx.media3.common.MediaItem, boolean);
769769
method public void setMediaItem(androidx.media3.common.MediaItem, long);

constants.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
project.ext {
15-
releaseVersion = '1.2.0'
16-
releaseVersionCode = 1_002_000_3_00
17-
minSdkVersion = 16
15+
releaseVersion = '1.3.1'
16+
releaseVersionCode = 1_003_001_3_00
17+
minSdkVersion = 19
1818
// See https://developer.android.com/training/cars/media/automotive-os#automotive-module
1919
automotiveMinSdkVersion = 28
2020
appTargetSdkVersion = 34
@@ -23,12 +23,14 @@ project.ext {
2323
targetSdkVersion = 30
2424
compileSdkVersion = 34
2525
dexmakerVersion = '2.28.3'
26+
// Use the same JUnit version as the Android repo:
27+
// https://cs.android.com/android/platform/superproject/main/+/main:external/junit/METADATA
2628
junitVersion = '4.13.2'
2729
// Use the same Guava version as the Android repo:
2830
// https://cs.android.com/android/platform/superproject/main/+/main:external/guava/METADATA
2931
guavaVersion = '32.1.3-android'
3032
mockitoVersion = '3.12.4'
31-
robolectricVersion = '4.10.3'
33+
robolectricVersion = '4.11'
3234
// Keep this in sync with Google's internal Checker Framework version.
3335
checkerframeworkVersion = '3.13.0'
3436
errorProneVersion = '2.18.0'
@@ -43,9 +45,7 @@ project.ext {
4345
// Updating this to 1.9.0+ will import Kotlin stdlib [internal ref: b/277891049].
4446
androidxCoreVersion = '1.8.0'
4547
androidxExifInterfaceVersion = '1.3.6'
46-
androidxFuturesVersion = '1.1.0'
47-
androidxMediaVersion = '1.6.0'
48-
androidxMedia2Version = '1.2.1'
48+
androidxMediaVersion = '1.7.0'
4949
androidxMultidexVersion = '2.0.1'
5050
androidxRecyclerViewVersion = '1.3.0'
5151
androidxMaterialVersion = '1.8.0'
@@ -54,7 +54,6 @@ project.ext {
5454
androidxTestJUnitVersion = '1.1.5'
5555
androidxTestRunnerVersion = '1.5.2'
5656
androidxTestRulesVersion = '1.5.0'
57-
androidxTestServicesStorageVersion = '1.4.2'
5857
androidxTestTruthVersion = '1.5.0'
5958
truthVersion = '1.1.3'
6059
okhttpVersion = '4.12.0'

core_settings.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ include modulePrefix + 'lib-decoder-ffmpeg'
7272
project(modulePrefix + 'lib-decoder-ffmpeg').projectDir = new File(rootDir, 'libraries/decoder_ffmpeg')
7373
include modulePrefix + 'lib-decoder-flac'
7474
project(modulePrefix + 'lib-decoder-flac').projectDir = new File(rootDir, 'libraries/decoder_flac')
75-
include modulePrefix + 'lib-decoder-midi'
76-
project(modulePrefix + 'lib-decoder-midi').projectDir = new File(rootDir, 'libraries/decoder_midi')
75+
if (gradle.ext.has('androidxMediaEnableMidiModule') && gradle.ext.androidxMediaEnableMidiModule) {
76+
include modulePrefix + 'lib-decoder-midi'
77+
project(modulePrefix + 'lib-decoder-midi').projectDir = new File(rootDir, 'libraries/decoder_midi')
78+
}
7779
include modulePrefix + 'lib-decoder-opus'
7880
project(modulePrefix + 'lib-decoder-opus').projectDir = new File(rootDir, 'libraries/decoder_opus')
7981
include modulePrefix + 'lib-decoder-vp9'
@@ -100,7 +102,3 @@ include modulePrefix + 'test-data'
100102
project(modulePrefix + 'test-data').projectDir = new File(rootDir, 'libraries/test_data')
101103
include modulePrefix + 'test-utils'
102104
project(modulePrefix + 'test-utils').projectDir = new File(rootDir, 'libraries/test_utils')
103-
include modulePrefix + 'test-session-common'
104-
project(modulePrefix + 'test-session-common').projectDir = new File(rootDir, 'libraries/test_session_common')
105-
include modulePrefix + 'test-session-current'
106-
project(modulePrefix + 'test-session-current').projectDir = new File(rootDir, 'libraries/test_session_current')

demos/cast/src/main/java/androidx/media3/demo/cast/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import com.google.android.gms.cast.framework.CastButtonFactory;
4545
import com.google.android.gms.cast.framework.CastContext;
4646
import com.google.android.gms.dynamite.DynamiteModule;
47+
import com.google.common.util.concurrent.MoreExecutors;
4748

4849
/**
4950
* An activity that plays video using {@link ExoPlayer} and supports casting using ExoPlayer's Cast
@@ -65,7 +66,7 @@ public void onCreate(Bundle savedInstanceState) {
6566
super.onCreate(savedInstanceState);
6667
// Getting the cast context later than onStart can cause device discovery not to take place.
6768
try {
68-
castContext = CastContext.getSharedInstance(this);
69+
castContext = CastContext.getSharedInstance(this, MoreExecutors.directExecutor()).getResult();
6970
} catch (RuntimeException e) {
7071
Throwable cause = e.getCause();
7172
while (cause != null) {

demos/gl/src/main/java/androidx/media3/demo/gl/BitmapOverlayVideoProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public BitmapOverlayVideoProcessor(Context context) {
6363
paint = new Paint();
6464
paint.setTextSize(64);
6565
paint.setAntiAlias(true);
66-
paint.setARGB(0xFF, 0xFF, 0xFF, 0xFF);
66+
paint.setColor(Color.WHITE);
6767
textures = new int[1];
6868
overlayBitmap = Bitmap.createBitmap(OVERLAY_WIDTH, OVERLAY_HEIGHT, Bitmap.Config.ARGB_8888);
6969
overlayCanvas = new Canvas(overlayBitmap);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@
143143
"drm_scheme": "widevine",
144144
"drm_license_uri": "https://proxy.uat.widevine.com/proxy?video_id=GTS_HW_SECURE_ALL&provider=widevine_test"
145145
},
146+
{
147+
"name": "20s license with renewal",
148+
"uri": "https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd",
149+
"drm_scheme": "widevine",
150+
"drm_license_uri": "https://proxy.uat.widevine.com/proxy?video_id=GTS_CAN_RENEW&provider=widevine_test"
151+
},
146152
{
147153
"name": "30s license (fails at ~30s)",
148154
"uri": "https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd",

demos/main/src/main/java/androidx/media3/demo/main/DownloadTracker.java

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
package androidx.media3.demo.main;
1717

1818
import static com.google.common.base.Preconditions.checkNotNull;
19+
import static com.google.common.base.Preconditions.checkState;
1920

2021
import android.content.Context;
2122
import android.content.DialogInterface;
2223
import android.net.Uri;
23-
import android.os.AsyncTask;
24+
import android.os.Handler;
25+
import android.os.Looper;
2426
import android.widget.Toast;
2527
import androidx.annotation.Nullable;
2628
import androidx.annotation.OptIn;
@@ -54,6 +56,9 @@
5456
import java.util.HashMap;
5557
import java.util.UUID;
5658
import java.util.concurrent.CopyOnWriteArraySet;
59+
import java.util.concurrent.ExecutorService;
60+
import java.util.concurrent.Executors;
61+
import java.util.concurrent.Future;
5762

5863
/** Tracks media that has been downloaded. */
5964
@OptIn(markerClass = androidx.media3.common.util.UnstableApi.class)
@@ -182,7 +187,7 @@ public void release() {
182187
trackSelectionDialog.dismiss();
183188
}
184189
if (widevineOfflineLicenseFetchTask != null) {
185-
widevineOfflineLicenseFetchTask.cancel(false);
190+
widevineOfflineLicenseFetchTask.cancel();
186191
}
187192
}
188193

@@ -358,14 +363,16 @@ private DownloadRequest buildDownloadRequest() {
358363

359364
/** Downloads a Widevine offline license in a background thread. */
360365
@RequiresApi(18)
361-
private static final class WidevineOfflineLicenseFetchTask extends AsyncTask<Void, Void, Void> {
366+
private static final class WidevineOfflineLicenseFetchTask {
362367

363368
private final Format format;
364369
private final MediaItem.DrmConfiguration drmConfiguration;
365370
private final DataSource.Factory dataSourceFactory;
366371
private final StartDownloadDialogHelper dialogHelper;
367372
private final DownloadHelper downloadHelper;
373+
private final ExecutorService executorService;
368374

375+
@Nullable Future<?> future;
369376
@Nullable private byte[] keySetId;
370377
@Nullable private DrmSession.DrmSessionException drmSessionException;
371378

@@ -375,39 +382,50 @@ public WidevineOfflineLicenseFetchTask(
375382
DataSource.Factory dataSourceFactory,
376383
StartDownloadDialogHelper dialogHelper,
377384
DownloadHelper downloadHelper) {
385+
checkState(drmConfiguration.scheme.equals(C.WIDEVINE_UUID));
386+
this.executorService = Executors.newSingleThreadExecutor();
378387
this.format = format;
379388
this.drmConfiguration = drmConfiguration;
380389
this.dataSourceFactory = dataSourceFactory;
381390
this.dialogHelper = dialogHelper;
382391
this.downloadHelper = downloadHelper;
383392
}
384393

385-
@Override
386-
protected Void doInBackground(Void... voids) {
387-
OfflineLicenseHelper offlineLicenseHelper =
388-
OfflineLicenseHelper.newWidevineInstance(
389-
drmConfiguration.licenseUri.toString(),
390-
drmConfiguration.forceDefaultLicenseUri,
391-
dataSourceFactory,
392-
drmConfiguration.licenseRequestHeaders,
393-
new DrmSessionEventListener.EventDispatcher());
394-
try {
395-
keySetId = offlineLicenseHelper.downloadLicense(format);
396-
} catch (DrmSession.DrmSessionException e) {
397-
drmSessionException = e;
398-
} finally {
399-
offlineLicenseHelper.release();
394+
public void cancel() {
395+
if (future != null) {
396+
future.cancel(/* mayInterruptIfRunning= */ false);
400397
}
401-
return null;
402398
}
403399

404-
@Override
405-
protected void onPostExecute(Void aVoid) {
406-
if (drmSessionException != null) {
407-
dialogHelper.onOfflineLicenseFetchedError(drmSessionException);
408-
} else {
409-
dialogHelper.onOfflineLicenseFetched(downloadHelper, checkNotNull(keySetId));
410-
}
400+
public void execute() {
401+
future =
402+
executorService.submit(
403+
() -> {
404+
OfflineLicenseHelper offlineLicenseHelper =
405+
OfflineLicenseHelper.newWidevineInstance(
406+
drmConfiguration.licenseUri.toString(),
407+
drmConfiguration.forceDefaultLicenseUri,
408+
dataSourceFactory,
409+
drmConfiguration.licenseRequestHeaders,
410+
new DrmSessionEventListener.EventDispatcher());
411+
try {
412+
keySetId = offlineLicenseHelper.downloadLicense(format);
413+
} catch (DrmSession.DrmSessionException e) {
414+
drmSessionException = e;
415+
} finally {
416+
offlineLicenseHelper.release();
417+
new Handler(Looper.getMainLooper())
418+
.post(
419+
() -> {
420+
if (drmSessionException != null) {
421+
dialogHelper.onOfflineLicenseFetchedError(drmSessionException);
422+
} else {
423+
dialogHelper.onOfflineLicenseFetched(
424+
downloadHelper, checkNotNull(keySetId));
425+
}
426+
});
427+
}
428+
});
411429
}
412430
}
413431
}

0 commit comments

Comments
 (0)