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