14392 Commits

Author SHA1 Message Date
Egor Neliuba
2bd348effd Consider BorderStyle value before applying OutlineColour as background 2022-04-04 18:26:31 +03:00
Egor Neliuba
388b8d1d88 Add support for SSA OutlineColour (only background)
OutlineColour should be treated as the background color if BorderStyle=3. Since currently BorderStyle is ignored, we can always treat OutlineColor as the background color.
2022-04-03 11:39:06 +03:00
Rakesh Kumar
3b9519c398 Add support for RTSP VP9
Change-Id: Id658564495af13c35fa78ecde9ab587557aabb47
2022-03-31 21:29:32 +05:30
Shraddha Basantwani
3f8a68004c Add PCM and G711 Reader Test
Add RtpPcmReader tests and warning for out of
order packets in RtpPcmReader.

Change-Id: I1554fa0a944dad00248a0a41fefad958da073a21
2022-03-28 11:27:32 +05:30
Shraddha Basantwani
500c879b8a Modify RtpPcmReader
Rename a few variable to be more relevant
Add detailed java docs
2022-03-28 11:22:23 +05:30
Shraddha Basantwani
bfc1fb9aa7 Merge branch 'main' of github.com:ittiam-systems/media into rtp_wav 2022-03-28 11:13:21 +05:30
Haruki Hasegawa
7536a25bf5
Call removeCallbacksAndMessages() in MediaController#release()
This fixes the NPE ocuured in the MediaControllerImplLegacy#connectToSession()
right after MediaController#release() is called.
2022-03-27 00:20:23 +09:00
Haruki Hasegawa
db1a1dc40c
Add more test cases for checking the MediaController#release() behavior
Current implementation of the release() method have a bug;
it does not clear pending messages/callbacks queued to the
applicationHandler.
2022-03-27 00:13:01 +09:00
huangdarwin
cf0a680677 Media: Remove unused CastPlayer values.
PiperOrigin-RevId: 437237835
2022-03-25 14:46:29 +00:00
hschlueter
9cd37385d0 Remove old TODOs and reassign another TODO.
* The AdvancedFrameProcessor calls use() in updateProgramAndDraw().
* The AdvancedFrameProcessor has the same input and output dimensions.

PiperOrigin-RevId: 437231350
2022-03-25 14:43:01 +00:00
ibaker
9c2ee5a224 Demo: Move DownloadService calls to new method in SampleChooserActivity
This allows the whole startDownloadService() method to be opted into the
unstable media3 API in a follow-up change.

PiperOrigin-RevId: 437228776
2022-03-25 14:39:34 +00:00
hschlueter
f42d09cf15 Allow frame processors to be set on Transformer.Builder.
Also make GlFrameProcessor, ScaleToFitFrameProcessor, and
AdvancedFrameProcessor public.

PiperOrigin-RevId: 437227388
2022-03-25 14:36:02 +00:00
hschlueter
8dc039c084 Check for GL errors after glClear and glDrawArrays.
These methods can cause errors so we should check for them.
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glClear.xml
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glDrawArrays.xml

PiperOrigin-RevId: 437218519
2022-03-25 14:32:20 +00:00
ibaker
e11d105f39 Switch the bug template to a form
Also force people to use one of the templates

Documentation:
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
PiperOrigin-RevId: 437210882
2022-03-25 14:28:35 +00:00
andrewlewis
edfa03d969 Handle non-standard MIME type on LG AC3 decoder
PiperOrigin-RevId: 437057336
2022-03-25 14:21:17 +00:00
andrewlewis
f41ebf6c65 Improve throughput on devices requiring workaround
On some devices, decoding gets stuck when the number of frames pending at the
`SurfaceTexture` is too high. We added a workaround that only allows one frame
to be pending at a time. That fixed the issue, however, based on on-device
testing it seems that it's safe to queue more than one frame.

Add a method that returns a safe estimate of the number of frames that can be
pending at a time, and use this to limit the number of frames that can be
released from the decoder but not processed by the frame processor chain.

PiperOrigin-RevId: 437057075
2022-03-25 14:17:50 +00:00
hschlueter
dbe57af553 Configure the frame sizes in FrameProcessorChain instead of caller.
Configuring the frame sizes between frame processors is now the
FrameProcessorChain's rather than the caller's responsibility.
The caller can getOutputSize() and override it for encoder fallback
in configure().

PiperOrigin-RevId: 437048436
2022-03-25 14:14:28 +00:00
huangdarwin
acacb23ba6 Media: Remove unused CastPlayer values.
PiperOrigin-RevId: 437237835
2022-03-25 14:11:38 +00:00
hschlueter
4e63bdf3cc Move OpenGL setup to FrameProcessorChain#configure().
The factory method is replaced by a public constructor and
configure() method which configures the input/output surfaces
and handles the OpenGL setup.

This is a prerequisite for removing the responsibility of the
caller to configureSizes() before creating the chain in a follow-up.

PiperOrigin-RevId: 437028882
2022-03-25 14:10:52 +00:00
hschlueter
5f573ad3ad Remove old TODOs and reassign another TODO.
* The AdvancedFrameProcessor calls use() in updateProgramAndDraw().
* The AdvancedFrameProcessor has the same input and output dimensions.

PiperOrigin-RevId: 437231350
2022-03-25 14:10:47 +00:00
ibaker
dc4dbe6a40 Demo: Move DownloadService calls to new method in SampleChooserActivity
This allows the whole startDownloadService() method to be opted into the
unstable media3 API in a follow-up change.

PiperOrigin-RevId: 437228776
2022-03-25 14:09:37 +00:00
hschlueter
0f5686fe07 Allow frame processors to be set on Transformer.Builder.
Also make GlFrameProcessor, ScaleToFitFrameProcessor, and
AdvancedFrameProcessor public.

PiperOrigin-RevId: 437227388
2022-03-25 14:08:41 +00:00
hschlueter
d5056072a8 Check for GL errors after glClear and glDrawArrays.
These methods can cause errors so we should check for them.
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glClear.xml
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glDrawArrays.xml

PiperOrigin-RevId: 437218519
2022-03-25 14:07:49 +00:00
ibaker
be4cbb886b Stabilise DefaultDataSource.Factory, including 2 constructors
This allows apps to customise the HTTP DataSource while still supporting
non-HTTP URIs as well, as documented in our dev guide:
https://exoplayer.dev/network-stacks.html#configuring-exoplayer-to-use-a-specific-network-stack

PiperOrigin-RevId: 437209880
2022-03-25 14:06:58 +00:00
andrewlewis
c87d16ca63 Handle non-standard MIME type on LG AC3 decoder
PiperOrigin-RevId: 437057336
2022-03-25 14:06:06 +00:00
andrewlewis
117456c137 Improve throughput on devices requiring workaround
On some devices, decoding gets stuck when the number of frames pending at the
`SurfaceTexture` is too high. We added a workaround that only allows one frame
to be pending at a time. That fixed the issue, however, based on on-device
testing it seems that it's safe to queue more than one frame.

Add a method that returns a safe estimate of the number of frames that can be
pending at a time, and use this to limit the number of frames that can be
released from the decoder but not processed by the frame processor chain.

PiperOrigin-RevId: 437057075
2022-03-25 14:05:08 +00:00
hschlueter
37559deacf Configure the frame sizes in FrameProcessorChain instead of caller.
Configuring the frame sizes between frame processors is now the
FrameProcessorChain's rather than the caller's responsibility.
The caller can getOutputSize() and override it for encoder fallback
in configure().

PiperOrigin-RevId: 437048436
2022-03-25 14:04:19 +00:00
hschlueter
20daaa20ef Move OpenGL setup to FrameProcessorChain#configure().
The factory method is replaced by a public constructor and
configure() method which configures the input/output surfaces
and handles the OpenGL setup.

This is a prerequisite for removing the responsibility of the
caller to configureSizes() before creating the chain in a follow-up.

PiperOrigin-RevId: 437028882
2022-03-25 14:03:17 +00:00
ibaker
da3cb63c5e Remove exo_legacy_player_view.xml from media3
This is only used by LegacyPlayerView which was removed in
6aa1816bd3

PiperOrigin-RevId: 437018966
2022-03-24 16:54:31 +00:00
ibaker
e18dfd4488 Tolerate the result of View.getLayoutParams being null
PiperOrigin-RevId: 437017422
2022-03-24 16:47:44 +00:00
ibaker
90d1c6fc33 Tolerate the result of View.getLayoutParams being null
PiperOrigin-RevId: 437017422
2022-03-24 16:47:44 +00:00
ibaker
84eaa5801a Switch the main demo app to use Guava's Preconditions
ExoPlayer's internal Assertions class will not be part of the stable
API.

PiperOrigin-RevId: 437008634
2022-03-24 16:07:42 +00:00
ibaker
a11adbc08c Switch the main demo app to use Guava's Preconditions
ExoPlayer's internal Assertions class will not be part of the stable
API.

PiperOrigin-RevId: 437008634
2022-03-24 16:07:42 +00:00
huangdarwin
40c8dae55b Transformer: Always use FrameProcessorChain when decoding.
This allows us to bypass many device-specific issues, that only occur when
decoding directly to an encoder surface, without OpenGL. This also allows us
to maintain fewer code branches, which require additional testing to verify
correctness.

PiperOrigin-RevId: 437003138
2022-03-24 15:42:12 +00:00
huangdarwin
2a363ac3fc Transformer: Always use FrameProcessorChain when decoding.
This allows us to bypass many device-specific issues, that only occur when
decoding directly to an encoder surface, without OpenGL. This also allows us
to maintain fewer code branches, which require additional testing to verify
correctness.

PiperOrigin-RevId: 437003138
2022-03-24 15:42:12 +00:00
aquilescanta
ce67fa92dc Simplify nullability in Mp4Extractor
PiperOrigin-RevId: 437002406
2022-03-24 15:38:20 +00:00
aquilescanta
e8b0971f12 Simplify nullability in Mp4Extractor
PiperOrigin-RevId: 437002406
2022-03-24 15:38:20 +00:00
ibaker
5b08df001a Remove references to deprecated DefaultDataSourceFactory from dev guide
#minor-release

PiperOrigin-RevId: 436997521
2022-03-24 15:13:09 +00:00
ibaker
c83a28f260 Remove references to deprecated DefaultDataSourceFactory from dev guide
#minor-release

PiperOrigin-RevId: 436997521
2022-03-24 15:13:09 +00:00
aquilescanta
2d025a2797 Add maxNumRefFrames to NalUnitUtil
Needed for AVI support.

PiperOrigin-RevId: 436991922
2022-03-24 14:41:28 +00:00
aquilescanta
7db0d91dd9 Add maxNumRefFrames to NalUnitUtil
Needed for AVI support.

PiperOrigin-RevId: 436991922
2022-03-24 14:41:28 +00:00
huangdarwin
22830dcdd0 FrameProcessor: Create PresentationFrameProcessor.
Allow apps to modify how frames are presented, via modifying resolution.

A follow-up CL will provide aspect ratio, cropping, etc.

PiperOrigin-RevId: 436963312
2022-03-24 11:42:05 +00:00
huangdarwin
5bc94da16a FrameProcessor: Create PresentationFrameProcessor.
Allow apps to modify how frames are presented, via modifying resolution.

A follow-up CL will provide aspect ratio, cropping, etc.

PiperOrigin-RevId: 436963312
2022-03-24 11:42:05 +00:00
hschlueter
5afd6af2c4 Increase test frame processing wait time.
PiperOrigin-RevId: 436961627
2022-03-24 11:29:52 +00:00
hschlueter
c5e8503e2c Increase test frame processing wait time.
PiperOrigin-RevId: 436961627
2022-03-24 11:29:52 +00:00
olly
e2e3474bae Suppress new nullness warnings when stub for View.getLayoutParams is added.
I am suppressing these warnings so that the stub file can be added and future usages will be checked correctly. As noted in https://developer.android.com/reference/android/view/View#getLayoutParams() this can be null before params are set. This was produced by running the TGP on <unknown commit>.

More information: go/new-nullness-stubs-lsc

Tested:
    Automated deflaking failed to skip failures:  http://mondo/deflaker/run/ff55923b-d76d-4eba-86dc-1b3077362352
    http://test/OCL:435678706:BASE:436509228:1647985874385:4fae6f0a
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 436951684
2022-03-24 10:15:13 +00:00
olly
ea2fbfd0a1 Suppress new nullness warnings when stub for View.getLayoutParams is added.
I am suppressing these warnings so that the stub file can be added and future usages will be checked correctly. As noted in https://developer.android.com/reference/android/view/View#getLayoutParams() this can be null before params are set. This was produced by running the TGP on <unknown commit>.

More information: go/new-nullness-stubs-lsc

Tested:
    Automated deflaking failed to skip failures:  http://mondo/deflaker/run/ff55923b-d76d-4eba-86dc-1b3077362352
    http://test/OCL:435678706:BASE:436509228:1647985874385:4fae6f0a
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 436951684
2022-03-24 10:15:13 +00:00
olly
8f63529424 Fix 11 ErrorProneStyle findings:
* These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
  (see http://go/bugpattern/UnnecessaryParentheses) (11 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 436726763
2022-03-23 13:55:36 +00:00
olly
76928738f3 Fix 11 ErrorProneStyle findings:
* These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
  (see http://go/bugpattern/UnnecessaryParentheses) (11 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 436726763
2022-03-23 13:55:36 +00:00
hschlueter
91bef31e6e Add javadoc for more FrameProcessorChain fields.
PiperOrigin-RevId: 436723149
2022-03-23 13:36:22 +00:00