Commit graph

362 commits

Author SHA1 Message Date
Rohit Singh
6aa80b334a Minor refactoring based on internal review 2024-04-29 17:47:48 +01:00
Rohit Singh
c34c3db87f fix for packet header split over 2 PES packets 2024-04-26 16:02:58 +01:00
Rohit Singh
3d974793f9 add test sample for packet header split across PES packets 2024-04-26 16:01:42 +01:00
Rohit Singh
ad7ca92e29 Refactor logic to handle edge case 2024-04-25 15:33:06 +01:00
Rohit Singh
a49ce59d05 Add a test case which has sample with rai set and dai unset 2024-04-24 12:42:38 +01:00
Rohit Singh
5b3a50fca8 Changes based on internal review 2024-04-22 17:25:40 +01:00
Rohit Singh
e412987248 Refactor 2024-04-18 15:00:18 +01:00
Rohit Singh
0102f4b512 Move MpeghUtil to extractor.ts package 2024-04-18 12:50:43 +01:00
Rohit Singh
4822033a6c More changes based on internal review 2024-04-17 18:17:03 +01:00
Rohit Singh
71db918f91 Update javadoc for 2024-04-16 18:11:52 +01:00
Rohit Singh
aba51191aa More changes based on the internal review 2024-04-16 17:12:12 +01:00
Rohit Singh
cbe17bcd0a Changes based on internal review 2024-04-16 14:51:47 +01:00
Rohit Singh
6811b8394b Changes based on internal comments 2024-04-12 15:08:00 +01:00
Rohit Singh
ae77333d0f Adhere to the change in signature of ElementaryStreamReader 2024-04-12 15:08:00 +01:00
Rohit Singh
cfa7f1f0a7 Format with google-java-format 2024-04-12 15:08:00 +01:00
Rohit Singh
71673d65f3 further improvements 2024-04-12 15:07:59 +01:00
Rohit Singh
6ac888ec3b Minor formatting changes 2024-04-12 15:07:59 +01:00
rohks
b6990c3c5b improve PES packet parsing for MPEG-H 2024-04-12 15:07:59 +01:00
Rohit Singh
5df45f7e64 Changes based on internal review 2024-04-12 15:07:59 +01:00
rohks
44b2071ee0 Add nullness checks 2024-04-12 15:07:59 +01:00
rohks
2da1bb1877 Format with google-java-format 2024-04-12 15:07:59 +01:00
rohks
66718c2b3d Remove validateBitsAvailability checks 2024-04-12 15:07:59 +01:00
rohks
e53951d790 changes/improvements according to review comments 2024-04-12 15:07:59 +01:00
rohks
b9c2ee4d24 Rearrange elements based on Google coding conventions and other minor changes 2024-04-12 15:07:59 +01:00
rohks
43cf32738d - remove 'NonNull' and add 'UnstableApi' annotation
- rename 'checkBitsAvailable()' to 'validateBitsAvailability()'
- rename 'ParseState' to 'State'
- rename State values to begin with 'STATE_'
- make use of 'Format.NO_VALUE' and 'C.INDEX_UNSET'
- adjust documentation
2024-04-12 15:07:59 +01:00
rohks
3aff715824 use @IntDef instead of enum 2024-04-12 15:07:59 +01:00
rohks
6472ba1194 - add MpeghReader.java and MpeghUtil.java
- add stream type for MPEG-H
- use MpeghReader in DefaultTsPayloadReaderFactory
- add MPEG-H TS test samples and corresponding extractor dumps
2024-04-12 15:07:58 +01:00
Googler
136baa148f Rollback of f4e444bdd2
PiperOrigin-RevId: 620271247
2024-03-29 10:07:56 -07:00
ibaker
b60cd2c033 Rollback of e665e2aee8
PiperOrigin-RevId: 619871653
2024-03-28 04:04:01 -07:00
ibaker
7a105e0e57 Fix XingSeeker @param tags - follow-up to 4fde35c9cc
PiperOrigin-RevId: 619249887
2024-03-26 11:11:58 -07:00
ibaker
d00ca1e343 Plumb MP3 average bitrate from metadata frames into Format
Issue: androidx/media#1081

#minor-release

PiperOrigin-RevId: 619185083
2024-03-26 07:40:08 -07:00
tonihei
6e0f8e3b0d Remove decode-only flag
No known component is using this flag anymore and it has been
deprecated for a while for custom renderers and decoders.

PiperOrigin-RevId: 619154299
2024-03-26 05:28:27 -07:00
tonihei
0f42dd4752 Use output start time instead of deprecated isDecodeOnly in CeaDecoder
PiperOrigin-RevId: 619133908
2024-03-26 03:47:18 -07:00
Googler
f4e444bdd2 Internal change
PiperOrigin-RevId: 618879473
2024-03-25 10:12:34 -07:00
ibaker
e9ed874e51 Don't emit a CuesWithTiming for zero-duration Subtitle events
It's a bit arguable whether the `Subtitle` implementation supports
zero-duration events, since `getEventTimeCount` is documented as
effectively "the number of times the cues returns by `getCues(long)`
changes", and zero-duration events violate that. However, the current
`WebvttSubtitle` impl **does** produce zero-duration events, so it
seems safer to handle them gracefully here and then, as a possible
follow-up, fix the `WebvttSubtitle` impl (or remove it completely).

Issue: androidx/media#1177

#minor-release

PiperOrigin-RevId: 616095798
2024-03-15 05:26:21 -07:00
Copybara-Service
e9a28beb44 Merge pull request #1117 from loliball:dev_wav_align_fix
PiperOrigin-RevId: 615820438
2024-03-14 10:17:49 -07:00
Rohit Singh
c84a3279d3 Add unit test 2024-03-14 16:12:40 +00:00
ibaker
afacf2cdb7 Set Format.frameRate for single-frame MP4 tracks
Issue: androidx/media#1051
PiperOrigin-RevId: 613516802
2024-03-07 02:53:05 -08:00
ibaker
19cd156a8c Add Mp4ExtractorTest case for pixel-motion-photo-2-hevc-tracks.mp4
A follow-up change will add the frame rate to the single-frame track.

Issue: androidx/media#1051
PiperOrigin-RevId: 611018319
2024-02-28 01:23:01 -08:00
Rohit Singh
1994ba991c Add release note and update comment 2024-02-27 15:59:59 +00:00
Rohit Singh
b254c4625d Format with google-java-format 2024-02-27 15:30:22 +00:00
loliball
f88c9ad68c Fixed missing skip padding issue when reading odd sized chunks from wav files. 2024-02-27 15:30:22 +00:00
ibaker
d1ae9ffc52 Add more details about why Extractor.sniff returned false
PiperOrigin-RevId: 609335656
2024-02-22 05:20:16 -08:00
tonihei
711d24a12f Clarify purpose of omitting zero duration clipped audio samples
When applying edit lists, we need to output the last partial samples
to have all the necessary data needed for rendering.

The only case where we can omit the sample is for zero duration
audio data that has no additional information.

The current comment and variable name doesn't make this very clear
and this change improves the naming and the comment.

PiperOrigin-RevId: 608579746
2024-02-20 06:17:28 -08:00
bachinger
4777d62d31 Rollback of 8e2869278c
PiperOrigin-RevId: 607264513
2024-02-15 02:35:12 -08:00
asinclair
8e2869278c Internal Cleanup
PiperOrigin-RevId: 607117264
2024-02-14 15:06:10 -08:00
tonihei
5f9c96ab53 Set correct track id when skipping empty tracks in Mp4Extractor
The track id must be the index in the list of published tracks
as it's used as such elsewhere. This is currently not true if we
skip an empty track as all subsequent tracks get a wrong or even
invalid id.

#minor-release

PiperOrigin-RevId: 604929178
2024-02-07 03:39:59 -08:00
ibaker
7ae3d69e00 JpegMotionPhotoExtractor: Don't emit an image track with no metadata
The current implementation of `JpegMotionPhotoExtractor.sniff` returns
`true` for any image with Exif data (not just motion photos). Improving
this is tracked by b/324033919. In the meantime, when we 'extract' a
non-motion photo with `JpegMotionPhotoExtractor`, the result is
currently a single empty image track and no video track (since there's
no video, since this isn't a motion photo). This 'empty' image track
is usually used to transmit metadata about the video parts of the
image file (in the form of `MotionPhotoMetadata`), but this metadata is
also (understandably) absent for non-motion photos. Therefore there's
no need to emit this image track at all, and it's clearer to emit no
tracks at all when extracting a non-motion photo using
`JpegMotionPhotoExtractor`.

This change also removes a `TODO` that is misplaced, since there's no
image bytes being emitted here (and never was).

PiperOrigin-RevId: 604688053
2024-02-06 10:22:18 -08:00
ibaker
eabba49610 Check sampleMimeType rather than containerMimeType for images
These are often the same for image tracks, since we usually drop the
whole image file (both the container and actual encoded image bytes)
into a single sample, but there are cases where we emit a track with
`containerMimeType=image/jpeg` but **no** samples (from
`JpegMotionPhotoExtractor`, to carry some metadata about the image +
video byte offsets).

It's therefore more correct to implement the `supportsFormat` check
based on `sampleMimeType`, so that these 'empty' image tracks are not
considered 'supported' by `ImageRenderer`.

#minor-release

PiperOrigin-RevId: 604672331
2024-02-06 09:31:37 -08:00
ibaker
25498b151b Merge Cea608Parser back into Cea608Decoder
This reverses 27caeb8038

Due to the re-ordering of packets done in `CeaDecoder`, there's no way
to use the current implementation to correctly parse these subtitle
formats during extraction (the `SubtitleParser` interface), so we have
to keep the `SubtitleDecoder` implementations.

#minor-release

PiperOrigin-RevId: 604594837
2024-02-06 03:36:23 -08:00