By default, video track output full HD@30fps, this makes the behaviour
of clip position much more understandable and guarantess that we
always have a framerate.
The user can modify the values whenever he wants
Basically we were advertising that the source size would be the
size of the track if it hadn't been defined by end user, but since
we started to let scaling happen in the compositor, this is not true
as the source size is now the natural size of the underlying video
stream.
Remove the unit test and reimplemented using a validate scenario which
make the test much simpler to read :=)
Basically we know that if we are using mixing, compositor will be
able to do video conversion and scaling for us, so avoid adding those
usless elements.
This optimizes a lot caps negotiation for deeply nested timelines.
In general, brought the behaviour of the `start`, `duration` and
`inpoint` setters in line with each other. In particular:
1. fixed return value the GESSourceClip `duration` setter
2. changed the GESClip `start` setter
3. fixed the inpoint callback for GESContainer
4. changed the type of `res` in GESTimelineElement to be gint to
emphasise that the GES library is using the hack that a return of -1
from klass->set_duration means no notify signal should be sent out.
Also added a new test for clips to ensure that the setters work for
clips within and outside of timelines, and that the `start`, `inpoint`
and `duration` of a clip will match its children.
By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.
Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
We clearly uniquely identify assets by both their IDs and their
extractable type, and we should make sure that you can have a
TrackElement and a Clip with the same ID.
There is one exception in our implementation which is GESFormatter
because we treat their subclasses as 1 type with different IDs.
Corrected typo that attached project_loaded_cb, rather than error_loading_asset_cb, to ::error-loading-asset, which meant data.error would be left unset if an error occurred in loading.
ges-xml-formatter.c: In function ‘_parse_asset’:
ges-xml-formatter.c:357:7: error: ‘gst_uri_construct’ is deprecated: Use 'gst_uri_new' instead [-Werror=deprecated-declarations]
357 | id = gst_uri_construct ("file", subproj_data->filename);
| ^~
ges-uri-asset.c: In function ‘create_discoverer’:
ges-uri-asset.c:53:1: error: old-style function definition [-Werror=old-style-definition]
53 | create_discoverer ()
| ^~~~~~~~~~~~~~~~~
ges-uri-asset.c: In function ‘get_discoverer’:
ges-uri-asset.c:67:1: error: old-style function definition [-Werror=old-style-definition]
67 | get_discoverer ()
| ^~~~~~~~~~~~~~
CC libges_1.0_la-ges-auto-transition.lo
ges-asset.c: In function ‘_get_type_entries’:
ges-asset.c:489:1: error: old-style function definition [-Werror=old-style-definition]
489 | _get_type_entries ()
| ^~~~~~~~~~~~~~~~~
Implement lazy loading asset cache so gesdemux use the formatters
assets while GES hasn't been initialized.
And set extensions to temporary files as some formatters require
the information (otio)
Uses the file extension as hint falling back to the default formatter
if none is found
Make use of that function in when saving a project and not formatter
is specified.
This method is useful when implementing a formatter outside
GES that end up converting to xges and uses the default formatter
to finally load the timeline.
Adding a property to let the application know
Also make sure that the duration of nested timeline assets is reported
as CLOCK_TIME_NONE as those are extended as necessary.
And make a difference between asset duration and their max duration
As nested timelines can be extended 'infinitely' those max duration
is GST_CLOCK_TIME_NONE, but their duration is the real duration of
the timeline.
When we have nested timelines, we need to make sure the underlying
formatted file is reloaded when commiting the main composition to
take into account the new timeline.
In other to make the implementation as simple as possible we make
sure that whenever the toplevel composition is commited, the decodebin
holding the gesdemux is torn down so that a new demuxer is created
with the new content of the timeline.
To do that a we do a NleCompositionQueryNeedsTearDown query to which
gesdemux answers leading to a full nlecomposition stack
deactivation/activation cycle.
It was making no sense to consider it an empty timeline when the user
had passed the project URI when requesting the asset. Usually user
use `ges_project_new` with the URI but it is also valid to use
`ges_asset_request` with the uri as ID so let's handle that properly.
Subprojects simply consist of adding the GESProject
to the main project asset list. Then those are recursively
serialized in the main project in the <asset> not, when deserializing,
temporary files are created and those will be used in clips
as necessary
Making sure to have 1 GstDiscoverer per thread.
Use that new feature in gesdemux by loading the timeline directly from
the streaming thread. Modifying the timeline is not supported allowed
anyway.
In the case of nested timeline in the toplevel timeline we ended up
with CompositionUpdate for seeks sent by our own composition to
granchildren composition. This was not causing essential issues
if all tracks where containing nested timelines but in cases
where one of the tracks only had a nested timelines, then we
were waiting forever for a `CompositionUpdateDone`.
CompositionUpdate translated into ASYNC_START/ASYNC_DONE should
be kept inside the GESTimeline and not travel up (possibly to some
parent GESTimeline).
For smptealph element to work as expected the following compositing
element should mix with the default "over" operator, as described
in its documentation.
Setters return values should return %FALSE **only** when the value
could not be set, not when unchanged or when the subclass handled
it itself!
This patches makes it so the return value is meaningul by allowing
subclasses return anything different than `TRUE` or `FALSE` (convention
is -1) to let the subclass now that it took care of everything and
no signal should be emited.
Now that the notion of layer has been moved down to #GESTimelineElement
(through the new #ges_timeline_element_get_layer_priority method), this
method make much more sense directly in the base class.
ges_container_add removes the child being added if the call to
ges_timeline_element_set_parent fails. In this case, subclasses should
be given the chance to revert the effects of the add_child vmethod which
has just been called.
These are showing up in performance profile of 1000+ clips looped addition.
All this is done at commit time as well, so let that do only one update and
sorting.
Discoverer maintain a referernce on the discoverer object while
the async timeout callback is alive to prevent a potential crash
if the object is freed while the callback is pending.
But if g_main_context is released before calling the timeout callback,
the discoverer pointer which was weak referenced from GESUriClipAssetClass
will not be disposed because the discoverer object is not finalized.
And handle the fact that adding to a layer can fail.
Also plug some leaks in the dispose method (and use the dispose
vmethod instead of finalize as appropriate).
Basically if we do not emit a "duration" change of the clip being
splitted first when executing the 'reverse' operations would lead
to fully overallaping clips.
This is implemented on top of a Tree that represents the whole timeline.
SourceClips can not fully overlap anymore and the tests have been
updated to take that into account. Some new tests were added to verify
that behaviour in greater details
Each timeline element is in a layer (potentially spanning
over several), it is very often useful to retrieve an element
layer priority (from an app perspective more than the element
priority itself as that is a bit of an implementation detail
in the end).
Port tests to it
Auto transition when having 3 overlapping clips in a same point in the
timeline is not supported as we can't handle it in a nice way. Before we
to avoid creating 2 overlapping transitions (which is plain broken in
NLE) were completely disabling `auto-transition` and removing all
auto-transitions in the timeline but this is pretty weird for the end
user. This commit changes and now makes sure 2 transitions are not
created in the same place.
Also cleanup previous test case.
And start handling relocated assets.
Also expose the discoverer callback as a vmethod so that we can
overridde the discoverer when necessary (to handle discovering of
timeline through gesdemux for example)
This reverts commit e939cfebaf.
Class might not be initialized if they were already registered
when ges_init() was called, but were not created until ges_deinit() called.
To support ges_{init/deinit} multiple times in a process,
there should be a method for setting up internal object/table of
GESUriClipAssetClass. because *_class_init() will be called
only once in process lifecycle.
The GstFramePositioner might be finalized before the notify callback
Without this commit,
gst-editing-services / ges_basic / test_ges_timeline_remove_track
can reproduce the case.
Export GES library API in headers when we're building the
library itself, otherwise import the API from the headers.
This fixes linker warnings on Windows when building with MSVC.
Fix up some missing config.h includes when building the lib which
is needed to get the export api define from config.h
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/42
As we can have effects with several pads and the default ghosting
doesn't allow that.
This way we also filter the pads to ghost to match our track type.
When removing an effect from a clip, first the notify::priority signals
were being emitted for the remaining effects which changed priority, and only
at the end the child-removed signal. Now the child-removed signal is emitted
first.
Now subclassing a ghostpad with an alpha property so that
we can multiply the alpha of the frame positioning meta
and the alpha of that pad, setting it on the compositor pad.
https://bugzilla.gnome.org/show_bug.cgi?id=797169
g_clear_pointer() is now preserving the type of its arguments for the
free function.
ges-xml-formatter.c: In function ‘_dispose’:
ges-xml-formatter.c:1635:7: error: function called through a non-compatible type [-Werror]
(GDestroyNotify) g_hash_table_unref);
/usr/include/glib-2.0/glib/gmem.h:121:8: note: in definition of macro ‘g_clear_pointer’
(destroy) (_ptr); \
^~~~~~~
https://bugzilla.gnome.org/show_bug.cgi?id=797310
Marking them as children properties and properly allow serializing
clips children properties.
This doesn't handle several TrackElement of a same type with
different property values but this require more worked already
marked as fixme to allow specifying full path of elements in the
children properties API.
See https://gitlab.gnome.org/GNOME/pitivi/issues/1687
Until know we were doing it outside of the signal and subclasses didn't
have a chance to know that some assets was relocated.
This is required so that Pitivi can handle proxy delation and relocated
assets.
Required for https://gitlab.gnome.org/GNOME/pitivi/issues/2203
In the rendering case we were getting random issues and often the
pipeline was not be able to preroll as some pad were not linked inside
encodebin.
https://bugzilla.gnome.org/show_bug.cgi?id=795422
Those are the elements he cares about and we should expose their APIs
as is, event if they are not classified as effects. For example if
the user want to use a capsfilter as effect, he should be able to set
its caps.
summary_:
This way the timeline can handle all priorities for the user
making the API simpler to use.
API:
+ ges_timeline_move_layer
reviewers_: Mathieu_Du
Differential Revision: https://phabricator.freedesktop.org/D232
Otherwise the changes won't be reflected in the NLE backend.
This makes speed changes working inside ges-launch-1.0
ges-launch-1.0 +clip /path/to/file i=10 d=5 +effect videorate set-rate 5.0
https://bugzilla.gnome.org/show_bug.cgi?id=794699
In the (now tested) scenario where we have a transition on the right
side of a clip we are splitting, auto transitions can't be created
because we resize the clip after adding the new one, meaning that
there are 3 elements in the "transition zone", we need to force
auto transition creation after the splitting.
Fixes https://gitlab.gnome.org/GNOME/pitivi/issues/2142