Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
GStreamer
gst-editing-services
Commits
6bf769c8
Commit
6bf769c8
authored
Jul 13, 2020
by
Thibault Saunier
🌵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transition: Better document the way alpha is computed for transitions
Part-of: <
!204
>
parent
046e609a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
ges/ges-smart-video-mixer.c
ges/ges-smart-video-mixer.c
+13
-13
ges/ges-smart-video-mixer.h
ges/ges-smart-video-mixer.h
+1
-1
ges/ges-utils.c
ges/ges-utils.c
+1
-1
ges/ges-video-transition.c
ges/ges-video-transition.c
+1
-1
No files found.
ges/ges-smart-video-mixer.c
View file @
6bf769c8
...
...
@@ -208,12 +208,12 @@ ges_smart_mixer_get_mixer_pad (GESSmartMixer * self, GstPad ** mixerpad)
return
sinkpad
;
}
/* These metadata will get set by the upstream framepositioner element,
added in the video sources' bin */
static
void
parse_metadata
(
GstPad
*
mixer_pad
,
GstBuffer
*
buf
,
GESSmartMixerPad
*
ghost
)
set_pad_properties_from_positioner_meta
(
GstPad
*
mixer_pad
,
GstSample
*
sample
,
GESSmartMixerPad
*
ghost
)
{
GstFramePositionerMeta
*
meta
;
GstBuffer
*
buf
=
gst_sample_get_buffer
(
sample
);
GESSmartMixer
*
self
=
GES_SMART_MIXER
(
GST_OBJECT_PARENT
(
ghost
));
meta
=
...
...
@@ -225,18 +225,18 @@ parse_metadata (GstPad * mixer_pad, GstBuffer * buf, GESSmartMixerPad * ghost)
return
;
}
if
(
!
self
->
d
is
able_zorder_alpha
)
{
if
(
!
self
->
is
_transition
)
{
g_object_set
(
mixer_pad
,
"alpha"
,
meta
->
alpha
,
"zorder"
,
meta
->
zorder
,
NULL
);
}
else
{
gint64
stream_time
;
gdouble
transalpha
;
GST_OBJECT_LOCK
(
ghost
);
stream_time
=
gst_segment_to_stream_time
(
&
ghost
->
segment
,
GST_FORMAT_TIME
,
GST_BUFFER_PTS
(
buf
));
GST_OBJECT_UNLOCK
(
ghost
);
stream_time
=
gst_segment_to_stream_time
(
gst_sample_get_segment
(
sample
),
GST_FORMAT_TIME
,
GST_BUFFER_PTS
(
buf
));
/* When used in a transition we aggregate the alpha value value if the
* transition pad and the alpha value from upstream frame positioner */
if
(
GST_CLOCK_TIME_IS_VALID
(
stream_time
))
gst_object_sync_values
(
GST_OBJECT
(
ghost
),
stream_time
);
...
...
@@ -377,12 +377,12 @@ compositor_sync_properties_with_meta (GstElement * compositor,
sample
=
gst_aggregator_peek_next_sample
(
GST_AGGREGATOR
(
compositor
),
GST_AGGREGATOR_PAD
(
sinkpad
));
if
(
!
sample
)
{
GST_INFO_OBJECT
(
sinkpad
,
"No sample set!"
);
}
else
{
parse_metadata
(
sinkpad
,
gst_sample_get_buffer
(
sample
),
GES_SMART_MIXER_PAD
(
info
->
ghostpad
));
if
(
sample
)
{
set_pad_properties_from_positioner_meta
(
sinkpad
,
sample
,
GES_SMART_MIXER_PAD
(
info
->
ghostpad
));
gst_sample_unref
(
sample
);
}
else
{
GST_INFO_OBJECT
(
sinkpad
,
"No sample set!"
);
}
pad_infos_unref
(
info
);
...
...
ges/ges-smart-video-mixer.h
View file @
6bf769c8
...
...
@@ -53,7 +53,7 @@ struct _GESSmartMixer
GMutex
lock
;
GstCaps
*
caps
;
gboolean
d
is
able_zorder_alpha
;
gboolean
is
_transition
;
gpointer
_ges_reserved
[
GES_PADDING
];
};
...
...
ges/ges-utils.c
View file @
6bf769c8
...
...
@@ -132,7 +132,7 @@ ges_pspec_hash (gconstpointer key_spec)
}
static
gboolean
find_compositor
(
GstPluginFeature
Filter
*
feature
,
gpointer
udata
)
find_compositor
(
GstPluginFeature
*
feature
,
gpointer
udata
)
{
gboolean
res
=
FALSE
;
const
gchar
*
klass
;
...
...
ges/ges-video-transition.c
View file @
6bf769c8
...
...
@@ -354,7 +354,7 @@ ges_video_transition_create_element (GESTrackElement * object)
oconv
,
NULL
);
mixer
=
ges_smart_mixer_new
(
NULL
);
GES_SMART_MIXER
(
mixer
)
->
d
is
able_zorder_alpha
=
TRUE
;
GES_SMART_MIXER
(
mixer
)
->
is
_transition
=
TRUE
;
g_object_set
(
GES_SMART_MIXER
(
mixer
)
->
mixer
,
"background"
,
3
,
NULL
);
/* transparent */
gst_bin_add
(
GST_BIN
(
topbin
),
mixer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment