Skip to content
Snippets Groups Projects

mediacodec: change missing PTS handling

Open Thomas Guillem requested to merge tguillem/vlc:mediacodec-timestamp-fifo into master
1 unresolved thread

cf. !7086

This will allow a more robust approach to pass PTS, compatible with silents frame drops from MediaCodec.

Merge request reports

Members who can merge are allowed to add commits.

Merge request pipeline #580281 passed

Merge request pipeline passed for 062ca2d9

Test coverage 17.94% (0.06%) from 1 job
Ready to merge by members who can write to the target branch.

Merge details

  • The source branch is 181 commits behind the target branch.
  • 0 commits and 1 merge commit will be added to .
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1804 p_block->i_pts = p_block->i_dts;
1805 goto nopts;
1806 }
1807
1808 p_block->i_pts = date_Get(&p_sys->video.pts);
1809
1810 if (p_block->i_pts == VLC_TICK_INVALID)
1811 {
1812 date_Set(&p_sys->video.pts, p_block->i_dts);
1813 p_block->i_pts = p_block->i_dts;
1814 }
1815
1816 if (p_block->i_pts == VLC_TICK_INVALID)
1817 goto nopts;
1805 1818
1819 date_Increment(&p_sys->video.pts, 1);
  • Comment on lines +1802 to +1819

    Not sure I understand, how does it handle the PTS reordering here without more packetizer infos?

    Edited by Alexandre Janniaux
  • Author Maintainer

    MediaCodec reorder the frames internally. But it may drop the output presentationTs if invalid or decreasing.

    If we don't have a PTS, I assume we can start from the first DTS and increment the date ourselves.

  • I mean, if you have IBBP scheme, the decoder will receive IPBB, and P will have a dts, but its dts will be 2/3 frame-equivalent lower than the actual pts, which I guess might trigger mediacodec behaviour on

    MediaCodec reorder the frames internally. But it may drop the output presentationTs if invalid or decreasing.

    My point is that for

    If we don't have a PTS, I assume we can start from the first DTS and increment the date ourselves.

    We need to have the proper order of the frame to know which generated pts to assign, otherwise we would reverse things. Or else the MR really lacks information on when the pts is not filled up.

  • Please register or sign in to reply
  • Please register or sign in to reply
    Loading