119 Commits

Author SHA1 Message Date
Cedric T
c984387248 Re-word comments for new DTS Sync words in DtsUtil.java. 2023-05-25 09:55:10 +00:00
Cedric T
3b9d680914 Add comments for DTSUtil.java 2023-05-25 09:55:09 +00:00
Cedric T
b73d2cc736 Add direct passthrough support for DTS audio. 2023-05-25 09:55:09 +00:00
christosts
b9a4e614f7 Fix seeking bug in opus
Fix a bug when seeking in an opus container. The calculations inside
DefaultOggSeeker may overflow a long primitive.

Issue: androidx/media#391

#minor-release

PiperOrigin-RevId: 534128513
2023-05-24 15:44:49 +01:00
sheenachhabra
b382a7c2da Move MdtaMetadataEntry class into container module
This class is to be shared between extractor, transformer
and muxer module.

PiperOrigin-RevId: 533490888
2023-05-24 15:29:23 +01:00
ibaker
d5f9cf4f19 Add singleVariant publishing config to all published gradle files
Docs:
* https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var
* https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions

This resolves the following warning from Android Gradle Plugin 7.2.2 and
helps unblock the upgrade to AGP 8.0.1:

> Software Components will not be created automatically for Maven
> publishing from Android Gradle Plugin 8.0. To opt-in to the future
> behavior, set the Gradle property
> `android.disableAutomaticComponentCreation=true` in the
> `gradle.properties` file or use the new publishing DSL.
>
> Affected Modules: `lib-cast`, `lib-common`, `lib-container`,
> `lib-database`, `lib-datasource`, `lib-datasource-cronet`,
> `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`,
> `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`,
> `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`,
> `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`,
> `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`,
> `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`,
> `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`,
> `test-utils-robolectric`

Issue: androidx/media#409
PiperOrigin-RevId: 533464133
2023-05-19 17:22:21 +01:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
sheenachhabra
7b62b33127 Move Mp4LocationData from extractor module to container module
This class will be shared between extractor and muxer module.

PiperOrigin-RevId: 532784415
2023-05-17 16:37:57 +01:00
sheenachhabra
e0d6f67dd9 Move NAL unit related methods from common to container module
PiperOrigin-RevId: 532750099
2023-05-17 16:32:46 +01:00
huangdarwin
82ede47398 media3: Capitalize "MIME" for MIME types.
Find and replace "mime" to "MIME", where appropriate, throughout media3.

PiperOrigin-RevId: 531122121
2023-05-11 10:05:01 +00:00
michaelkatz
06ac2f7990 Add UTF-16 encoded subtitle support to SsaDecoder
Issue: androidx/media#319
PiperOrigin-RevId: 527891646
2023-05-03 17:04:35 +01:00
Ian Baker
fab134f0b3 Merge pull request #313 from pengbins:fix_ts_h265reader_parse_sps
PiperOrigin-RevId: 527259619
2023-04-26 15:53:58 +01:00
Ian Baker
171c224bc6 Add a release note for MPEG-TS H.265 SPS parsing fix
Also clean-up a comment about skipping the NAL start code
2023-04-25 18:17:44 +01:00
Ian Baker
e88fa7c52e Reformat with google-java-format 2023-04-25 09:15:26 +01:00
peng bin
d7acae20c0 Use parseH265SpsNalUnit instead of parseH265SpsNalUnitPayload
To consistent with the other callsites of NalUnitUtil for parsing H265 SPS
2023-04-25 09:15:26 +01:00
peng bin
6ae8c8c041 Use NalUnitUtil.parseH265SpsNalUnitPayload when parsing MPEG-TS files
This implicitly fixes a bug by removing the buggy implementation in H265Reader in favour of a working one. This change also adds tests to confirm the parsing bug is fixed.
2023-04-25 09:15:25 +01:00
peng bin
114020c2d8 Fix previousNumDeltaPocs in skipShortTermRefPicSets 2023-04-25 09:15:25 +01:00
Ian Baker
75d81c7630 Derive previousNumDeltaPocs from numNegativePics and numPositivePics
This more closely matches the equations in equations 7-61 and 7-62 in
See H.265/HEVC (2014) section 7.4.8.
2023-04-25 09:15:25 +01:00
peng bin
a65b5a5c2b Fix previousNumDeltaPocs in skipShortTermRefPicSets 2023-04-25 09:15:25 +01:00
peng bin
b08120d752 Fix used_by_curr_pic_flag to align with H.265 spec 2023-04-25 09:15:25 +01:00
peng bin
bc0dc01a69 Add a test sample for ts+h265 2023-04-25 09:15:25 +01:00
rohks
8a73d8d3fe Add support to fetch ColorInfo from avcC box in AtomParsers
#minor-release

PiperOrigin-RevId: 526082823
2023-04-24 11:37:55 +01:00
rohks
596a7c7033 Update colr box values to be overridden by bitstream boxes
#minor-release

PiperOrigin-RevId: 523983688
2023-04-13 16:30:45 +01:00
ibaker
642d34ffc7 Update comment on Track.nalUnitLengthFieldLength
This field is also non-zero for h.265 tracks.

PiperOrigin-RevId: 523676455
2023-04-12 17:01:21 +01:00
sheenachhabra
28aa5e847b Move NAL unit utility classes into common
Need to use NAL unit util methods in muxer module.

PiperOrigin-RevId: 521772831
2023-04-05 15:45:35 +01:00
rohks
6a928805d4 Fix javadoc links in media README files
Also fixed the javadoc link in devsite and removed javadoc links from decoder extensions as it is not published yet on developer.android.com.

#minor-release

PiperOrigin-RevId: 520636868
2023-03-30 17:26:40 +00:00
ibaker
43ad45dbef Remove all RawCC references from media3
RawCC is a Google-internal subtitle format that is no longer directly
supported by this library (since 4f616d6003).

PiperOrigin-RevId: 520591591
2023-03-30 17:25:20 +00:00
sheenachhabra
669008f437 Use FakeExtractorOutput in Mp4MuxerMetadataTest
The FakeExtractorOutput dumps data in more readable format
so using that where ever possible.

The MdtaMetadataEntry which contains key and value dumped only "key".
Added fix to dump "value" as well.

PiperOrigin-RevId: 517968996
2023-03-21 14:19:12 +00:00
Rohit Singh
0e3f407e0e Merge pull request #11064 from haixia-meta:release-v2
PiperOrigin-RevId: 517128752
2023-03-16 15:37:02 +00:00
rohks
8a5fcf82d3 Add support to fetch ColorInfo from hvcc box in AtomParsers
#minor-release

PiperOrigin-RevId: 517086016
2023-03-16 15:34:28 +00:00
Rohit Singh
49d85d625c Merge pull request #11061 from cedricxperi:dts-udts-support
PiperOrigin-RevId: 517067549
2023-03-16 15:33:38 +00:00
sheenachhabra
2f01f9c53b Add support for reading location data in MP4 extractor
The geodata is stored in the "udta" box as per MediaMuxer reference
https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/libstagefright/MPEG4Writer.cpp;drc=master;l=5588

PiperOrigin-RevId: 515095127
2023-03-14 07:46:28 +00:00
ibaker
cb7d565fd4 Add missing @param tags
Dackka generates a warning if a method has at least one `@param` tag,
but not all of them are documented.

#minor-release

PiperOrigin-RevId: 513873453
2023-03-07 11:49:24 +00:00
tonihei
17499cefcc Merge pull request #255 from mayurk2:use_edts_offset_if_it_is_for_entire_file
PiperOrigin-RevId: 513213229
2023-03-01 17:27:15 +00:00
ibaker
1c4ba5d9f6 Delete VorbisUtil.CodeBook since it's not used
PiperOrigin-RevId: 513186205
2023-03-01 17:26:31 +00:00
ibaker
c07cf3dc41 Remove @see tags with <a> tags
These are not supported by Dackka

#minor-release

PiperOrigin-RevId: 513176533
2023-03-01 17:25:48 +00:00
Mayur K
0761641d9f Use edts media time offset if edits list duration is entire media duration. 2023-02-24 18:18:16 +05:30
michaelkatz
4854e771d7 Encapsulate Opus frames in Ogg during audio offload
PiperOrigin-RevId: 508053559
2023-02-08 14:12:06 +00:00
tonihei
00436a04a4 Fix timestamp comparison for seeks in fMP4
When seeking in fMP4, we try to extract as little samples as possible
by only starting at the preceding sync frame. This comparison should
use <= to allow sync frames at exactly the seek position.

Issue: google/ExoPlayer#10941

#minor-release

PiperOrigin-RevId: 505098172
2023-02-01 10:26:52 +00:00
rohks
6c14ffc1ec Fix javadoc references to writeSampleData
PiperOrigin-RevId: 502821506
2023-01-18 12:05:08 +00:00
Googler
d8ea770e9b Throw a ParserException instead of a NullPointerException if the sample table (stbl) is missing a required sample description (stsd).
As per the javadoc for AtomParsers.parseTrack, ParserException should be "thrown if the trak atom can't be parsed."

PiperOrigin-RevId: 499522748
2023-01-04 21:58:17 +00:00
ibaker
636a4a8538 Add javadoc links to README files
Fix some other link titles and destinations spotted along the way.

#minor-release

PiperOrigin-RevId: 493276172
2022-12-12 11:19:23 +00:00
Googler
c14b250445 Temporal fix to allow proper library shrinking.
PiperOrigin-RevId: 492579961
2022-12-12 11:10:18 +00:00
ibaker
3efc62b512 Deprecate C.POSITION_UNSET in favour of C.INDEX_UNSET
These have the same value (`-1`), and basically the same meaning (offset
in an array/list/file/byte stream/etc), but 'position' is an overloaded
term in a media playback library, and there's a risk people assume that
methods like `Player.getCurrentPosition()` may return
`C.POSITION_UNSET`, when in fact unset media times (whether duration or
position) are always represented by `C.TIME_UNSET` which is a) a `long`
(not `int`) and b) a different underlying value. (aside:
`getCurrentPosition()` never returns an unset value, but it's a good
example of the ambiguity of the word 'position' between 'byte offset'
and 'media timestamp'.)

PiperOrigin-RevId: 492493102
2022-12-12 11:09:18 +00:00
ibaker
e4fb663b23 Split SubripDecoder and ParsableByteArray tests
In some cases we split a test method, and in other cases we just add
line breaks to make the separation between arrange/act/assert more
clear.

PiperOrigin-RevId: 492182769
2022-12-12 10:57:18 +00:00
Ian Baker
a919141805 Merge pull request #10750 from Stronger197:subrip_utf_16
PiperOrigin-RevId: 492164739
2022-12-12 10:55:15 +00:00
rohks
c7aa54cb41 Parse and set bitrates in Ac3Reader
PiperOrigin-RevId: 492003800
2022-12-12 10:47:12 +00:00
tonihei
568fa1e1fa Add configuration to support OPUS offload
To support OPUS offload, we need to provide a few configuration values
that are currently not set due to the lack of devices supporting
OPUS offload.

PiperOrigin-RevId: 491613716
2022-11-29 18:48:04 +00:00
ibaker
5292e408a6 Remove impossible UnsupportedEncodingException from Id3Decoder
The list of charsets is already hard-coded, and using `Charset` types
ensures they will all be present at run-time, hence we will never
encounter an 'unsupported' charset.

PiperOrigin-RevId: 491324466
2022-11-29 18:40:42 +00:00
ibaker
fc5d17832f Split up Id3DecoderTest methods
It's clearer if each test method follows the Arrange/Act/Assert pattern

PiperOrigin-RevId: 491299379
2022-11-29 18:37:08 +00:00