3490 Commits

Author SHA1 Message Date
ibaker
6057b59723 Add tests for CuesWithTiming.endTimeUs
#minor-release

PiperOrigin-RevId: 570988195
2023-10-05 05:51:54 -07:00
tofunmi
9cc75ca52e Change equalTo check in ImagePlaybackTest to atLeast
The aim of this test is to make sure the image is onscreen for the right amount of time, so to drive down flakes from the decoder taking too long, change this to an atLeast check

#minor-release

PiperOrigin-RevId: 570988044
2023-10-05 05:49:49 -07:00
tonihei
87f1b4252e Update documentation wrongly referencing the decode-only flag
#minor-release

PiperOrigin-RevId: 570973457
2023-10-05 04:32:40 -07:00
samrobinson
068d420ba2 Remove experimental keepAudioTrackOnSeek.
PiperOrigin-RevId: 570966027
2023-10-05 03:52:51 -07:00
huangdarwin
b153a271a3 Test: Ignore failing tests fixed in newer API versions.
PiperOrigin-RevId: 570954436
2023-10-05 02:53:15 -07:00
huangdarwin
40b990f5fa GL: Use only the index location returned by glGetAttribLocation
location and index are mostly equivalent, except that it's possible that location is more up-to-date than index, so we can just always use location.

PiperOrigin-RevId: 570950407
2023-10-05 02:35:11 -07:00
michaelkatz
42c1846984 Use RTSP Setup response timeout value in KeepAliveMonitor intervalMs
Set KeepAliveMonitor to send a keep-alive message at half the timeout value, if provided, by the RTSP Setup response.

Issue: androidx/media#662
PiperOrigin-RevId: 570946237
2023-10-05 02:13:54 -07:00
ibaker
bf7b91e57e Add CuesWithTiming.endTimeUs
In most cases this is more useful than `durationUs`.

We will keep `durationUs`, and the constructor will continue to take
`startTimeUs` and `durationUs`, to allow for use-cases where we don't
know the start time but still want to indicate a duration (this will be
used to implement CEA-608 timeout).

#minor-release

PiperOrigin-RevId: 570944449
2023-10-05 02:04:26 -07:00
huangdarwin
89a1bb528d Flush: VideoFrameProcessor Image Input.
Much simpler than ExternalTextureManager flushing, because
ExternalTextureManager complexity is due to decoder race condition behavior,
which we won't see for Bitmaps due to a more well-defined interface.

This is needed to test texture output flushing.

PiperOrigin-RevId: 570896363
2023-10-04 21:20:23 -07:00
tonihei
a03e20fe6c Add Decoder.setOutputStartTimeUs and use it in extension decoders
This gets rid of the reliance on the decode only flag that is still
set on input buffers to the decoder if they are less than the start
time.

We still need to set and check the decode-only flag in SimpleDecoder
to ensure compatbility with custom decoders that use the flag while
it's not fully removed.

PiperOrigin-RevId: 570736692
2023-10-04 10:37:25 -07:00
tonihei
64fe863f31 Remove wrong Javadoc
The corresponding logic has been removed in 796781d4c3

#minor-release

PiperOrigin-RevId: 570729509
2023-10-04 10:13:12 -07:00
tonihei
9ef1c20e7a Replace ENCODING_DTS_UHD_P2 value by reference to platform constant
#minor-release

PiperOrigin-RevId: 570696505
2023-10-04 08:09:04 -07:00
tofunmi
572fb4676c Update getName of BitmapFactoryImageDecoder
cleanup from 8f5835c51c

#minor-release

PiperOrigin-RevId: 570663437
2023-10-04 05:23:32 -07:00
tonihei
8e2bf21011 Add onAudioTrackInitialized/Released events
This is useful for analytics and understanding player behavior
during transitions.

#minor-release

PiperOrigin-RevId: 570623227
2023-10-04 01:50:15 -07:00
rohks
a879bae1ee Add nullness annotations to DecoderVideoRenderer
Also fixed a bug where format queue was polled with wrong timestamp value.

#fixit

PiperOrigin-RevId: 570420304
2023-10-03 10:06:35 -07:00
rohks
7a91474af9 Add nullness annotations to MediaCodecRenderer
#fixit

PiperOrigin-RevId: 570403923
2023-10-03 09:05:49 -07:00
tonihei
796781d4c3 Move decode-only handling out of MetadataDecoder interface logic
The interface requires the implementation to return null if the
decode-only flag is set. So instead of setting the flag and returning
null, we can simply not call the method and assume it's null.

The only reason where this wouldn't work is if the metadata format
has keyframe-like logic and requires previous metadata to decode
the next one. This is not something we came across before and it seems
ignorable. If that feature is needed in the future, we should instead
add a method to MetadataDecoder to set the first output timestamp.

#minor-release

PiperOrigin-RevId: 570399838
2023-10-03 08:49:18 -07:00
michaelkatz
da06bf057a Disable offload scheduling at set up for track transition
While sleeping for offload, position is estimated based on time playing. If asleep and AudioTrack is reused, then the position will keep incrementing as the subsequent item plays. That is until wakeup when playing position is updated to the timestamp of the second item. Offload scheduling should be disabled until track transitions fully.

PiperOrigin-RevId: 570397140
2023-10-03 08:37:31 -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
jbibik
b83f12c4ba Add Dumper support for outputting multiline strings
PiperOrigin-RevId: 570348425
2023-10-03 04:47:31 -07:00
tonihei
c8aac24ffd Explicitly mark DecoderOutputBuffer as shouldBeSkipped if needed
In some cases, SimpleDecoder output needs to be skipped for rendering
because the decoder produces no data. This is one of the remaining
usages of BUFFER_FLAG_DECODE_ONLY at the moment and can be more
directly solved without using the flag. SimpleDecoder still needs to
check the flag though for backwards compatbility with custom decoders
while the flag is not completely removed.

PiperOrigin-RevId: 570345233
2023-10-03 04:28:21 -07:00
samrobinson
1bb501ab50 Deprecate experimental keepAudioTrackOnSeek methods.
#minor-release

PiperOrigin-RevId: 570340714
2023-10-03 04:09:49 -07:00
ibaker
9edbfa974a Fix Util.scaleLargeValue/Timestamp to handle negative numbers
#minor-release

PiperOrigin-RevId: 570337535
2023-10-03 03:52:02 -07:00
huangdarwin
fa51f8cd4d Effect: Move common statement out of switch/case
PiperOrigin-RevId: 570323141
2023-10-03 02:37:48 -07:00
huangdarwin
8953f26a5c Test: Move OpenGL tone mapping capabilities check to utility method.
PiperOrigin-RevId: 570316091
2023-10-03 02:00:55 -07:00
huangdarwin
9ca5d50b2d Test: Ignore failing tests fixed in newer API versions.
PiperOrigin-RevId: 570061196
2023-10-02 07:34: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
christosts
144bd72236 MediaCodeVideoRenderer: flush video sink before codec
When seeking, we must first flush the video sink so it stops
using any SurfaceTextures before flushing MediaCodec.

#minor-release

PiperOrigin-RevId: 570015998
2023-10-02 04:03:23 -07:00
ibaker
e9bf41ca04 Mark test_session_current support app as MultiDexApplication
PiperOrigin-RevId: 570015354
2023-10-02 03:59:36 -07:00
ibaker
8f5835c51c Rename DefaultImageDecoder to BitmapFactoryImageDecoder
This reflects the documented behaviour of this class.

#minor-release

PiperOrigin-RevId: 569475137
2023-09-29 06:27:24 -07:00
claincly
34dddfe9d5 Add previewing specific video graph.
PiperOrigin-RevId: 569473178
2023-09-29 06:16:16 -07:00
christosts
0b4638af15 ExportTest: make 8K asset and trim
Move remote 8K file to local and trim to 320ms.

Trim done with ffmpeg:

`ffmpeg -i {remote_file} -t 0.3 -c:v copy -c:a copy 8k24fps_300ms.mp4`

PiperOrigin-RevId: 569449962
2023-09-29 04:07:40 -07:00
bachinger
a3b1661513 Bump Media3 version numbers for 1.2.0-alpha02
PiperOrigin-RevId: 569269992
2023-09-28 13:15:46 -07:00
ibaker
d50f662b10 Mark DefaultImageDecoder.BitmapDecoder as @VisibleForTesting
It seems likely we will define a new "image decoder" interface that
returns `ListenableFuture<Bitmap>`, and naming that will be
hard/annoying if we need to keep this interface working too.

It's also not really clear what a non-test implementation of this
interface would be expected to do, since `DefaultImageDecoder` is
documented to always decode using `BitmapFactory`.

#minor-release

PiperOrigin-RevId: 569206325
2023-09-28 09:33:59 -07:00
Copybara-Service
6d77838a6b Merge pull request #675 from shanujshekhar:shanujs/add-new-apis-exomediadrm
PiperOrigin-RevId: 569205163
2023-09-28 09:31:14 -07:00
claincly
cd6f8a42a5 Move Single/MultiVideoGraph impl to effect
PiperOrigin-RevId: 569188658
2023-09-28 08:27:06 -07:00
Ian Baker
a1767d349a Fix review comments 2023-09-28 15:57:13 +01:00
ibaker
d716de02aa Suppress lint in PlayerControlView and TrackSelectionDialogBuilder
PiperOrigin-RevId: 569165562
2023-09-28 06:48:54 -07:00
bachinger
0b0d02c3e4 Add isAutomotiveController and isAutoCompanionController
Issue: androidx/media#561
Issue: androidx/media#644
Issue: androidx/media#645
PiperOrigin-RevId: 568948230
2023-09-27 13:45:17 -07:00
bachinger
99086b4007 Add default implementation of Callback.onSubscribe
The library already maintains the subscribed controllers internally. This
change adds `MediaLibrarySession.getSubscribedControllers(mediaId)` to
access subscribed controllers for a given media ID.

To accept a subscription, `MediaLibraryService.Callback.onSubscribe` is
required to return `RESULT_SUCCESS`. So far, this isn't the case for the
default implementation of the library.

This change implements `Callback.onSubscribe` to conditionally
provide `RESULT_SUCCESS`. The default calls `Callback.onGetItem(mediaId)` to
assess the availability of the media item. If the app retruns `RESULT_SUCCESS`
with a browsable item, the subscription is accepted. If receiving a valid item
fails, the subscription is rejected.

Issue: androidx/media#561
PiperOrigin-RevId: 568925079
2023-09-27 12:19:34 -07:00
huangdarwin
1df2210cf4 Test: Update HDR GL tone-map fallback string.
PiperOrigin-RevId: 568920716
2023-09-27 12:05:30 -07:00
tonihei
77ba0292ad Add position interpolation to MediaControllerImplLegacy
Without this, the position won't udpate until the session sends
a new playback state.

PiperOrigin-RevId: 568889286
2023-09-27 10:23:27 -07:00
ibaker
b4771e07b5 Mark HEIF decoding as only supported on API 26+
https://developer.android.com/guide/topics/media/platform/supported-formats#image-formats

#minor-release

PiperOrigin-RevId: 568864219
2023-09-27 08:56:06 -07:00