Commit graph

2051 commits

Author SHA1 Message Date
Henry Wilkes
067304a05f auto-transition: select track directly
By-pass the select-tracks-for-object signal for auto-transitions since
their track element must land in the same track as the elements it is
the auto-transition for.
2020-04-08 14:35:28 +01:00
Henry Wilkes
269c2d1dc0 timeline: re-handle clip children track selection
The way a clip's track elements are added to tracks was re-handled. This
doesn't affect the normal usage of a simple audio-video timeline, where
the tracks are added before any clips, but usage for multi-track
timelines has improved. The main changes are:

+ We can now handle a track being selected for more than one track,
  including a full copy of their children properties and bindings.
  (Previously broken.)
+ When a clip is split, we copy the new elements directly into the same
  track, avoiding select-tracks-for-object.
+ When a clip is grouped or ungrouped, we avoid moving the elements to
  or from tracks.
+ Added API to allow users to copy the core elements of a clip directly
  into a track, complementing select-tracks-for-object.
+ Enforced the rule that a clip can only contain one core child in a
  track, and all the non-core children must be added to tracks that
  already contains a core child. This extends the previous condition
  that two sources from the same clip should not be added to the same
  track.
+ Made ges_track_add_element check that the newly added track element
  does not break the configuration rules of the timeline.
+ When adding a track to a timeline, we only use
  select-tracks-for-object to check whether track elements should be
  added to the new track, not existing ones.
+ When removing a track from a timeline, we empty it of all the track
  elements that are controlled by a clip. Thus, we ensure that a clip
  only contains elements that are in the tracks of the same timeline, or
  no track. Similarly, when removing a clip from a timeline.
+ We can now avoid unsupported timeline configurations when a layer is
  added to a timeline, and already contains clips.
+ We can now avoid unsupported timeline configurations when a track is
  added to a timeline, and the timeline already contains clips.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/84
2020-04-08 14:35:28 +01:00
Henry Wilkes
f7a1bdb289 timeline: stop connecting to track-element-added
This was used to connect to the track element's notify::start signal in
order to update the duration of the timeline (it is not clear why the
notify::duration signal was not also connected to for the same reason).
However, this is already covered by the timeline_tree_move method, which
is always called to update the start of a track element, even if it is not
part of a clip (and similarly for timeline_tree_trim, which is called
when the duration is set).
2020-04-07 11:17:54 +01:00
Henry Wilkes
a93e873402 clip: allow arbitrary max-duration when no core children
Before the max-duration could be set arbitrarily when the clip was empty,
to indicate what the max-duration would be once the core children were
created. Now, we can also do this whilst the clip only contains non-core
children.
2020-04-07 11:17:54 +01:00
Henry Wilkes
278a5fd796 track-element: change owner to creator
Rename the private "owners" to "creators" to avoid confusing this with
the owner of the track element's memory.

Also made the ungroup method for GESClip symmetric by making all the
children of the resulting clips share their creators, which allows them
to be added to any of the other ungrouped clips. Once the clips are
grouped back together, the tracks loose these extra creators.
2020-04-07 11:17:44 +01:00
Henry Wilkes
6e55a6556f container: change ownership when adding
Make sure we sink the child on adding, and keep it alive until the end
in case the method fails.

Also, since the child mappings hold a ref to the child, they should give
them up in their free method. This way, the ref will be given up on
disposing, even if ges_container_remove fails.

Also, reverse setting of the start of the container if adding fails.
2020-04-07 09:34:12 +01:00
Nirbheek Chauhan
917eba54f7 ges: Fix build with GCC 10
gcc-10 defaults to -fno-common, which exposes a symbol conflict, so
use `static` correctly. Also we don't use `parent_extractable_iface`
in `ges-uri-clip.c`.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678
2020-04-06 23:06:29 +05:30
Thibault Saunier
f307d3d51b ges: Fix trimming clip inside deeply nested groups
This broke in 6b7c658b6a
2020-03-31 15:19:52 -03:00
Thibault Saunier
b1e7be7bfc uri-clip: Remove dead code
GES_TESTING_ASSETS_DIRECTORY is prehistoric and since then
new mechanism for asset relocation have been added, it makes
no sense to keep that unused code path
2020-03-30 06:54:22 -03:00
Thibault Saunier
3118e3ebaf uri-clip: Remove ->create_track_element implementation
It is dead code
2020-03-30 06:54:22 -03:00
Thibault Saunier
ddaf67fed3 ges: Deprecate GESImageSource and GESMultiFileSource
Refactoring GESVideoSource so that #GESUriVideoSource can handle
still image in a simple way

MultiFileSource has been replaced with the new `imagesequencesrc`
element, this was totally broken anyway as `multifilesrc` can not seek
properly.
2020-03-30 06:54:22 -03:00
Thibault Saunier
f99034a522 track-element: Create nleobject on GESExtractable::set_asset
This means that we have all the information about the asset
when constructing the underlying GstElements.

This also allows to cleanup some code all around
2020-03-27 17:17:23 -03:00
Thibault Saunier
c2287696b1 timeline:element: Refactor the way we 'copy'
Simplifying the implementation and making sure assets are set asap
2020-03-27 17:17:23 -03:00
Thibault Saunier
ffc11daa40 ges: Use assets to instantiate track elements/group
And deprecate all GESTrackElement constructors, but the GESEffect one.
Those should **never** be created by users and should become internal
in the future.

Stop having docstring for the constructors that were internal.
2020-03-27 17:17:23 -03:00
Thibault Saunier
2d810bd7b7 formatter: Serialize source properties
This way we ensure that the TrackElement 'active' property is
properly serialized
2020-03-25 15:40:25 -03:00
Thibault Saunier
f9f30c4ced ges: Add a way to set layer activeness by track
a.k.a muting layers.

Adding unit tests and making sure serialization works properly
2020-03-25 15:40:25 -03:00
Thibault Saunier
7ccc7aa7ca element: Add API safe guard against invalid position in edit() 2020-03-25 11:26:29 -03:00
Thibault Saunier
1577ac1038 validate: Refactor actions implementation
Making them simpler to read and avoiding leaks
2020-03-25 11:26:29 -03:00
Thibault Saunier
42fc26ee94 structured-interface: Fix adding clip to layer error reporting 2020-03-25 11:26:29 -03:00
Thibault Saunier
13325aabdd ges: Add a SourceClipAsset class
Cleaning up the way we use the default framerate for natural
frame rate.
2020-03-25 11:26:29 -03:00
Thibault Saunier
dcb3ad620d ges: Plug some leaks 2020-03-25 11:26:29 -03:00
Thibault Saunier
ae6124e282 validate: Add support to seek in frames 2020-03-25 11:26:29 -03:00
Thibault Saunier
0c87b44fae ges: support test clips assets natural size/framerate
This way we can test this kind of behaviour without requiring
real sources.

Also add simple tests.
2020-03-25 11:26:29 -03:00
Thibault Saunier
e835042f04 ges: Add APIs to have a sens of frame numbers
APIs:
   - ges_timeline_get_frame_time
   - ges_timeline_get_frame_at
   - ges_clip_asset_get_frame_time
   - ges_clip_get_timeline_time_from_source_frame

Extracting ges_util_structure_get_clocktime to internal utilities adding
support for specifying timing values in frames with the special
f<frame-number> synthax.
2020-03-25 11:26:29 -03:00
Thibault Saunier
f7bd6d63c4 validate: Rename edit-container to edit
Keeping the old version for backward compat
2020-03-25 11:26:29 -03:00
Thibault Saunier
2cbc1f14df ges: Add a timeoverlay to video test sources
This is often very useful to have a timeoverlay inside test sources.
We do not want to use it as an effect as segments are not the sames
in GES when it comes to nleoperations.
2020-03-25 11:26:29 -03:00
Thibault Saunier
66fb647183 element: Handle using own property as child property
Avoiding ref cycles
2020-03-25 11:26:29 -03:00
Thibault Saunier
7f0fc6fbed ges: Ensure GESClips assets are always ClipAssets 2020-03-25 11:26:29 -03:00
Thibault Saunier
bd33ed972c ges: Add API to retrieve the natural framerate of an element 2020-03-25 11:26:27 -03:00
Thibault Saunier
b93caf362c ges: Some memory management fixes setting track mixing
Also fix 'mixing' property notifies
2020-03-23 12:09:22 -03:00
Thibault Saunier
e6e05be88a ges: Cleanup GESEdge and GESEditMode GEnum values
By duplicating the registered values, so that bindings have
better values to use
2020-03-19 18:45:51 -03:00
Thibault Saunier
ed2c7006c5 framepositioner: Avoid dereferencing NULL pointer 2020-03-19 18:45:51 -03:00
Thibault Saunier
e3aa157d53 validate: Initialize GValue before calling g_object_get_value
This is required with GLib < 2.60
2020-03-19 18:45:51 -03:00
Thibault Saunier
ff2180b284 ges: Use #pragma once everywhere 2020-03-19 21:09:18 +00:00
Thibault Saunier
0012c6a3b0 ges: Cleanup the way we declare object types
We create our own _DECLARE_ macro because we have instance structures
2020-03-19 21:09:18 +00:00
Thibault Saunier
aaf2025c71 ges: Stop using hash_table_steal_extended
This appeard in GLib 2.58

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/99
2020-03-19 09:15:11 -03:00
Thibault Saunier
314db9f1bd clip: Allow setting max-duration clips without TrackElements
Otherwise this breaks quite a few assumption in user code, several
pitivi tests broke because of that.
2020-03-18 21:58:11 -03:00
Thibault Saunier
fc0333922f ges: Make it so core elements can be re added to their 'owners'
The user might want to add/remove/add core children to clips and be able
to regroup ungrouped clip. This is needed for undo/redo in Pitivi for
example
2020-03-18 21:58:11 -03:00
Thibault Saunier
10590e25f0 container: Let subclass know adding child was interrupted
When the `child-added` signal emission was called, the
`GESContainer->child_added` vmethod was called (the signal is
`G_SIGNAL_RUN_FIRST`) so we need to call `GESContainer->child_removed`
ourself so subclasses know they do not control the child anymore.
2020-03-18 14:04:49 -03:00
Henry Wilkes
eb8e429c80 timeline-element: make start and duration EXPLICIT_NOTIFY
The properties will only have their signal emitted when they change in
value, even when g_object_set, etc, methods are used.

The _set_start method already did this, but start was missing the
EXPLICIT_NOTIFY flag. There should be no need to check that the property
has changed in ->set_start or ->set_duration
2020-03-16 14:19:52 +00:00
Henry Wilkes
658e64432d timeline-element: make max-duration cap in-point
Do not allow the in-point to exceed the max-duration of any timeline
element.
2020-03-16 14:19:52 +00:00
Henry Wilkes
d03e0fa8c5 clip: only allow children with the same timeline
Refuse the addition of children whose timeline is neither NULL nor the
clip's timeline.
2020-03-16 14:19:52 +00:00
Henry Wilkes
cd9cba55c0 clip: re-handle child in-point and max-duration
The in-point of a clip is kept in sync with its core children, unless they
have no has-internal-source.

The max-duration is defined as the minimum max-duration amongst the
clip's core children. If it is set to a new value, this sets the
max-duration of its core children to the same value if they have
has-internal-source set as TRUE.

Non-core children (such as effects on a source clip) do not influence
these values.

As part of this, we no longer track in-point in GESContainer. Unlike start
and duration, the in-point of a timeline element does not refer to its
extent in the timeline. As such, it has little meaning for most
collections of timeline-elements, in particular GESGroups. As such, there
is no generic way to relate the in-point of a container to its children.
2020-03-16 14:19:52 +00:00
Henry Wilkes
7725e48a80 timeline-element: make in-point and max-duration EXPLICIT_NOTIFY
As such, they only emit a signal if their value changes, either through
their _set_inpoint or _set_max_duration methods, or through
g_object_set, etc.

Also, we now require the ->set_max_duration method to be implemented.
This was added to GESGroup, which will only allow the max-duration to be
set to GST_CLOCK_TIME_NONE.
2020-03-16 14:19:52 +00:00
Henry Wilkes
5f3e8caabc track-element: add has-internal-source property
Unless this property is set to TRUE, the in-point must be 0 and the
max-duration must be GST_CLOCK_TIME_NONE.

Also added EXPLICIT_NOTIFY flags to the active and track-type
properties such that their notifies are emitted only if the property
changes, even when the g_object_set, etc, methods are used.

Also added a missing notify signal to the set_active method.
2020-03-16 14:19:52 +00:00
Henry Wilkes
dc4ca15ba8 clip: copy and paste control bindings
Previously the control bindings were not properly copied into the pasted
clip. Also changed the order so that elements are added to the clip
before the clip is added to the timeline.
2020-03-16 14:19:52 +00:00
Henry Wilkes
c63fb5db0e timeline-element: add signals for child properties
Add the child-property-added and child-property-removed signals to
GESTimelineElement.

GESContainer is able to use this to keep their child properties in sync
with their children: if they are added or removed from the child, they
are also added or removed from the container.
2020-03-16 14:19:52 +00:00
Henry Wilkes
74ae0ba5df container: freeze notifies during add and remove
Hold the notify signals for the container and the children until after
the child has been fully added or removed.

After the previous commit, this was used to ensure that the
notify::priority signal was sent for children of a clip *after* the
child-removed signal. This stopped being the case when the code in
->child_removed was moved to ->remove_child (the latter is called before
the child-removed signal is emitted, whilst the former is called
afterwards). Rather than undo this move of code, which was necessary to
ensure that ->add_child was always reversed, the notify::priority signal
is now simply delayed until after removing the child has completed. This
was done for all notify signals, as well as in the add method, to ensure
consistency.

This allows the test_clips.py test_signal_order_when_removing_effect to
pass.

Also make subclasses take a copy of the list of the children before
setting the start and duration, since this can potentially re-order the
children (if they have the SET_SIMPLE flag set).
2020-03-16 14:19:52 +00:00
Henry Wilkes
3af38e1719 clip: make remove_child a reverse of add_child
Previously, we relied on ->child_removed to reverse the priority changes
that occured in ->add_child. However, ->child_removed is not always
called (the signal child-removed is not always emitted) when a
->add_child needs to be removed. However, ->remove_child is always
called to reverse ->add_child, so the code was moved here. Otherwise, we
risk that the priorities of the clip will contain gaps, which will cause
problems when another child is added to the clip.
2020-03-16 14:19:52 +00:00
Henry Wilkes
d1276ed29b clip: tidy handling of child priorities
Handle the child priorities in a way that keeps the container children
list sorted by priority at all times. Also, no longer rely on the
control_mode of the container, since we have less control over its value,
compared to private variables.

Also fixed the changing of priorities in set_top_effect_index:
previously *all* children whose priority was above or below the new
priority were shifted, when we should have been only shifting priorities
for the children whose priority lied *between* the old and the new
priority of the effect. E.g.
  effect:   A   B   C   D   E   F
  index:    0   1   2   3   4   5
After moving effect E to index 1, previously, we would get
  effect:   A   B   C   D   E   F
  index:    0   2   3   4   1   6
(this would have also shifted the priority for the core children as
well!). Whereas now, we have the correct:
  effect:   A   B   C   D   E   F
  index:    0   2   3   4   1   5
2020-03-16 14:19:52 +00:00
Henry Wilkes
91b5a5804a clip: only allow core elements as children
Only allow elements that were created by ges_clip_create_track_elements
(or copied from such an element) to be added to a clip. This prevents
users from adding arbitrary elements to a clip.

As an exception, a user can add GESBaseEffects to clips whose class
supports it, i.e. to a GESSourceClip and a GESBaseEffectClip.

This change also introduces a distinction between the core elements of a
clip (created by ges_clip_create_track_elements) and non-core elements
(currently, only GESBaseEffects, for some classes). In particular,
GESBaseEffectClip will now distinguish between its core elements and
effects added by the user. This means that the core elements will always
have the lowest priority, and will not be listed as top effects. This is
desirable because it brings the behaviour of GESBaseEffectClip in line
with other clip types.
2020-03-16 14:19:51 +00:00
Henry Wilkes
ec2325ee9b auto-transition: fix setting of SET_SIMPLE flag
Previously, the SET_SIMPLE flag was non unset for auto-transitions after
it had been set.
2020-03-11 17:35:07 +00:00
Thibault Saunier
1f919dae98 validate: Handle checking/setting subprojects ges properties 2020-03-09 11:50:01 -03:00
Thibault Saunier
5ea914a575 project: Do not warn when resetting URI to the same one 2020-03-09 11:49:02 -03:00
Thibault Saunier
6b7c658b6a ges: Make setting start/duration move or trim generic
We were implementing the logic for moving/trimming elements specific
to SourceClip but this was not correct ass the new timeline tree allows
us to handle that for all element types in a generic and nice way.

This make us need to have groups trimming properly implemented in the
timeline tree, leading to some fixes in the group tests.

This adds tests for the various cases known to not be handled properly
by the previous code.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/92
2020-03-09 11:48:37 -03:00
Thibault Saunier
b66290d1be group: Update priority when a child is removed
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/93
2020-03-06 18:18:28 +00:00
Thibault Saunier
f8091262b5 clip: Don't split clips at illegal position
Make sure that when we split a clip, the resulting timeline would
not be in an illegal state.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/94
2020-03-06 18:18:28 +00:00
Henry Wilkes
1cc5221d49 pipeline: don't link tracks unnecessarily
Unless the pipeline is in certain modes, we do not want to try and link
every track. The previous debug message implied this, but the method did
not actually end early.
Also, we always end early if we receive a track that is neither video
nor audio.
2020-03-05 17:04:51 -03:00
Henry Wilkes
7f65b7be0c asset: fix handling of proxies
Previous usage of the property proxy-target seemed to alternate between
the two definitions:
+ The asset we are the default proxy of
+ The asset we are in the proxy list of
Now, the latter definition is used, which seems more useful to a user
since knowing the latter can easily allow you to find out the former.

The previous behaviour of ges_asset_set_proxy (asset, NULL) was not very
clear. It is now defined so that it clears all the proxies for 'asset'.
This means that after this call, the GESAsset:proxy property will indeed
be NULL.

Also fixed:
+ We can call ges_asset_set_proxy (asset, proxy) when 'proxy' is already
  in the proxy list of 'asset'.
+ Handling of removing the default proxy in ges_asset_unproxy. This was
  sending out the wrong notifies.
+ Prohibiting circular proxying. Before we could only prevent one case,
  we should now be able to prevent all cases. This will prevent a hang
  in ges_asset_request.
2020-03-05 17:04:51 -03:00
Henry Wilkes
8f12663428 asset: fix ownership in ges_asset_request
Fix the ownership in ges_asset_request. This should be transfer-full,
but for proxies it would fail to add a reference. Also,
ges_asset_cache_put was leaking memory if the asset already existed.
2020-03-05 17:04:51 -03:00
Henry Wilkes
c12b84788d asset: move set_proxy (NULL, proxy) behaviour to new method
We should not be accepting ges_asset_set_proxy (NULL, proxy) as part of
the API! This behaviour was used internally in combination with
ges_asset_try_proxy, which is called on a still loading asset, so it was
moved to ges_asset_finish_proxy.
2020-03-05 17:04:51 -03:00
Henry Wilkes
46f2b5a9bc asset: deprecate ->proxied method
This method was no longer called, so it has been deprecated.
2020-03-05 17:04:51 -03:00
Henry Wilkes
0bc4c0820f asset: make proxy-target read only
We should not be able to set this property.
2020-03-05 17:04:51 -03:00
Henry Wilkes
a8458d59de timeline: fix layer priority argument in trim
Previously, we tested that the given priority was `>0`, when it seems
that `>=0` was intended. A priority of `-1` means leave the priority
unchanged, whilst a priority of 0, or more, means move to this layer
priority.
2020-03-05 17:04:51 -03:00
Henry Wilkes
bbff08f078 timeline-element: use default ->list_children_properties
Stop overwriting the ->list_children_properties virtual method in
subclasses because the timeline element class handles everything itself
anyway.
Note that containers already automatically add the children properties of
their child elements in ges_container_add.
2020-03-05 17:04:51 -03:00
Henry Wilkes
b76e7db461 group: fix memory leak in child layer callback
We were leaking the sigids->layer argument because gst_clip_get_layer
returns a new reference.
2020-03-05 17:04:51 -03:00
Henry Wilkes
7afa704054 container: fix child duration callback
Previously, we were setting the inpoint_offset using the start offset in
the duration callback!

Also added a notify for when the duration is changed in the child start
callback.
2020-03-05 17:04:51 -03:00
Henry Wilkes
11d93367a9 group: fix max layer priority
The maximum priority is `height - prio - 1`. Previously missing the -1.

Related to, but does not completely fix,
https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/91
2020-03-05 17:04:51 -03:00
Henry Wilkes
f1d29e10e6 clip: allow for neither track nor type in search
Previously, either the track or track_type arguments had to be specified
in order to find **any** track elements. Now, you can specify neither,
which will match any track element, of the specified type.
2020-03-05 17:04:51 -03:00
Henry Wilkes
9a459d0cb5 extractable: check extractable-type of set asset
When setting the asset of a GESExtractable object, first make sure that
the asset's extractable-type matches the type of the object.
2020-03-05 17:04:51 -03:00
Henry Wilkes
1332ed674a layer: fix ownership when failing to add clip
If a clip is already part of a layer, then adding it to another layer
should fail. Previously, in this case, `ges_layer_add_clip` was adding a
reference to the clip instead, without subsequently giving up ownership.
This meant that the clip would be left with an unowned reference.
This has now been corrected by also calling `unref` after the
`ref_sink`.

Note that, since `clip` is already part of `current_layer`, it should
already be non-floating, so the `ref_sink`-`unref` should do nothing
overall. But we keep both to make the ownership (transfer floating/none)
explicit.
2020-03-05 17:04:51 -03:00
Henry Wilkes
a03afa5476 docs: update GESAudioTrack and GESVideoTrack 2020-03-05 17:04:51 -03:00
Henry Wilkes
2f2d57ff2b docs: update GESPipeline 2020-03-05 17:04:51 -03:00
Henry Wilkes
3324fe7d95 docs: update GESMetaContainer 2020-03-05 17:04:51 -03:00
Henry Wilkes
e55c87c5e5 docs: update GESExtractable 2020-03-05 17:04:51 -03:00
Henry Wilkes
dfe3b805f3 docs: update GESAsset 2020-03-05 17:04:51 -03:00
Henry Wilkes
b3d44f66b7 docs: update GESTrackElement 2020-03-05 16:59:37 -03:00
Henry Wilkes
cb35f5ec50 docs: update GESTrack 2020-03-05 16:59:37 -03:00
Henry Wilkes
ac2da96144 docs: update GESClip 2020-03-05 16:59:37 -03:00
Henry Wilkes
427d541f58 docs: update GESGroup 2020-03-05 16:59:37 -03:00
Henry Wilkes
1c6bdf3fcd docs: update GESContainer 2020-03-05 16:59:37 -03:00
Henry Wilkes
4b3fe5f622 docs: update GESTimelineElement 2020-03-05 16:59:37 -03:00
Henry Wilkes
94db57b9bd validate: unref copied and pasted 2020-03-05 16:59:37 -03:00
Henry Wilkes
615bf9e47a timeline: fix paste ownership
The method steals ownership of `copied_from`, so should be responsible
for unreffing it. Also make sure we fail when `layer != -1`, since this
functionality is not supported.
2020-03-05 16:59:37 -03:00
Henry Wilkes
8ad9952cdb docs: update GESTimeline and GESLayer 2020-03-05 16:59:37 -03:00
Thibault Saunier
9cf986c71c framepositioner: Reposition source when the user positioned them
Keeping the same proportion in the size and position and only if
the aspect ratio is conserved.
2020-02-26 13:39:29 -03:00
Thibault Saunier
32dae5e3da validate: Handle absolute control binding support when setting keyframes
And minor fix in set-control-source
2020-02-26 13:36:30 -03:00
Thibault Saunier
53637ad749 ges: Properly position video sources in the scene by default
We try to do our best to have the video frames scaled the best way
to fill most space on the final frames, keeping aspect ratio. The user
can later on rescale or move the sources as usual but it makes the
default behaviour a better and more natural especially now that we
set default restriction caps to the video tracks.

And fix the unit test to take that change into account
2020-02-26 13:36:30 -03:00
Thibault Saunier
7b3ac927dc ges: Add a method to retrieve the 'natural' size of VideoSource
This way the user can easily know how the clip would look like
if no scaling was applied to the clip, this is useful to be able
to properly position the clips with the framepositionner element.
2020-02-26 13:36:30 -03:00
Thibault Saunier
c802a40a96 ges: Call the right ->set_child_property vmethod
We used to always call the `->set_child_property` virtual method
of the object that `ges_timeline_element_set_child_property` was called
from, but that means that, in the case of referencing GESContainer
children properties from its children, the children wouldn't know
what child property have been set, and the children override wouldn't
be takent into account, in turns, it means that the behaviour could be
different in the setter depending on parent the method was called,
which is totally unexpected.

We now make sure that the vmethod from the element that introduced the
child property is called whatever parent method is called, making the
behaviour more uniform.

Fix the python override to make sure that new behaviour is respected.
2020-02-26 13:36:30 -03:00
Thibault Saunier
c454969524 ges: Deprecate the GESTimeline::track field
It is not MT safe to access it, and user should use the proper getter
2020-02-26 13:36:30 -03:00
Thibault Saunier
221353e75c ges: Set default caps for GESVideoTrack
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
2020-02-26 13:36:30 -03:00
Thibault Saunier
df6058c802 framepositioner: Stop lying about the source size
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 :=)
2020-02-26 13:36:30 -03:00
Thibault Saunier
99074a01a3 validate: Add action types to set/check various child properties at once
And add a way to take into account control bindings.
2020-02-26 13:36:30 -03:00
Thibault Saunier
38dbfc1c24 ges: Allow setting children property using the set_object_arg format
This make it much simpler for the user to set enum values and should not cause any issue
2020-02-25 17:44:51 -03:00
Thibault Saunier
4e4473ef8f ges: Plug leaks in new ges-launch and related 2020-02-25 17:44:51 -03:00
Thibault Saunier
056ac5eeb0 validate: Port to the new REPORT_ACTION API 2020-02-25 17:44:51 -03:00
Thibault Saunier
0be8bc9d98 ges: Avoid adding unnecessary converters for nested timelines
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.
2020-02-12 17:50:37 -03:00
Thibault Saunier
82159882d7 ges: Ignore deprecation of GParameter
GParameter is part of our API, and for GLib < 2.54 we do not even have
a way around avoiding it (namely `g_object_new_with_properties`).

We should stop using GParameter once we depend on GLib 2.54.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/86
2020-02-07 11:58:37 -03:00
Thibault Saunier
000edd268e ges: Use G_DEPRECATE to mark deprecated methods
Cleanup a few things on the way.

And move ges-track-element deprecations to a dedicated header file
2019-12-18 15:48:23 -03:00
Henry Wilkes
7b5f655c9a ges-source-clip: fixed return of duration setter
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.
2019-12-14 18:12:51 +00:00
Thibault Saunier
eabcaa1a56 pipeline: Ensure that encodebin enforces a single segment sent to encoders 2019-12-05 14:23:04 -03:00
Edward Hervey
0219631f5a xml-formatter: Free structure after usage
CID: 1416901
CID: 1439518
CID: 1439527
2019-11-20 07:52:56 +01:00
Edward Hervey
9e6be472a4 formatter: Free path object after usage
As it's done everywhere else

CID: 1455511
2019-11-20 07:46:47 +01:00
Niels De Graef
35d140ad92 Don't pass default GLib marshallers for signals
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.
2019-10-24 15:19:09 +02:00
Henry Wilkes
44420b2e56 marker: add color meta
Support optionally coloring markers by reserving GES_META_MARKER_COLOR
for an ARGB guint.
2019-10-24 09:45:19 +00:00
Henry Wilkes
e53b3fadf1 meta-container: add register_static_meta
Allows us to register a static meta without having to set a value.
2019-10-24 09:45:19 +00:00
Henry Wilkes
a70d0198df meta-container: move comment
The comment that was above _register_meta is actually meant for
_set_value.
2019-10-24 09:45:19 +00:00
Thibault Saunier
c5a2947afa ges-launch: Document timeline description format under --help
Making it simpler for user to get the documentation
2019-10-23 17:51:27 +02:00
Rico Tzschichholz
d760910448 marker-list: Use proper parameters names even in the docs
Otherwise there will be parameters with hyphen in their name in the GIR.
2019-10-22 22:51:41 +02:00
Thibault Saunier
8e145e7f32 ges: Handle empty marker lists 2019-10-22 19:55:01 +02:00
Thibault Saunier
fe96405692 validate: Tear down pipeline when openning a new project
Avoiding potential deadlock when we remove tracks on a playing pipeline
2019-10-22 19:25:09 +02:00
Thibault Saunier
64bb85e6a1 ges: Fix setting GError when adding children to containers
We were misusing assertion and not properly setting the GError value
2019-10-22 19:25:09 +02:00
Thibault Saunier
d58d992674 smart-video-mixer: Handle segment updates
We were basically ignoring any segment update which could potentially
lead to setting a wrong stream time leading to wrong alpha value
being used.
2019-10-22 19:25:09 +02:00
Thibault Saunier
5234885c8a pipeline: Be smarter about how we match encoding profiles and tracks 2019-10-21 10:25:25 +00:00
Henry Wilkes
cab4a52dde marker-list: add prev position to ::marker-moved
Additionally give the previous marker position in the
GESMarkerList::marker-moved signal, since a user may want to know
where a move was from.

Also, fixed the documentation for GESMarkerList::marker-added

https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/78
2019-10-16 17:58:15 +01:00
Tim-Philipp Müller
0c96b9dd10 Remove autotools build system
Todo:
 - hook up data/completions/ges-launch-1.0 in Meson (#77)
2019-10-13 13:54:19 +01:00
Sebastian Dröge
1d12f0b1a1 ges: Hide internal debug category behind a GOnce
Otherwise it might be used (e.g. by the plugin loader via the GES
plugin!) before ges_init() is called.
2019-10-02 08:52:57 +03:00
Thibault Saunier
e0f8b54a03 project: Add missing safe guard when listing assets 2019-09-30 12:58:24 +00:00
Thibault Saunier
29f25c6c43 launch: Add an option to embed nested timelines when saving 2019-09-30 12:58:24 +00:00
Henry Wilkes
6c3528fb4d xml-formatter: increase xges version to 0.6
Increase minor_version to 6 if a sub-project is saved under an asset or an asset includes a child stream-info element.
2019-09-23 18:49:42 +00:00
Thibault Saunier
d3e2cf55e3 tests: Fix transition project tests
Basically the test project was plain broken as it had fully overlapping
clips is prohibited since the timeline edition API was reimplemented.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/62
2019-08-28 13:51:02 +00:00
Thibault Saunier
8477a3236d asset: Fix asset cache for CLips and TrackElement with same ID
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.
2019-08-28 13:51:02 +00:00
Thibault Saunier
dcae483bca ges: Expose ges mixer to be used as effects 2019-08-28 13:51:02 +00:00
Thibault Saunier
99c44bdb34 ges: Add support for EffectClip assets 2019-08-28 13:51:02 +00:00
Matthew Waters
2e8528bb40 ges/timeline: remove unused function get_toplevel_container
Fixes -Werror build with clang:

../subprojects/gst-editing-services/ges/ges-timeline.c:695:1: warning: unused function 'get_toplevel_container' [-Wunused-function]
get_toplevel_container (gpointer element)
^
2019-08-27 03:58:42 +00:00
Thibault Saunier
cec6fef8b3 doc: Update cache and fix usage of <ulink> 2019-08-23 16:56:47 +00:00
Millan Castro
68288a76f7 markerlist: implement GESMarkerList
Co-authored by Mathieu Duponchelle <mathieu@centricular.com>
2019-08-22 21:24:02 +02:00
Henry Wilkes
f19bf3edb4 xml-formatter: strip "caps" from the "properties" attribute of a track
element

We already have the separate "caps" attribute for xges track
elements, which is actually used in parsing.
2019-08-19 19:54:21 +00:00
Henry Wilkes
bd3518abc5 xml-formatter: fix cb of ::error-loading-asset
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.
2019-08-19 19:20:31 +01:00
Henry Wilkes
4d60fcd7ff Test that gst_structure_get succeeds to ensure gchar *restriction is
actually set before reading it.
Warn if no caps are returned by gst_caps_from_string.
2019-08-16 17:03:06 +01:00
Thibault Saunier
448091583a structured-interface: Properly error out when a child property could not be set 2019-08-14 15:49:20 -04:00
Sebastian Dröge
894df73011 ges-xml-formatter: Use g_filename_to_uri() instead of deprecated gst_uri_construct()
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);
      |       ^~
2019-08-12 14:58:45 +00:00
Sebastian Dröge
5feeb35dba Fix old-style C function declarations
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 ()
      | ^~~~~~~~~~~~~~~~~
2019-08-12 14:58:45 +00:00
Thibault Saunier
91dd3e44a7 doc: Add some missing Since: 2019-08-12 10:10:22 -04:00
Thibault Saunier
96e022658e project: Properly handle NULL project asset ID 2019-08-11 21:20:21 -04:00
Thibault Saunier
ea043c2f0e structured: Enhance error message when no clip duration set 2019-07-30 18:24:07 -07:00
Thibault Saunier
43907adc1d structured-interface: Avoid setting invalid clip duration 2019-07-30 18:22:18 -07:00
Thibault Saunier
badede6d1c track: Add a getter for restriction_caps 2019-07-26 14:23:55 -04:00
Thibault Saunier
ea2b5bded8 track: Enhance restriction capsfilter name 2019-07-26 14:23:55 -04:00
Thibault Saunier
0d870428ed xml-formatter: Serialize DiscovererStreamInfo
We do not use it yet but it gives interesting information to
users
2019-07-26 14:23:55 -04:00
Thibault Saunier
955d177dd6 formatter: Plug lists of TimedValue leak 2019-07-26 13:48:52 -04:00
Thibault Saunier
2c9cbc6d06 formatter: Better document metadata registration
And fix xges mimetype to match typefind mimetype
2019-07-26 13:48:52 -04:00
Thibault Saunier
f51f2f70de gesdemux: Compute sinkpad caps based on formatter mimetypes
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)
2019-07-26 13:48:51 -04:00
Thibault Saunier
7caa424aaf formatter: Add a method to retrieve the best formatter for a givent URI
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.
2019-07-26 13:48:51 -04:00
Thibault Saunier
c5c451fc1c Implement a formatter based on [OpenTimelineIO]
[OpenTimelineIO]: http://opentimeline.io/
2019-07-26 13:48:51 -04:00
Thibault Saunier
451f67e3d6 formatter: Handle coma separated extensions in formatter metas 2019-07-26 13:48:51 -04:00
Thibault Saunier
fa7a5db1fc formatter: Duplicate const gchar* for metadatas 2019-07-26 13:48:51 -04:00
Thibault Saunier
d7b0e50b07 project: Expose the ges_project_add_formatter method
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.
2019-07-26 13:48:51 -04:00
Thibault Saunier
abb4f005e3 Mark nested timeline assets as such
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.
2019-07-26 13:48:51 -04:00