Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MythVideoOutputGPU: Improve handling of video stream changes #260

@mark-kendall

Description

@mark-kendall

Video stream changes are signalled from the decoder thread and if the change is anything other than an aspect ratio, then we reset the video buffers and set various parameters to be checked before the next frame is displayed.

This has various problems:

  • video playback is behind the decoder - so we lose a number of decoded frames
  • the playback side (in the main thread) needs to be made aware that a change is due - which is not necessarily straightforward when multiple changes occur in quick succession

So:

  • track last state and trigger a change in output when the latest frame for display is received (as is done in MythOpenGLVideo)
  • for software decoding (both before AND after stream change), just allow the code to play through if it does not involve a change in the number of frames in the buffers. The decoder will re-allocated the software frame as it is queued.
  • the same approach may work for some hardware decoders - but definitely not for VAAPI (which requires a fixed number of frames to be allocated with the decoder)

Bonus points:

  • allow the number of video buffers to change dynamically - so if the new stream requires fewer buffers, just mark the extras as 'ready for disposal' and delete when they have been released back to the available queue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions