Blender V4.3
strip_add.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2003-2009 Blender Authors
3 * SPDX-FileCopyrightText: 2005-2006 Peter Schlaile <peter [at] schlaile [dot] de>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later */
6
11#include <algorithm>
12#include <cmath>
13#include <cstring>
14
15#include "MEM_guardedalloc.h"
16
17#include "DNA_mask_types.h"
18#include "DNA_scene_types.h"
19#include "DNA_sequence_types.h"
20#include "DNA_sound_types.h"
21
22#include "BLI_listbase.h"
23#include "BLI_path_utils.hh"
24#include "BLI_string.h"
25
26#include "BKE_image.hh"
27#include "BKE_lib_id.hh"
28#include "BKE_main.hh"
29#include "BKE_mask.h"
30#include "BKE_movieclip.h"
31#include "BKE_scene.hh"
32#include "BKE_sound.h"
33
35
37#include "IMB_imbuf.hh"
38#include "IMB_imbuf_types.hh"
39#include "IMB_metadata.hh"
40
41#include "SEQ_add.hh"
42#include "SEQ_edit.hh"
43#include "SEQ_effects.hh"
44#include "SEQ_relations.hh"
45#include "SEQ_render.hh"
46#include "SEQ_sequencer.hh"
47#include "SEQ_time.hh"
48#include "SEQ_transform.hh"
49#include "SEQ_utils.hh"
50
51#include "multiview.hh"
52#include "proxy.hh"
53#include "sequencer.hh"
54#include "strip_time.hh"
55
57 const char *name,
58 const char *path,
59 const int start_frame,
60 const int channel)
61{
62 memset(load_data, 0, sizeof(SeqLoadData));
63 if (name != nullptr) {
64 STRNCPY(load_data->name, name);
65 }
66 if (path != nullptr) {
67 STRNCPY(load_data->path, path);
68 }
69 load_data->start_frame = start_frame;
70 load_data->channel = channel;
71}
72
81
82static void seq_add_set_name(Scene *scene, Sequence *seq, SeqLoadData *load_data)
83{
84 if (load_data->name[0] != '\0') {
85 SEQ_edit_sequence_name_set(scene, seq, load_data->name);
86 }
87 else {
88 if (seq->type == SEQ_TYPE_SCENE) {
89 SEQ_edit_sequence_name_set(scene, seq, load_data->scene->id.name + 2);
90 }
91 else if (seq->type == SEQ_TYPE_MOVIECLIP) {
92 SEQ_edit_sequence_name_set(scene, seq, load_data->clip->id.name + 2);
93 }
94 else if (seq->type == SEQ_TYPE_MASK) {
95 SEQ_edit_sequence_name_set(scene, seq, load_data->mask->id.name + 2);
96 }
97 else if ((seq->type & SEQ_TYPE_EFFECT) != 0) {
99 }
100 else { /* Image, sound and movie. */
101 SEQ_edit_sequence_name_set(scene, seq, load_data->name);
102 }
103 }
104}
105
106static void seq_add_set_view_transform(Scene *scene, Sequence *seq, SeqLoadData *load_data)
107{
108 const char *strip_colorspace = seq->strip->colorspace_settings.name;
109
110 if (load_data->flags & SEQ_LOAD_SET_VIEW_TRANSFORM) {
111 const char *role_colorspace_byte;
113
114 if (STREQ(strip_colorspace, role_colorspace_byte)) {
116 scene->display_settings.display_device);
117 const char *default_view_transform =
119 STRNCPY(scene->view_settings.view_transform, default_view_transform);
120 }
121 }
122}
123
125{
127 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_SCENE);
128 seq->scene = load_data->scene;
129 seq->len = load_data->scene->r.efra - load_data->scene->r.sfra + 1;
130 id_us_ensure_real((ID *)load_data->scene);
131 seq_add_set_name(scene, seq, load_data);
132 seq_add_generic_update(scene, seq);
133 return seq;
134}
135
137{
139 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_MOVIECLIP);
140 seq->clip = load_data->clip;
141 seq->len = BKE_movieclip_get_duration(load_data->clip);
142 id_us_ensure_real((ID *)load_data->clip);
143 seq_add_set_name(scene, seq, load_data);
144 seq_add_generic_update(scene, seq);
145 return seq;
146}
147
149{
151 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_MASK);
152 seq->mask = load_data->mask;
153 seq->len = BKE_mask_get_duration(load_data->mask);
154 id_us_ensure_real((ID *)load_data->mask);
155 seq_add_set_name(scene, seq, load_data);
156 seq_add_generic_update(scene, seq);
157 return seq;
158}
159
161{
163 seqbase, load_data->start_frame, load_data->channel, load_data->effect.type);
164
167 sh.init(seq);
168 seq->seq1 = load_data->effect.seq1;
169 seq->seq2 = load_data->effect.seq2;
170
171 if (SEQ_effect_get_num_inputs(seq->type) == 1) {
172 seq->blend_mode = seq->seq1->blend_mode;
173 seq->blend_opacity = seq->seq1->blend_opacity;
174 }
175
176 if (!load_data->effect.seq1) {
177 seq->len = 1; /* Effect is generator, set non zero length. */
179 SEQ_time_right_handle_frame_set(scene, seq, load_data->effect.end_frame);
180 }
181
182 seq_add_set_name(scene, seq, load_data);
183 seq_add_generic_update(scene, seq);
184
185 return seq;
186}
187
188void SEQ_add_image_set_directory(Sequence *seq, const char *dirpath)
189{
190 STRNCPY(seq->strip->dirpath, dirpath);
191}
192
193void SEQ_add_image_load_file(Scene *scene, Sequence *seq, size_t strip_frame, const char *filename)
194{
196 scene, seq, SEQ_time_start_frame_get(seq) + strip_frame);
197 STRNCPY(se->filename, filename);
198}
199
201{
202 if (seq->strip && seq->strip->stripdata) {
203 char filepath[FILE_MAX];
204 ImBuf *ibuf;
205
207 filepath, sizeof(filepath), seq->strip->dirpath, seq->strip->stripdata->filename);
209
210 /* Initialize input color space. */
211 if (seq->type == SEQ_TYPE_IMAGE) {
212 ibuf = IMB_loadiffname(
214
215 /* Byte images are default to straight alpha, however sequencer
216 * works in premul space, so mark strip to be premultiplied first.
217 */
219 if (ibuf) {
220 if (ibuf->flags & IB_alphamode_premul) {
222 }
223
224 IMB_freeImBuf(ibuf);
225 }
226 }
227 }
228}
229
230Sequence *SEQ_add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
231{
233 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_IMAGE);
234 seq->len = load_data->image.len;
235 Strip *strip = seq->strip;
236 strip->stripdata = static_cast<StripElem *>(
237 MEM_callocN(load_data->image.len * sizeof(StripElem), "stripelem"));
238
239 if (seq->len == 1) {
241 }
242
243 /* Multiview settings. */
244 if (load_data->use_multiview) {
245 seq->flag |= SEQ_USE_VIEWS;
246 seq->views_format = load_data->views_format;
247 }
248 if (load_data->stereo3d_format) {
249 seq->stereo3d_format = load_data->stereo3d_format;
250 }
251
252 /* Set initial scale based on load_data->fit_method. */
253 char file_path[FILE_MAX];
254 STRNCPY(file_path, load_data->path);
255 BLI_path_abs(file_path, BKE_main_blendfile_path(bmain));
256 ImBuf *ibuf = IMB_loadiffname(file_path, IB_rect, seq->strip->colorspace_settings.name);
257 if (ibuf != nullptr) {
258 /* Set image resolution. Assume that all images in sequence are same size. This fields are only
259 * informative. */
260 StripElem *strip_elem = strip->stripdata;
261 for (int i = 0; i < load_data->image.len; i++) {
262 strip_elem->orig_width = ibuf->x;
263 strip_elem->orig_height = ibuf->y;
264 strip_elem++;
265 }
266
268 seq, ibuf->x, ibuf->y, scene->r.xsch, scene->r.ysch, load_data->fit_method);
269 IMB_freeImBuf(ibuf);
270 }
271
272 /* Set Last active directory. */
273 STRNCPY(scene->ed->act_imagedir, seq->strip->dirpath);
274 seq_add_set_view_transform(scene, seq, load_data);
275 seq_add_set_name(scene, seq, load_data);
276 seq_add_generic_update(scene, seq);
277
278 return seq;
279}
280
281#ifdef WITH_AUDASPACE
282
283void SEQ_add_sound_av_sync(Main *bmain, Scene *scene, Sequence *seq, SeqLoadData *load_data)
284{
285 SoundStreamInfo sound_stream;
286 if (!BKE_sound_stream_info_get(bmain, load_data->path, 0, &sound_stream)) {
287 return;
288 }
289
290 const double av_stream_offset = sound_stream.start - load_data->r_video_stream_start;
291 const int frame_offset = av_stream_offset * FPS;
292 /* Set sub-frame offset. */
293 seq->sound->offset_time = (double(frame_offset) / FPS) - av_stream_offset;
294 SEQ_transform_translate_sequence(scene, seq, frame_offset);
295}
296
297Sequence *SEQ_add_sound_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
298{
299 bSound *sound = BKE_sound_new_file(bmain, load_data->path); /* Handles relative paths. */
300 SoundInfo info;
301 bool sound_loaded = BKE_sound_info_get(bmain, sound, &info);
302
303 if (!sound_loaded && !load_data->allow_invalid_file) {
304 BKE_id_free(bmain, sound);
305 return nullptr;
306 }
307
308 if (info.specs.channels == SOUND_CHANNELS_INVALID && !load_data->allow_invalid_file) {
309 BKE_id_free(bmain, sound);
310 return nullptr;
311 }
312
314 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_SOUND_RAM);
315 seq->sound = sound;
316 seq->scene_sound = nullptr;
317
318 /* We round the frame duration as the audio sample lengths usually does not
319 * line up with the video frames. Therefore we round this number to the
320 * nearest frame as the audio track usually overshoots or undershoots the
321 * end frame of the video by a little bit.
322 * See #47135 for under shoot example. */
323 seq->len = std::max(1, int(round((info.length - sound->offset_time) * FPS)));
324
325 Strip *strip = seq->strip;
326 /* We only need 1 element to store the filename. */
327 StripElem *se = strip->stripdata = static_cast<StripElem *>(
328 MEM_callocN(sizeof(StripElem), "stripelem"));
330 load_data->path, strip->dirpath, sizeof(strip->dirpath), se->filename, sizeof(se->filename));
331
332 if (seq->sound != nullptr) {
333 if (load_data->flags & SEQ_LOAD_SOUND_MONO) {
335 }
336
337 if (load_data->flags & SEQ_LOAD_SOUND_CACHE) {
338 if (seq->sound) {
340 }
341 }
342
343 /* Turn on Display Waveform by default. */
345 }
346
347 /* Set Last active directory. */
348 BLI_strncpy(scene->ed->act_sounddir, strip->dirpath, FILE_MAXDIR);
349 seq_add_set_name(scene, seq, load_data);
350 seq_add_generic_update(scene, seq);
351
352 return seq;
353}
354
355#else // WITH_AUDASPACE
356
358 Scene * /*scene*/,
359 Sequence * /*seq*/,
360 SeqLoadData * /*load_data*/)
361{
362}
363
365 Scene * /*scene*/,
366 ListBase * /*seqbase*/,
367 SeqLoadData * /*load_data*/)
368{
369 return nullptr;
370}
371#endif // WITH_AUDASPACE
372
374{
375 /* Allocate sequence. */
377 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_META);
378
379 /* Set name. */
380 seq_add_set_name(scene, seqm, load_data);
381
382 /* Set frames start and length. */
383 seqm->start = load_data->start_frame;
384 seqm->len = 1;
385
386 seq_add_generic_update(scene, seqm);
387
388 return seqm;
389}
390
391Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
392{
393 char filepath[sizeof(load_data->path)];
394 STRNCPY(filepath, load_data->path);
395 BLI_path_abs(filepath, BKE_main_blendfile_path(bmain));
396
397 char colorspace[64] = "\0"; /* MAX_COLORSPACE_NAME */
398 bool is_multiview_loaded = false;
399 const int totfiles = seq_num_files(scene, load_data->views_format, load_data->use_multiview);
400 ImBufAnim **anim_arr = static_cast<ImBufAnim **>(
401 MEM_callocN(sizeof(ImBufAnim *) * totfiles, "Video files"));
402 int i;
403 int orig_width = 0;
404 int orig_height = 0;
405
406 if (load_data->use_multiview && (load_data->views_format == R_IMF_VIEWS_INDIVIDUAL)) {
407 char prefix[FILE_MAX];
408 const char *ext = nullptr;
409 size_t j = 0;
410
411 BKE_scene_multiview_view_prefix_get(scene, filepath, prefix, &ext);
412
413 if (prefix[0] != '\0') {
414 for (i = 0; i < totfiles; i++) {
415 char filepath_view[FILE_MAX];
416
417 seq_multiview_name(scene, i, prefix, ext, filepath_view, sizeof(filepath_view));
418 anim_arr[j] = openanim(filepath_view, IB_rect, 0, colorspace);
419
420 if (anim_arr[j]) {
421 seq_anim_add_suffix(scene, anim_arr[j], i);
422 j++;
423 }
424 }
425 is_multiview_loaded = true;
426 }
427 }
428
429 if (is_multiview_loaded == false) {
430 anim_arr[0] = openanim(filepath, IB_rect, 0, colorspace);
431 }
432
433 if (anim_arr[0] == nullptr && !load_data->allow_invalid_file) {
434 MEM_freeN(anim_arr);
435 return nullptr;
436 }
437
438 float video_fps = 0.0f;
439 load_data->r_video_stream_start = 0.0;
440
441 if (anim_arr[0] != nullptr) {
442 short fps_denom;
443 float fps_num;
444
445 IMB_anim_get_fps(anim_arr[0], true, &fps_denom, &fps_num);
446
447 video_fps = fps_denom / fps_num;
448
449 /* Adjust scene's frame rate settings to match. */
450 if (load_data->flags & SEQ_LOAD_MOVIE_SYNC_FPS) {
451 scene->r.frs_sec = fps_denom;
452 scene->r.frs_sec_base = fps_num;
454 }
455
456 load_data->r_video_stream_start = IMD_anim_get_offset(anim_arr[0]);
457 }
458
460 seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_MOVIE);
461
462 /* Multiview settings. */
463 if (load_data->use_multiview) {
464 seq->flag |= SEQ_USE_VIEWS;
465 seq->views_format = load_data->views_format;
466 }
467 if (load_data->stereo3d_format) {
468 seq->stereo3d_format = load_data->stereo3d_format;
469 }
470
471 for (i = 0; i < totfiles; i++) {
472 if (anim_arr[i]) {
473 StripAnim *sanim = static_cast<StripAnim *>(MEM_mallocN(sizeof(StripAnim), "Strip Anim"));
474 BLI_addtail(&seq->anims, sanim);
475 sanim->anim = anim_arr[i];
476 }
477 else {
478 break;
479 }
480 }
481
482 if (anim_arr[0] != nullptr) {
483 seq->len = IMB_anim_get_duration(anim_arr[0], IMB_TC_RECORD_RUN);
484
485 IMB_anim_load_metadata(anim_arr[0]);
486
487 /* Set initial scale based on load_data->fit_method. */
488 orig_width = IMB_anim_get_image_width(anim_arr[0]);
489 orig_height = IMB_anim_get_image_height(anim_arr[0]);
491 seq, orig_width, orig_height, scene->r.xsch, scene->r.ysch, load_data->fit_method);
492
493 short frs_sec;
494 float frs_sec_base;
495 if (IMB_anim_get_fps(anim_arr[0], true, &frs_sec, &frs_sec_base)) {
496 seq->media_playback_rate = float(frs_sec) / frs_sec_base;
497 }
498 }
499
500 seq->len = std::max(1, seq->len);
501 if (load_data->adjust_playback_rate) {
503 }
504
505 STRNCPY(seq->strip->colorspace_settings.name, colorspace);
506
507 Strip *strip = seq->strip;
508 /* We only need 1 element for MOVIE strips. */
509 StripElem *se;
510 strip->stripdata = se = static_cast<StripElem *>(MEM_callocN(sizeof(StripElem), "stripelem"));
511 strip->stripdata->orig_width = orig_width;
512 strip->stripdata->orig_height = orig_height;
513 strip->stripdata->orig_fps = video_fps;
515 load_data->path, strip->dirpath, sizeof(strip->dirpath), se->filename, sizeof(se->filename));
516
517 seq_add_set_view_transform(scene, seq, load_data);
518 seq_add_set_name(scene, seq, load_data);
519 seq_add_generic_update(scene, seq);
520
521 MEM_freeN(anim_arr);
522 return seq;
523}
524
525void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Sequence *seq, const bool lock_range)
526{
527 int prev_startdisp = 0, prev_enddisp = 0;
528 /* NOTE: don't rename the strip, will break animation curves. */
529
530 if (ELEM(seq->type,
537 SEQ_TYPE_MASK) == 0)
538 {
539 return;
540 }
541
542 if (lock_range) {
543 /* keep so we don't have to move the actual start and end points (only the data) */
544 prev_startdisp = SEQ_time_left_handle_frame_get(scene, seq);
545 prev_enddisp = SEQ_time_right_handle_frame_get(scene, seq);
546 }
547
548 switch (seq->type) {
549 case SEQ_TYPE_IMAGE: {
550 /* Hack? */
551 size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(StripElem);
552
553 seq->len = olen;
554 seq->len -= seq->anim_startofs;
555 seq->len -= seq->anim_endofs;
556 if (seq->len < 0) {
557 seq->len = 0;
558 }
559 break;
560 }
561 case SEQ_TYPE_MOVIE: {
562 char filepath[FILE_MAX];
563 StripAnim *sanim;
564 bool is_multiview_loaded = false;
565 const bool is_multiview = (seq->flag & SEQ_USE_VIEWS) != 0 &&
566 (scene->r.scemode & R_MULTIVIEW) != 0;
567
569 filepath, sizeof(filepath), seq->strip->dirpath, seq->strip->stripdata->filename);
571
573
574 if (is_multiview && (seq->views_format == R_IMF_VIEWS_INDIVIDUAL)) {
575 char prefix[FILE_MAX];
576 const char *ext = nullptr;
577 const int totfiles = seq_num_files(scene, seq->views_format, true);
578 int i = 0;
579
580 BKE_scene_multiview_view_prefix_get(scene, filepath, prefix, &ext);
581
582 if (prefix[0] != '\0') {
583 for (i = 0; i < totfiles; i++) {
584 ImBufAnim *anim;
585 char filepath_view[FILE_MAX];
586
587 seq_multiview_name(scene, i, prefix, ext, filepath_view, sizeof(filepath_view));
588 anim = openanim(filepath_view,
589 IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0),
590 seq->streamindex,
592
593 if (anim) {
594 seq_anim_add_suffix(scene, anim, i);
595 sanim = static_cast<StripAnim *>(MEM_mallocN(sizeof(StripAnim), "Strip Anim"));
596 BLI_addtail(&seq->anims, sanim);
597 sanim->anim = anim;
598 }
599 }
600 is_multiview_loaded = true;
601 }
602 }
603
604 if (is_multiview_loaded == false) {
605 ImBufAnim *anim;
606 anim = openanim(filepath,
607 IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0),
608 seq->streamindex,
610 if (anim) {
611 sanim = static_cast<StripAnim *>(MEM_mallocN(sizeof(StripAnim), "Strip Anim"));
612 BLI_addtail(&seq->anims, sanim);
613 sanim->anim = anim;
614 }
615 }
616
617 /* use the first video as reference for everything */
618 sanim = static_cast<StripAnim *>(seq->anims.first);
619
620 if ((!sanim) || (!sanim->anim)) {
621 return;
622 }
623
625
627 sanim->anim,
630
631 seq->len -= seq->anim_startofs;
632 seq->len -= seq->anim_endofs;
633 if (seq->len < 0) {
634 seq->len = 0;
635 }
636 break;
637 }
639 if (seq->clip == nullptr) {
640 return;
641 }
642
644
645 seq->len -= seq->anim_startofs;
646 seq->len -= seq->anim_endofs;
647 if (seq->len < 0) {
648 seq->len = 0;
649 }
650 break;
651 case SEQ_TYPE_MASK:
652 if (seq->mask == nullptr) {
653 return;
654 }
655 seq->len = BKE_mask_get_duration(seq->mask);
656 seq->len -= seq->anim_startofs;
657 seq->len -= seq->anim_endofs;
658 if (seq->len < 0) {
659 seq->len = 0;
660 }
661 break;
663#ifdef WITH_AUDASPACE
664 if (!seq->sound) {
665 return;
666 }
667 seq->len = ceil(double(BKE_sound_get_length(bmain, seq->sound)) * FPS);
668 seq->len -= seq->anim_startofs;
669 seq->len -= seq->anim_endofs;
670 if (seq->len < 0) {
671 seq->len = 0;
672 }
673#else
674 UNUSED_VARS(bmain);
675 return;
676#endif
677 break;
678 case SEQ_TYPE_SCENE: {
679 seq->len = (seq->scene) ? seq->scene->r.efra - seq->scene->r.sfra + 1 : 0;
680 seq->len -= seq->anim_startofs;
681 seq->len -= seq->anim_endofs;
682 if (seq->len < 0) {
683 seq->len = 0;
684 }
685 break;
686 }
687 }
688
689 free_proxy_seq(seq);
690
691 if (lock_range) {
692 SEQ_time_left_handle_frame_set(scene, seq, prev_startdisp);
693 SEQ_time_right_handle_frame_set(scene, seq, prev_enddisp);
694 }
695
697}
698
700 Main *bmain, Scene *scene, Sequence *seq, bool *r_was_reloaded, bool *r_can_produce_frames)
701{
703 "This function is only implemented for movie strips.");
704
705 bool must_reload = false;
706
707 /* The Sequence struct allows for multiple anim structs to be associated with one strip.
708 * This function will return true only if there is at least one 'anim' AND all anims can
709 * produce frames. */
710
711 if (BLI_listbase_is_empty(&seq->anims)) {
712 /* No anim present, so reloading is always necessary. */
713 must_reload = true;
714 }
715 else {
716 LISTBASE_FOREACH (StripAnim *, sanim, &seq->anims) {
717 if (!IMB_anim_can_produce_frames(sanim->anim)) {
718 /* Anim cannot produce frames, try reloading. */
719 must_reload = true;
720 break;
721 }
722 };
723 }
724
725 if (!must_reload) {
726 /* There are one or more anims, and all can produce frames. */
727 *r_was_reloaded = false;
728 *r_can_produce_frames = true;
729 return;
730 }
731
732 SEQ_add_reload_new_file(bmain, scene, seq, true);
733 *r_was_reloaded = true;
734
735 if (BLI_listbase_is_empty(&seq->anims)) {
736 /* No anims present after reloading => no frames can be produced. */
737 *r_can_produce_frames = false;
738 return;
739 }
740
741 /* Check if there are still anims that cannot produce frames. */
742 LISTBASE_FOREACH (StripAnim *, sanim, &seq->anims) {
743 if (!IMB_anim_can_produce_frames(sanim->anim)) {
744 /* There still is an anim that cannot produce frames. */
745 *r_can_produce_frames = false;
746 return;
747 }
748 };
749
750 /* There are one or more anims, and all can produce frames. */
751 *r_can_produce_frames = true;
752}
ImBufAnim * openanim(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
void BKE_id_free(Main *bmain, void *idv)
void id_us_ensure_real(ID *id)
Definition lib_id.cc:306
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:832
const char * BKE_main_blendfile_path_from_global()
Definition main.cc:837
int BKE_mask_get_duration(struct Mask *mask)
int BKE_movieclip_get_duration(struct MovieClip *clip)
void BKE_scene_multiview_view_prefix_get(Scene *scene, const char *filepath, char *r_prefix, const char **r_ext)
Definition scene.cc:3152
float BKE_sound_get_length(struct Main *bmain, struct bSound *sound)
bool BKE_sound_info_get(struct Main *main, struct bSound *sound, SoundInfo *sound_info)
struct bSound * BKE_sound_new_file(struct Main *bmain, const char *filepath)
bool BKE_sound_stream_info_get(struct Main *main, const char *filepath, int stream, SoundStreamInfo *sound_info)
@ SOUND_CHANNELS_INVALID
Definition BKE_sound.h:69
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
#define FILE_MAX
#define BLI_path_join(...)
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
#define FILE_MAXDIR
#define STRNCPY(dst, src)
Definition BLI_string.h:593
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define UNUSED_VARS(...)
#define ELEM(...)
#define STREQ(a, b)
typedef double(DMatrix)[4][4]
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_AUDIO_FPS
Definition DNA_ID.h:1094
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1089
@ IMA_ALPHA_PREMUL
@ R_MULTIVIEW
@ R_IMF_VIEWS_INDIVIDUAL
#define FPS
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_META
@ SEQ_TYPE_SCENE
@ SEQ_TYPE_MOVIECLIP
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_EFFECT
@ SEQ_TYPE_MOVIE
@ SEQ_TYPE_MASK
@ SEQ_ALPHA_STRAIGHT
@ SEQ_FILTERY
@ SEQ_SINGLE_FRAME_CONTENT
@ SEQ_AUTO_PLAYBACK_RATE
@ SEQ_USE_EFFECT_DEFAULT_FADE
@ SEQ_USE_VIEWS
@ SEQ_AUDIO_DRAW_WAVEFORM
struct StripElem StripElem
@ SOUND_FLAGS_MONO
@ SOUND_FLAGS_CACHING
ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
const char * IMB_colormanagement_display_get_default_view_transform_name(ColorManagedDisplay *display)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
@ COLOR_ROLE_DEFAULT_BYTE
bool IMB_anim_can_produce_frames(const ImBufAnim *anim)
int IMB_anim_get_image_height(ImBufAnim *anim)
double IMD_anim_get_offset(ImBufAnim *anim)
bool IMB_anim_get_fps(const ImBufAnim *anim, bool no_av_base, short *r_frs_sec, float *r_frs_sec_base)
int IMB_anim_get_image_width(ImBufAnim *anim)
ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
Definition readimage.cc:146
int IMB_anim_get_duration(ImBufAnim *anim, IMB_Timecode_Type tc)
IMB_Timecode_Type
@ IMB_TC_RECORD_RUN
Contains defines and structs used throughout the imbuf module.
@ IB_animdeinterlace
@ IB_alphamode_premul
@ IB_alphamode_detect
@ IB_test
@ IB_rect
IDProperty * IMB_anim_load_metadata(ImBufAnim *anim)
Definition anim_movie.cc:94
Read Guarded memory(de)allocation.
@ SEQ_LOAD_SOUND_MONO
Definition SEQ_add.hh:26
@ SEQ_LOAD_SOUND_CACHE
Definition SEQ_add.hh:25
@ SEQ_LOAD_SET_VIEW_TRANSFORM
Definition SEQ_add.hh:28
@ SEQ_LOAD_MOVIE_SYNC_FPS
Definition SEQ_add.hh:27
draw_view in_light_buf[] float
SeqEffectHandle SEQ_effect_handle_get(Sequence *seq)
Definition effects.cc:3430
int SEQ_effect_get_num_inputs(int seq_type)
Definition effects.cc:3467
void IMB_freeImBuf(ImBuf *)
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
size_t(* MEM_allocN_len)(const void *vmemh)
Definition mallocn.cc:36
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
ccl_device_inline float3 ceil(const float3 a)
void seq_anim_add_suffix(Scene *scene, ImBufAnim *anim, const int view_id)
Definition multiview.cc:21
int seq_num_files(Scene *scene, char views_format, const bool is_multiview)
Definition multiview.cc:27
void seq_multiview_name(Scene *scene, const int view_id, const char *prefix, const char *ext, char *r_path, size_t r_size)
Definition multiview.cc:40
T round(const T &a)
void free_proxy_seq(Sequence *seq)
Definition proxy.cc:614
StripElem * SEQ_render_give_stripelem(const Scene *scene, const Sequence *seq, int timeline_frame)
Definition render.cc:248
Sequence * seq_sequence_lookup_meta_by_seq(const Scene *scene, const Sequence *key)
void SEQ_sequence_lookup_invalidate(const Scene *scene)
const char * SEQ_sequence_give_name(const Sequence *seq)
void SEQ_sequence_base_unique_name_recursive(Scene *scene, ListBase *seqbasep, Sequence *seq)
void SEQ_set_scale_to_fit(const Sequence *seq, const int image_width, const int image_height, const int preview_width, const int preview_height, const eSeqImageFitMethod fit_method)
Sequence * SEQ_sequence_alloc(ListBase *lb, int timeline_frame, int machine, int type)
Definition sequencer.cc:123
Sequence * SEQ_add_scene_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:124
Sequence * SEQ_add_movieclip_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:136
Sequence * SEQ_add_effect_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:160
void SEQ_add_sound_av_sync(Main *, Scene *, Sequence *, SeqLoadData *)
Definition strip_add.cc:357
Sequence * SEQ_add_mask_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:148
Sequence * SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:391
static void seq_add_set_name(Scene *scene, Sequence *seq, SeqLoadData *load_data)
Definition strip_add.cc:82
void SEQ_add_image_set_directory(Sequence *seq, const char *dirpath)
Definition strip_add.cc:188
void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Sequence *seq, const bool lock_range)
Definition strip_add.cc:525
Sequence * SEQ_add_meta_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:373
void SEQ_add_image_init_alpha_mode(Sequence *seq)
Definition strip_add.cc:200
static void seq_add_set_view_transform(Scene *scene, Sequence *seq, SeqLoadData *load_data)
Definition strip_add.cc:106
void SEQ_add_image_load_file(Scene *scene, Sequence *seq, size_t strip_frame, const char *filename)
Definition strip_add.cc:193
Sequence * SEQ_add_sound_strip(Main *, Scene *, ListBase *, SeqLoadData *)
Definition strip_add.cc:364
void SEQ_add_load_data_init(SeqLoadData *load_data, const char *name, const char *path, const int start_frame, const int channel)
Definition strip_add.cc:56
void SEQ_add_movie_reload_if_needed(Main *bmain, Scene *scene, Sequence *seq, bool *r_was_reloaded, bool *r_can_produce_frames)
Definition strip_add.cc:699
static void seq_add_generic_update(Scene *scene, Sequence *seq)
Definition strip_add.cc:73
Sequence * SEQ_add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition strip_add.cc:230
void SEQ_edit_sequence_name_set(Scene *scene, Sequence *seq, const char *new_name)
void SEQ_relations_invalidate_cache_raw(Scene *scene, Sequence *seq)
void SEQ_relations_sequence_free_anim(Sequence *seq)
void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq)
void SEQ_time_right_handle_frame_set(const Scene *scene, Sequence *seq, int timeline_frame)
void SEQ_time_update_meta_strip_range(const Scene *scene, Sequence *seq_meta)
void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int timeline_frame)
int SEQ_time_left_handle_frame_get(const Scene *, const Sequence *seq)
void seq_time_effect_range_set(const Scene *scene, Sequence *seq)
float SEQ_time_start_frame_get(const Sequence *seq)
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
void SEQ_transform_translate_sequence(Scene *evil_scene, Sequence *seq, int delta)
Definition DNA_ID.h:413
char name[66]
Definition DNA_ID.h:425
void * first
struct RenderData r
void(* init)(Sequence *seq)
char views_format
Definition SEQ_add.hh:55
bool use_multiview
Definition SEQ_add.hh:54
Scene * scene
Definition SEQ_add.hh:43
struct SeqLoadData::@1364 effect
eSeqImageFitMethod fit_method
Definition SEQ_add.hh:53
Sequence * seq1
Definition SEQ_add.hh:49
int channel
Definition SEQ_add.hh:35
bool adjust_playback_rate
Definition SEQ_add.hh:59
char path[1024]
Definition SEQ_add.hh:38
bool allow_invalid_file
Definition SEQ_add.hh:57
Stereo3dFormat * stereo3d_format
Definition SEQ_add.hh:56
Sequence * seq2
Definition SEQ_add.hh:50
int end_frame
Definition SEQ_add.hh:41
MovieClip * clip
Definition SEQ_add.hh:44
int start_frame
Definition SEQ_add.hh:34
Mask * mask
Definition SEQ_add.hh:45
char name[64]
Definition SEQ_add.hh:36
eSeqLoadFlags flags
Definition SEQ_add.hh:52
struct SeqLoadData::@1363 image
double r_video_stream_start
Definition SEQ_add.hh:58
float media_playback_rate
struct MovieClip * clip
struct Scene * scene
struct Mask * mask
struct bSound * sound
struct Sequence * seq1
struct Sequence * seq2
struct Stereo3dFormat * stereo3d_format
eSoundChannels channels
Definition BKE_sound.h:82
struct SoundInfo::@58 specs
float length
Definition BKE_sound.h:85
struct ImBufAnim * anim
char filename[256]
ColorManagedColorspaceSettings colorspace_settings
char dirpath[768]
StripProxy * proxy
StripElem * stripdata
short flags
double offset_time