VSE: Process audio strips waveforms in parallel #108877

Merged
Richard Antalik merged 13 commits from Yup_Lucas/blender:Yup_Lucas/vse-waveform-task-pool into main 2023-07-13 03:22:58 +02:00

13 Commits

Author SHA1 Message Date
Lucas Tadeu Teixeira 1e939ce0e8 Merge remote-tracking branch 'origin/main' into Yup_Lucas/vse-waveform-task-pool 2023-07-11 07:53:51 +01:00
Lucas Tadeu Teixeira 4c7cef4eee Lock the preview job whenever a sound is added 2023-07-11 07:51:23 +01:00
Lucas Tadeu Teixeira 2b431fb401 Merge remote-tracking branch 'origin/main' into Yup_Lucas/vse-waveform-task-pool 2023-07-10 11:44:05 +01:00
Lucas Tadeu Teixeira 631c8681b1 Remove previewjb 2023-07-10 11:43:44 +01:00
Lucas Tadeu Teixeira 28fde330d6 Remove comment 2023-07-04 13:33:57 +01:00
Lucas Tadeu Teixeira 76d67e5a6a Apply requested changes 2023-07-04 13:32:05 +01:00
Lucas Tadeu Teixeira 1d93e647f9 Merge branch 'main' into Yup_Lucas/vse-waveform-task-pool 2023-07-04 11:11:21 +01:00
Lucas Tadeu Teixeira ddb36604b5 Run clang-format on sequencer_preview.c 2023-07-04 11:06:09 +01:00
Lucas Tadeu Teixeira e926125a69 Mark job as running by default and move comment around
buildbot/vexp-code-patch-coordinator Build done. Details
2023-06-26 08:49:30 +01:00
Lucas Tadeu Teixeira ac75e6b553 Make sequencer_preview_add_sound retry if the PreviewJob is terminating
If a sound is added to the queue when the preview job is done processing
its current list of sounds, a leak could happen: The new sound gets
added to the queue but the job never actually processes it.

This change follows @iss's suggestion of using the WM_event_add_notifier
function to force a redraw when that is that case.

If the PreviewJob is terminating (running = false):
- First clear the sound's loading tag: Without this, the code in
  sequencer_draw.c will not be able to push the sound for processing in
  the second pass.
- Add the event notifier for the current scene.
2023-06-26 08:38:01 +01:00
Lucas Tadeu Teixeira a1f9cf4f4f Fix condition variable wait loop 2023-06-19 14:17:05 +01:00
Lucas Tadeu Teixeira 21969220fa WIP: Add cond variable 2023-06-16 15:58:34 +01:00
Lucas Tadeu Teixeira 435111f788 VSE: Process audio strips waveforms in parallel
A TaskPool is used to execute tasks in the backghround.

Whenever a new audio strip needs their waveform to be computed, it's
added as a task to the TaskPool.

Once the PreviewJob has submitted all available tasks to the task pool,
it waits for all of them to finish before exiting.

The TaskPool is configured to start tasks as soon as they are pushed
onto the task queue.
2023-06-12 08:39:06 +01:00