Repository navigation
feat(dovi): the output route takes the player's own frame format and converts it for the composer - #972
Draft
pkajaba wants to merge 19 commits into
Draft
feat(dovi): the output route takes the player's own frame format and converts it for the composer#972pkajaba wants to merge 19 commits into
pkajaba wants to merge 19 commits into
Conversation
…converts it to x420 for the composer The video output is created with no pixel buffer attributes, which keeps the system's decoder service from holding a second set of buffers (about 220 MB less in all on a 4K clip on the Mac, measured on an earlier base). A frame already in x420 goes on untouched; any other format is transferred into a small pool of x420 buffers with VTPixelTransferSession. A refused or failed conversion skips the frame and never hands unconverted data on, and a conversion that keeps failing hands the route back to AVPlayer. The converter is torn down on the route's teardown queue after the ticks (or the bounded wait for them), and a tick that outlasts the wait finds it closed. Measured on the Mac only, on one clip.
…tachments on the packed format The stop tests now hold a tick inside the composer's submit. The teardown must come after the decoder is closed, and a tick that outlasts the stop's bounded wait finds the converter closed and hands nothing on. The attachment test also runs on the packed 10-bit format the player hands out, where the system can make it.
…seek A pull tick between the resync and the clock jump set the wait at the old clock, so after a short forward seek the wait counted as already spent and the first frames at the new position went out as the base layer. A clock that moves more than 0.5 s between two pull ticks now clears the wait.
… was fed The packet check used the probe time, so the packet of a neighbouring frame could satisfy it and the composer received a frame before its own packet, which went out without its RPU. The check now repeats with the frame's own time after the frame is taken, and a frame without its packet goes out as the player's frame.
The enhancement layer can be fed far enough ahead that the decoder's queue cap prunes it at a seek landing; the comment said it never was.
The totals line goes out at most every 10 s and only when a count moved, so a bypass in the last seconds of a session was in no line. Closing the decoder now sends one more with the interval in progress folded in, if any count moved since the last.
The conversion paragraph compares the presented frames with the software host's composition of the same clip with the same frame-index rule, not with the x420 route (which differs on its 12 start-up frames), and names the seek-landing frame that can be the base layer. It also states the memory figures with what each measures, the wait and own-packet rules after a seek, the scope of the route's baseLayerOnly count and the final totals line. The figures are from an earlier base and say so.
…nd the documented wait bounds are pinned The test for the totals line sent when the decoder closes drove only a composed frame, so dropping the bypass counts from it passed. It now releases one frame by its deadline before the close and expects the line to carry it. The documentation test also pins the 0.5 s clock jump and the 0.1 s wait for a late packet that the conversion section quotes.
…d the pruned landing frame is not only at one landing The seventh seek of the eight-seek pattern runs past the end and the eighth logs a landing with the clock unmoved, so six seeks landed. The decoder's bypass of a pruned frame also showed at other landings in short, forward and mixed seek runs, one frame each.
Main's in-place default, the summary logged in stop() and the memory table are kept; the conversion's teardown goes after the ticks on the teardown queue, and the converted frames compose in place.
…lows the frame rate, and a composer stall hands the route back The route's summary, logged on main from stop(), read the converter's counters under the lock that is held across the pixel transfer and the wait for a pool buffer; they now sit under a lock of their own, so a transfer in progress cannot hold main. The pool limit was 6 for every stream; it is now the frames taken ahead of the clock, the two the display holds, the compositions in flight and a spare (9 at 24 fps, 14 at 60), and the first refusal of a run is logged. The route tells its owner once when the decoder can produce no video (the composer stalled for good, or the primary open failed), and the engine hands the picture back to AVPlayer.
…s frames, and each memory figure names its base
…t in the hand-back test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #967, on top of the in-place default.
The AVPlayer-output route no longer asks the video output for
x420. That request makes the system's decoder service keep a second, much larger set of buffers for the player; asking for no format drops the service from 703 to 432 MB in the docs table, but the composer could not take that output. This change makes it usable. The output is created without attributes and the player hands out its own format. A frame already inx420goes to the composer untouched; any other format goes through aVTPixelTransferSessioninto a pool ofx420buffers sized from the frame rate (0.15 s lead, the frame on screen, the one the layer retains, 2 in flight, a spare: 9 at 24 fps, 10 at 30, 14 at 60), with the colour attachments copied across. That buffer is the in-place compose target. A frame whose conversion is refused is skipped, counted and logged once per run. One whose conversion fails is skipped and never composed unconverted, and a conversion that keeps failing (0.75 s) hands the picture back to AVPlayer. The converter's counters have their own lock, so thestop()summary never waits on a transfer. A composer stall on this route now hands the picture back to AVPlayer as well.It also carries three small fixes found while testing the route:
Does not address: the 13.5% frame drops, the
-11868error, AirPlay, the teardown-queue timing, and the picture check and footprint on the Apple TV.Tested on Mac
One 4K 23.976 fps clip, one Mac, macOS only. Debug build for the picture checks, release for memory.
build-for-testingpass on CI.Still needs Apple TV
x420or another format; the first frame's format is logged. If it isx420, nothing is converted and the composer writes in place into the player's own buffer. That path was not exercised (passedThrough=0in all runs), so compare withAETHER_FEL_OUTPUT_INPLACE=0.conversionRefusedin the numbers. A slower layer release on the device could skip a frame at a landing or at start-up: counted, logged, self-healing.