Closed Bug 1308405 Opened 8 years ago Closed 5 years ago

Reduce the number of Java objects created for out-of-process decoders.

Categories

(Core :: Audio/Video: Playback, defect, P3)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: jhlin, Assigned: jhlin)

References

Details

(Whiteboard: [gvtv:p1])

Attachments

(5 files)

Currently we pass |Sample| object in some |ICodec| and |ICodecCallback| methods and huge amount of short lived objects are generated by AIDL generated code, therefore more GC.
The idea is to add |get(Input|Output)Buffer(int index)| methods and pass only index in |*Buffer()| methods, and a list of |Sample| objects can by maintained in |CodecProxy|.

Fixing this could be very helpful to reduce the frames dropped on Fire TV Cube. See bug 1529486 comment 15.

Blocks: 1529486
Whiteboard: [gvtv]
Whiteboard: [gvtv] → [gvtv:p1]

John Lin is working on a patch for this

Assignee: nobody → jolin
Summary: Reduce the number of sample objects created for out-of-process decoders. → Reduce the number of Java objects created for out-of-process decoders.

To prevent new buffer object from being created per frame, either
Sample.CREATOR has to keep track of all buffers from every remote codec,
or the client must memorize seen buffers and avoid asking for them again
and again. The former saves client code from modifications but complicates
the implementation of Sample, a data structure class, while the latter
requires changes to client code but avoid overcomplicating Sample.CREATOR
implementation.

The 2nd approach is taken:

  • move SampleBuffer out of Sample, and update clients accordingly
  • add a new IPC method for clients to get the buffers only when needed

Depends on D24589

Attachment #9053024 - Attachment description: Bug 1308405 - p4: Separate buffer from sample object. r?snorp! → Bug 1308405 - p4: Separate buffer from sample object. r?jya!,snorp!
Pushed by jolin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dbb7c0704a08
p1: Recycle input buffer info. r=jya
https://hg.mozilla.org/integration/autoland/rev/9a095e082820
p2: Nodify and recycle sample objects. r=snorp
https://hg.mozilla.org/integration/autoland/rev/e9985b6b2769
p3: Use sample buffer class directly. r=snorp
https://hg.mozilla.org/integration/autoland/rev/f3367091fba8
p4: Separate buffer from sample object. r=snorp
https://hg.mozilla.org/integration/autoland/rev/78909d4b2ed3
p5: Memorize sample buffers in CodecProxy. r=snorp
Depends on: 1540041
Depends on: 1540542

67=fix-optional. Neither Fenix MVP nor Firefox for Fire TV will use GeckoView 67, so we don't need to uplift this fix to 67 Beta unless you want it in Fennec 67.

Regressions: 1540036
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: