[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60303] branches/soc-2013-vse/source/ blender/blenkernel/intern: Updating the sequencer kernel in order to support new VSE engine.
Alexander Kuznetsov
kuzsasha at gmail.com
Sun Sep 22 07:41:04 CEST 2013
Revision: 60303
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60303
Author: alexk
Date: 2013-09-22 05:41:04 +0000 (Sun, 22 Sep 2013)
Log Message:
-----------
Updating the sequencer kernel in order to support new VSE engine.
Modified Paths:
--------------
branches/soc-2013-vse/source/blender/blenkernel/intern/seqeffects.c
branches/soc-2013-vse/source/blender/blenkernel/intern/seqmodifier.c
branches/soc-2013-vse/source/blender/blenkernel/intern/sequencer.c
Modified: branches/soc-2013-vse/source/blender/blenkernel/intern/seqeffects.c
===================================================================
--- branches/soc-2013-vse/source/blender/blenkernel/intern/seqeffects.c 2013-09-22 05:29:21 UTC (rev 60302)
+++ branches/soc-2013-vse/source/blender/blenkernel/intern/seqeffects.c 2013-09-22 05:41:04 UTC (rev 60303)
@@ -56,6 +56,8 @@
#include "RNA_access.h"
+#include "sequencer_main.h"
+
static void slice_get_byte_buffers(const SeqRenderData *context, const ImBuf *ibuf1, const ImBuf *ibuf2,
const ImBuf *ibuf3, const ImBuf *out, int start_line, unsigned char **rect1,
unsigned char **rect2, unsigned char **rect3, unsigned char **rect_out)
@@ -2036,6 +2038,11 @@
glow->bNoComp = 0;
}
+static int num_inputs_one(void)
+{
+ return 1;
+}
+
static int num_inputs_glow(void)
{
return 1;
@@ -2766,6 +2773,9 @@
rval.early_out = early_out_adjustment;
rval.execute = do_adjustment;
break;
+ case SEQ_TYPE_BRIGHTNESSCONTRAST:
+ rval.num_inputs = num_inputs_one;
+ break;
}
return rval;
@@ -2775,7 +2785,7 @@
{
struct SeqEffectHandle rval = {FALSE, FALSE, NULL};
- if (seq->type & SEQ_TYPE_EFFECT) {
+ if (seq->type & SEQ_TYPE_EFFECT || 1) {
rval = get_sequence_effect_impl(seq->type);
if ((seq->flag & SEQ_EFFECT_NOT_LOADED) != 0) {
rval.load(seq);
@@ -2803,13 +2813,8 @@
int BKE_sequence_effect_get_num_inputs(int seq_type)
{
- struct SeqEffectHandle rval = get_sequence_effect_impl(seq_type);
+ return SEQ_get_num_inputs(seq_type);
- int cnt = rval.num_inputs();
- if (rval.execute || (rval.execute_slice && rval.init_execution)) {
- return cnt;
- }
- return 0;
}
int BKE_sequence_effect_get_supports_mask(int seq_type)
Modified: branches/soc-2013-vse/source/blender/blenkernel/intern/seqmodifier.c
===================================================================
--- branches/soc-2013-vse/source/blender/blenkernel/intern/seqmodifier.c 2013-09-22 05:29:21 UTC (rev 60302)
+++ branches/soc-2013-vse/source/blender/blenkernel/intern/seqmodifier.c 2013-09-22 05:41:04 UTC (rev 60303)
@@ -147,12 +147,12 @@
ColorBalanceModifierData *cbmd = (ColorBalanceModifierData *) smd;
int c;
- cbmd->color_multiply = 1.0f;
+ cbmd->data.color_multiply = 1.0f;
for (c = 0; c < 3; c++) {
- cbmd->color_balance.lift[c] = 1.0f;
- cbmd->color_balance.gamma[c] = 1.0f;
- cbmd->color_balance.gain[c] = 1.0f;
+ cbmd->data.color_balance.lift[c] = 1.0f;
+ cbmd->data.color_balance.gamma[c] = 1.0f;
+ cbmd->data.color_balance.gain[c] = 1.0f;
}
}
@@ -160,7 +160,7 @@
{
ColorBalanceModifierData *cbmd = (ColorBalanceModifierData *) smd;
- BKE_sequencer_color_balance_apply(&cbmd->color_balance, ibuf, cbmd->color_multiply, FALSE, mask);
+ BKE_sequencer_color_balance_apply(&cbmd->data.color_balance, ibuf, cbmd->data.color_multiply, FALSE, mask);
}
static SequenceModifierTypeInfo seqModifier_ColorBalance = {
@@ -471,8 +471,8 @@
BrightContrastModifierData *bcmd = (BrightContrastModifierData *) smd;
BrightContrastThreadData data;
- data.bright = bcmd->bright;
- data.contrast = bcmd->contrast;
+ data.bright = bcmd->data.bright;
+ data.contrast = bcmd->data.contrast;
modifier_apply_threaded(ibuf, mask, brightcontrast_apply_threaded, &data);
}
@@ -536,8 +536,8 @@
BrightContrastModifierData *bcmd = (BrightContrastModifierData *) smd;
BrightContrastThreadData data;
- data.bright = bcmd->bright;
- data.contrast = bcmd->contrast;
+ data.bright = bcmd->data.bright;
+ data.contrast = bcmd->data.contrast;
modifier_apply_threaded(ibuf, mask, maskmodifier_apply_threaded, &data);
}
Modified: branches/soc-2013-vse/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- branches/soc-2013-vse/source/blender/blenkernel/intern/sequencer.c 2013-09-22 05:29:21 UTC (rev 60302)
+++ branches/soc-2013-vse/source/blender/blenkernel/intern/sequencer.c 2013-09-22 05:41:04 UTC (rev 60303)
@@ -82,6 +82,8 @@
# include "AUD_C-API.h"
#endif
+#include "sequencer_main.h"
+
static ImBuf *seq_render_strip_stack(SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra);
static void seq_free_animdata(Scene *scene, Sequence *seq);
@@ -535,9 +537,9 @@
void BKE_sequence_calc_disp(Scene *scene, Sequence *seq)
{
- if (seq->startofs && seq->startstill)
+ //if (seq->startofs && seq->startstill)
seq->startstill = 0;
- if (seq->endofs && seq->endstill)
+ //if (seq->endofs && seq->endstill)
seq->endstill = 0;
seq->startdisp = seq->start + seq->startofs - seq->startstill;
@@ -572,7 +574,7 @@
/* effects and meta: automatic start and end */
- if (seq->type & SEQ_TYPE_EFFECT) {
+ if (seq->type & SEQ_TYPE_EFFECT &0) {
/* pointers */
if (seq->seq2 == NULL)
seq->seq2 = seq->seq1;
@@ -586,7 +588,7 @@
// seq->start = seq->startdisp = MAX2(seq->seq1->startdisp, seq->seq2->startdisp);
// seq->enddisp = MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
- if (seq->seq1) {
+ if (seq->seq1 && 0) {
/* XXX These resets should not be necessary, but users used to be able to
* edit effect's length, leading to strange results. See [#29190] */
seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
@@ -751,6 +753,22 @@
BKE_sequence_calc(scene, seq);
}
+int BKE_sequencer_evaluate_frame(Scene *scene, int cfra)
+{
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ Sequence *seq_arr[MAXSEQ + 1];
+
+ /* we pass everything to new VSE engine */
+ return 0;
+
+ if (ed == NULL)
+ return 0;
+
+
+
+ //return evaluate_seq_frame_gen(seq_arr, ed->seqbasep, cfra);
+}
+
void BKE_sequencer_sort(Scene *scene)
{
/* all strips together per kind, and in order of y location ("machine") */
@@ -925,6 +943,7 @@
case SEQ_TYPE_MULTICAM: return "Multicam";
case SEQ_TYPE_ADJUSTMENT: return "Adjustment";
case SEQ_TYPE_SPEED: return "Speed";
+ case SEQ_TYPE_BRIGHTNESSCONTRAST: return "Brightness and Contrast";
default:
return NULL;
}
@@ -1065,81 +1084,16 @@
return se;
}
-static int evaluate_seq_frame_gen(Sequence **seq_arr, ListBase *seqbase, int cfra)
-{
- Sequence *seq;
- int totseq = 0;
- memset(seq_arr, 0, sizeof(Sequence *) * (MAXSEQ + 1));
+typedef struct seqBucket seqBucket;
- seq = seqbase->first;
- while (seq) {
- if (seq->startdisp <= cfra && seq->enddisp > cfra) {
- seq_arr[seq->machine] = seq;
- totseq++;
- }
- seq = seq->next;
- }
-
- return totseq;
-}
-
-int BKE_sequencer_evaluate_frame(Scene *scene, int cfra)
+static int get_shown_sequences(Scene *scene, ListBase *seqbasep, int cfra, int chanshown)
{
- Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
- Sequence *seq_arr[MAXSEQ + 1];
+ SEQ_display_frame(scene, cfra);
- if (ed == NULL)
- return 0;
-
- return evaluate_seq_frame_gen(seq_arr, ed->seqbasep, cfra);
+ return 0;
}
-static int video_seq_is_rendered(Sequence *seq)
-{
- return (seq && !(seq->flag & SEQ_MUTE) && seq->type != SEQ_TYPE_SOUND_RAM);
-}
-
-static int get_shown_sequences(ListBase *seqbasep, int cfra, int chanshown, Sequence **seq_arr_out)
-{
- Sequence *seq_arr[MAXSEQ + 1];
- int b = chanshown;
- int cnt = 0;
-
- if (b > MAXSEQ) {
- return 0;
- }
-
- if (evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
- if (b == 0) {
- b = MAXSEQ;
- }
- for (; b > 0; b--) {
- if (video_seq_is_rendered(seq_arr[b])) {
- break;
- }
- }
- }
-
- chanshown = b;
-
- for (; b > 0; b--) {
- if (video_seq_is_rendered(seq_arr[b])) {
- if (seq_arr[b]->blend_mode == SEQ_BLEND_REPLACE) {
- break;
- }
- }
- }
-
- for (; b <= chanshown && b >= 0; b++) {
- if (video_seq_is_rendered(seq_arr[b])) {
- seq_arr_out[cnt++] = seq_arr[b];
- }
- }
-
- return cnt;
-}
-
/*********************** proxy management *************************/
typedef struct SeqIndexBuildContext {
@@ -2752,6 +2706,11 @@
return early_out;
}
+
+
+
+
+
static ImBuf *seq_render_strip_stack(SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown)
{
Sequence *seq_arr[MAXSEQ + 1];
@@ -2759,8 +2718,13 @@
int i;
ImBuf *out = NULL;
- count = get_shown_sequences(seqbasep, cfra, chanshown, (Sequence **)&seq_arr);
+ count = get_shown_sequences(context.scene, seqbasep, cfra, chanshown);
+
+
+
+
+
if (count == 0) {
return NULL;
}
@@ -4030,6 +3994,18 @@
}
}
+
+void BKE_sequence_init_transformation(struct Sequence *seq)
+{
+ if(seq && seq->strip)
+ {
+ StTransformationVars *t = &seq->strip->transformation;
+ t->ScaleX = t->ScaleY = 1.0f;
+ t->TranX = t->TranY = 0.0f;
+ t->rotRad = 0.0f;
+ }
+}
+
/* NOTE: this function doesn't fill in image names */
Sequence *BKE_sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
@@ -4049,6 +4025,8 @@
strip->stripdata = MEM_callocN(seq->len * sizeof(StripElem), "stripelem");
BLI_strncpy(strip->dir, seq_load->path, sizeof(strip->dir));
+ BKE_sequence_init_transformation(seq);
+
seq_load_apply(scene, seq, seq_load);
return seq;
@@ -4102,6 +4080,8 @@
seq->len = (int)ceil((double)info.length * FPS);
strip->us = 1;
+ BKE_sequence_init_transformation(seq);
+
/* we only need 1 element to store the filename */
strip->stripdata = se = MEM_callocN(sizeof(StripElem), "stripelem");
@@ -4162,6 +4142,8 @@
seq->len = IMB_anim_get_duration(an, IMB_TC_RECORD_RUN);
strip->us = 1;
+ BKE_sequence_init_transformation(seq);
+
BLI_strncpy(seq->strip->colorspace_settings.name, colorspace, sizeof(seq->strip->colorspace_settings.name));
/* we only need 1 element for MOVIE strips */
More information about the Bf-blender-cvs
mailing list