Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • VLC VLC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,722
    • Issues 3,722
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 227
    • Merge requests 227
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLANVideoLAN
  • VLCVLC
  • Issues
  • #26183
Closed
Open
Issue created Oct 14, 2021 by Alexandre Janniaux@alexandre-janniauxDeveloper

Refactor the src/video_output/video_output.c code as a state machine

Hi,

A while ago, @rom1v suggested to reimplement the vout_thread code as a command queue. After discussion, what was really meant is more about a state machine.

The current code is indeed not far away from a state machine, but the state representation is not based on only one state variable, making it really hard to reason with.

What we got in the end looks like the following diagram. What's interesting here is that the interruption feature showcased in !324 (though, as I mentioned, it doesn't fix the starvation itself so the name is confusing) becomes really easy to implement at the interruption call site as a state transition back to the idle state, instead of checking the interruption state at the beginning of each state transition like in the merge request. It also makes it really easy to understand the behaviour of the vout thread, and even more importantly, to actually test the behaivour of the vout thread.

I don't know how much @rom1v has started the rework so I'm assigning him.

Vlc_vout_state_machine_-_page_1.svg

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking

VideoLAN code repository instance