114 Commits

Author SHA1 Message Date
tonihei
5eb6a889a7 Adjust Javadoc
PiperOrigin-RevId: 583965332
2023-11-20 02:54:57 -08:00
lpribanic
64d2210b79 Add DashPlayback test for loading thumbnail grids
This test instantiates an image renderer, selects an image track and
plays a thumbnail grid.

PiperOrigin-RevId: 582696009
2023-11-15 09:03:19 -08:00
jbibik
a667ceb6f9 Test DASH playback with TTML subs muxed into MP4
PiperOrigin-RevId: 582685662
2023-11-15 08:31:31 -08:00
tianyifeng
79711ebd3f Parse "f800" as channel count of 5 for Dolby in DASH manifest
Issue: androidx/media#688
PiperOrigin-RevId: 581908905
2023-11-13 04:00:24 -08:00
ibaker
d42c23706b Add warning log if DASH manifest contains incomplete ClearKey info
Unfortunately we can't fail any more obviously at this point, because
manifests often contain config for multiple DRM schemes, and when
parsing the manifest we don't know which scheme is going to be used for
playback. It would be unreasonable to fail playback due to incomplete
ClearKey config if playback was otherwise going to succeed using e.g.
Widevine.

* Issue: androidx/media#777
* Issue: androidx/media#563
* Issue: google/ExoPlayer#9169

#minor-release

PiperOrigin-RevId: 578491484
2023-11-01 05:59:49 -07:00
jbibik
1ac6263869 Test DASH playback + standalone WebVTT parsed during extraction
This change applies to standalone WebVTT files linked directly from the manifest.

Since DASH only supports stand-alone IMSC1 (TTML) and WebVTT text files, this change concludes the support extension of text-based subtitle files to be parse during extraction.

PiperOrigin-RevId: 577468830
2023-10-28 08:44:11 -07:00
jbibik
97efa70852 Add DASH support for parsing standalone TTML files during extraction
This change applies to standalone TTML files linked directly from the manifest.

As a result, we no longer have the flakiness in the DashPlaybackTest which uses sidecar-loaded (standalone file) TTML subtitles. We experimentally opt into parsing subtitles during extraction and use SubtitleExtractor in hybrid mode.

PiperOrigin-RevId: 577457256
2023-10-28 06:59:45 -07:00
ibaker
66fa591959 Add experimental opt-in to parse DASH subtitles during extraction
This currently only applies to subtitles muxed into mp4 segments, and
not standalone text files linked directly from the manifest.

Issue: androidx/media#288

#minor-release

PiperOrigin-RevId: 572263764
2023-10-10 08:53:42 -07:00
ibaker
33c151eb5b Fix the asset and dump file names for the standalone TTML DASH test
#minor-release

PiperOrigin-RevId: 571941997
2023-10-09 08:19:05 -07:00
jbibik
bd5a3920b8 Add DashPlayback test with sideloaded TTML subtitles
The test is hidden behind the Ignore annotation due to some flakiness just like `webvttInMp4`. However, it will be removed when the subtitle parsing is moved to a pre-sample-queue architecture.

#minor-release

PiperOrigin-RevId: 570376275
2023-10-03 07:08:58 -07:00
microkatz
f13a2e7e0f Updated method description to take into account the new void return type 2023-10-02 11:29:15 +00:00
microkatz
cd29d4637d Simplified class fields and method parameters due to using ArrayList 2023-10-02 11:29:15 +00:00
microkatz
34a0e3fa09 Updated typings to be List rather than ArrayList 2023-10-02 11:29:15 +00:00
microkatz
8a6f4a91e9 Format with google-java-format 2023-10-02 11:29:15 +00:00
hhouillon
355484ebfb UrlTemplate uses ArrayLists instead of Arrays 2023-10-02 11:29:15 +00:00
Hugo Houillon
81e2472034 Dash UrlTemplate parses template using ArrayLists 2023-10-02 11:29:15 +00:00
hhouillon
022444e751 Edit DASH UrlTemplate identifiers parser and add UrlTemplate tests 2023-10-02 11:29:15 +00:00
hhouillon
eb5cbd902b DASH UrlTemplate parses template if it contains more than one time each identifier 2023-10-02 11:29:15 +00:00
rohks
206a663dca Add functionality to transmit CMCD data using query parameters
Currently, we only support sending Common Media Client Data (CMCD) data through custom HTTP request headers, added capability to configure and transmit it as HTTP query parameters.

PiperOrigin-RevId: 561591246
2023-08-31 02:11:12 -07:00
rohks
80495ddf9c Add nullness annotations to Representation
#fixit

PiperOrigin-RevId: 559690973
2023-08-24 02:38:11 -07:00
rohks
e2ee8ae1b0 Add nullness annotations to DefaultDashChunkSource
#fixit

PiperOrigin-RevId: 559405572
2023-08-24 09:28:36 +01:00
rohks
e0d3cad8bb Add fields next object request (nor) and next range request (nrr)
Added this CMCD-Request fields to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 558317146
2023-08-22 15:25:03 +01:00
rohks
b6b16b2895 Sort Common Media Client Data keys to reduce fingerprinting surface
Based on the Common Media Client Data (CMCD) specification key-value pairs should be sequenced in alphabetical order of the key name in order to reduce the fingerprinting surface exposed by the player.

PiperOrigin-RevId: 558296264
2023-08-22 15:23:33 +01:00
rohks
afb8d6c9e2 Make custom data adhere to Common Media Client Data(CMCD) specification
Added more comprehensive Javadoc around setting custom data and verification on key format.

Changed adding custom data as a `String` to `List<String>`. This would enable us to sort all keys to reduce the fingerprinting surface.

PiperOrigin-RevId: 558291240
2023-08-22 15:22:08 +01:00
rohks
4282a6ecd7 Add buffer starvation(bs), deadline(dl), playback rate(pr), startup(su)
Enhanced the Common Media Client Data (CMCD) logging by incorporating additional fields:
* buffer starvation (bs) : CMCD-Status
* deadline (dl) and startup (su) : CMCD-Request
* playback rate (pr) : CMCD-Session

PiperOrigin-RevId: 555553357
2023-08-11 20:23:23 +00:00
rohks
cf9f048a3d Enhance getNextChunk() API to allow passing more information
Modifies the `ChunkSource.getNextChunk(long, long, List, ChunkHolder)` method in the `ChunkSource` interface to `ChunkSource.getNextChunk(LoadingInfo, long, List, ChunkHolder)`.

LoadingInfo contains additional parameters, including `playbackRate` and `lastRebufferRealtimeMs` in addition to the existing `playbackPositionUs`. The additional parameters will allow us to pass these information to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 555148768
2023-08-10 12:23:37 +00:00
rohks
481ea4a274 Enhance continueLoading() API to allow passing more information
Modifies the `SequenceableLoader.continueLoading(long)` method in the `SequenceableLoader` interface to `SequenceableLoader.continueLoading(LoadingInfo)`.

`LoadingInfo` contains additional parameters, including `playbackSpeed` and `lastRebufferRealtimeMs` in addition to the existing `playbackPositionUs`. The additional parameters will allow us to pass these information to Common Media Client Data (CMCD) logging.

By using the `LoadingInfo` object, we ensure future flexibility to add more fields without causing any breaking changes to the API.

PiperOrigin-RevId: 555123961
2023-08-10 12:16:41 +00:00
Tianyi Feng
ef54364478 Merge pull request #528 from zgzong:patch-2
PiperOrigin-RevId: 554869426
2023-08-10 12:09:43 +00:00
rohks
3ec462d1cf Add field object type (ot)
Added this CMCD-Object field to Common Media Client Data (CMCD) logging.

#minor-release

PiperOrigin-RevId: 554843305
2023-08-10 12:06:13 +00:00
tonihei
71591782f0 Adjust periodEnded logic further
Periods that are not the last in the manifest are always ended
and non-dynamic periods are also always ended by definition.

Also, some periods may not be able to declare their final duration
accurately and we need to account for some inaccuracy. This can be
done by testing whether no further full segment within the duration
can be expected.
2023-08-08 17:47:23 +01:00
tonihei
88e921ced1 Format with google-java-format 2023-08-08 17:42:57 +01:00
zgzong
fb847cad66 Update dash chunk source to handle in-progressive recording dash stream.
Using calculated segments timeline duration to compare with period duration to update whether period has reach it the end of stream.
2023-08-08 17:42:57 +01:00
rohks
11648e6c8e Simplify and accurately compute chunk duration
Refactored `CmcdLog` to `CmcdHeadersFactory` for improved representation of its purpose and updated implementations.

#minor-change

PiperOrigin-RevId: 552831995
2023-08-07 11:19:00 +00:00
rohks
cdb174c91a Add field measured throughput (mtp)
Updated `ExoTrackSelection` to provide the most recent bitrate estimate, enabling the inclusion of measured throughput (mtp) as a CMCD-Request field in Common Media Client Data (CMCD) logging.

Additionally, made changes to the `checkArgument` methods in `CmcdLog` to prevent the use of default values in certain cases.

#minor-release

PiperOrigin-RevId: 549369529
2023-07-20 10:34:32 +01:00
rohks
1b2a2fcde0 Add fields top bitrate(tb) and object duration(d)
Added these CMCD-Object fields to Common Media Client Data (CMCD) logging.

#minor-release

PiperOrigin-RevId: 548950296
2023-07-20 10:19:26 +01:00
rohks
ca10204b2d Replace Dummy with Placeholder
`Dummy` is a non inclusive language.

PiperOrigin-RevId: 547815680
2023-07-14 10:17:05 +01:00
rohks
0412a36564 Add fields streaming format(sf), stream type(st) and version(v)
Added these CMCD-Session fields to Common Media Client Data (CMCD) logging.

#minor-release

PiperOrigin-RevId: 547435498
2023-07-13 15:50:16 +01:00
tonihei
3d4bd7ce19 Make MediaItems updateable
This changes all MediaSources in our library to allow updates to
their MediaItems (if supported).

Issue: google/ExoPlayer#9978
Issue: androidx/media#33
PiperOrigin-RevId: 546808812
2023-07-13 15:26:30 +01:00
microkatz
9513f2c551 Merge pull request #487 from vishnuchilakala:allow_unsigned_int_for_adaptation_set_id
PiperOrigin-RevId: 544601945
2023-07-05 08:53:09 +00:00
tonihei
4169386c12 Switch parsing to Long
This avoids issues with potential number clashes with ID_UNSET.
Also fixes some further parsing where adaptation set ids are referenced
from manifest properties.
2023-06-30 08:42:59 +01:00
tonihei
2322462404 Do not trim audio samples by changing their timestamp
MP4 edit lists sometimes ask to start playback between two samples.
If this happens, we currently change the timestamp of the first
sample to zero to trim it (e.g. to display the first frame for a
slightly shorter period of time). However, we can't do this to audio
samples are they have an inherent duration and trimming them this
way is not possible.

#minor-release

PiperOrigin-RevId: 543420218
2023-06-29 22:50:04 +00:00
tonihei
154eee7d9e Avoid Integer.parseUnsignedInt because it's only available from API 26 2023-06-29 12:31:38 +01:00
tonihei
58baeeb1bb Formatting and Javadoc updates 2023-06-29 10:25:58 +01:00
Vishnu Chilakala
e06c72ba26 Allow unsigned integers in adaptation set id 2023-06-29 10:25:58 +01:00
jbibik
ea0f564c1e Fix missing equals sign in inline-comment parameter names
PiperOrigin-RevId: 542577676
2023-06-23 16:44:33 +00:00
rohks
be9b057dda Refactor method CmcdLog.createInstance to accept bufferedDurationUs
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540630112
2023-06-19 16:19:04 +01:00
rohks
52878b2aca Add CMCD logging when requesting initialization chunk for DASH and HLS
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540594444
2023-06-19 16:17:16 +01:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
bachinger
319854d624 Do not reset period uid when DashMediaSource is released
When the source is prepared again after stop, the period uid
is calculated by subtracting the `firstPeriodId` from the
period uid that is passed in to `createPeriod`. When this
happens after stop, the uid from the old period uid that
is still stored and has the value of the last played uid.

Hence the `firstPeriodId` must not be reset when released.

Issue: google/ExoPlayer#10838
PiperOrigin-RevId: 539028570
2023-06-09 14:03:22 +00:00
rohks
b55ddf12b4 Implement logging support for Common Media Client Data (CMCD)
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 539021056
2023-06-09 14:01:25 +00:00