Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c142
1 files changed, 1 insertions, 141 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 747ce18cada..0908fb7eeb8 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -68,7 +68,7 @@
#include "BKE_fcurve.h"
#include "BKE_scene.h"
#include "BKE_mask.h"
-#include "BKE_library.h"
+#include "BKE_lib_id.h"
#include "BKE_idprop.h"
#include "DEG_depsgraph.h"
@@ -4147,146 +4147,6 @@ ImBuf *BKE_sequencer_give_ibuf_direct(const SeqRenderData *context, float cfra,
return ibuf;
}
-/* *********************** threading api ******************* */
-
-static ListBase running_threads;
-static ListBase prefetch_wait;
-static ListBase prefetch_done;
-
-static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t wakeup_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER;
-
-// static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER;
-// static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER;
-
-static pthread_mutex_t frame_done_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER;
-
-static volatile bool seq_thread_shutdown = true;
-static volatile int seq_last_given_monoton_cfra = 0;
-static int monoton_cfra = 0;
-
-typedef struct PrefetchThread {
- struct PrefetchThread *next, *prev;
-
- Scene *scene;
- struct PrefetchQueueElem *current;
- pthread_t pthread;
- int running;
-
-} PrefetchThread;
-
-typedef struct PrefetchQueueElem {
- struct PrefetchQueueElem *next, *prev;
-
- int rectx;
- int recty;
- float cfra;
- int chanshown;
- int preview_render_size;
-
- int monoton_cfra;
-
- ImBuf *ibuf;
-} PrefetchQueueElem;
-
-void BKE_sequencer_give_ibuf_prefetch_request(const SeqRenderData *context,
- float cfra,
- int chanshown)
-{
- PrefetchQueueElem *e;
- if (seq_thread_shutdown) {
- return;
- }
-
- e = MEM_callocN(sizeof(PrefetchQueueElem), "prefetch_queue_elem");
- e->rectx = context->rectx;
- e->recty = context->recty;
- e->cfra = cfra;
- e->chanshown = chanshown;
- e->preview_render_size = context->preview_render_size;
- e->monoton_cfra = monoton_cfra++;
-
- pthread_mutex_lock(&queue_lock);
- BLI_addtail(&prefetch_wait, e);
- pthread_mutex_unlock(&queue_lock);
-
- pthread_mutex_lock(&wakeup_lock);
- pthread_cond_signal(&wakeup_cond);
- pthread_mutex_unlock(&wakeup_lock);
-}
-
-ImBuf *BKE_sequencer_give_ibuf_threaded(const SeqRenderData *context, float cfra, int chanshown)
-{
- PrefetchQueueElem *e = NULL;
- bool found_something = false;
-
- if (seq_thread_shutdown) {
- return BKE_sequencer_give_ibuf(context, cfra, chanshown);
- }
-
- while (!e) {
- bool success = false;
- pthread_mutex_lock(&queue_lock);
-
- for (e = prefetch_done.first; e; e = e->next) {
- if (cfra == e->cfra && chanshown == e->chanshown && context->rectx == e->rectx &&
- context->recty == e->recty && context->preview_render_size == e->preview_render_size) {
- success = true;
- found_something = true;
- break;
- }
- }
-
- if (!e) {
- for (e = prefetch_wait.first; e; e = e->next) {
- if (cfra == e->cfra && chanshown == e->chanshown && context->rectx == e->rectx &&
- context->recty == e->recty && context->preview_render_size == e->preview_render_size) {
- found_something = true;
- break;
- }
- }
- }
-
- if (!e) {
- PrefetchThread *tslot;
-
- for (tslot = running_threads.first; tslot; tslot = tslot->next) {
- if (tslot->current && cfra == tslot->current->cfra &&
- chanshown == tslot->current->chanshown && context->rectx == tslot->current->rectx &&
- context->recty == tslot->current->recty &&
- context->preview_render_size == tslot->current->preview_render_size) {
- found_something = true;
- break;
- }
- }
- }
-
- /* e->ibuf is unrefed by render thread on next round. */
-
- if (e) {
- seq_last_given_monoton_cfra = e->monoton_cfra;
- }
-
- pthread_mutex_unlock(&queue_lock);
-
- if (!success) {
- e = NULL;
-
- if (!found_something) {
- fprintf(stderr, "SEQ-THREAD: Requested frame not in queue ???\n");
- break;
- }
- pthread_mutex_lock(&frame_done_lock);
- pthread_cond_wait(&frame_done_cond, &frame_done_lock);
- pthread_mutex_unlock(&frame_done_lock);
- }
- }
-
- return e ? e->ibuf : NULL;
-}
-
/* check whether sequence cur depends on seq */
bool BKE_sequence_check_depend(Sequence *seq, Sequence *cur)
{