Skip to content

Missed order of NALUnit. #2

@awen190418

Description

@awen190418

At

self.delegate?.didReceiveNALUnit(nalu)

we are releasing Single NAL Unit before releasing the accumulated FU Fragments. Lets consider following example:

Let us consider the following NAL fragments. A integer in the first box means a id and other other box contains the type of NAL Unit. -> refers to the next NALUnit that was received.

| 22 |FU Unit........ | -> | 23 |FU Unit .......... | -> | 24 |FU Unit .......... | -> | 25 | Single NAL Unit .......... | ->| 26 |FU Unit .......... | -> | 27 |FU Unit .......... | ......

In above NALUnit fragments from 22 to 24 will be in a buffer. Then fragment with id 25 arrives but it gets released before releasing the previous NALUnits. I guess this causes some more scratches in the decoded video.

Therefore, How about releasing the previous buffer before releasing the single unit to decoder ?
How about adding

if fragment.isEndUnit{
           didAssembleFU(&fragmentedNALU!)//Send the portion of data that we have collected so far in the past.
           fragmentedNALU = nil
       }

at

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions