Commit graph

75 commits

Author SHA1 Message Date
Henry Wilkes 9161c2efcb asset: unref requested assets
Prevent a few memory leaks in the tests.

Also mark ges_project_save as transfer full for the formatter asset.

Also make sure that ges_project_request_sync is transfer full on the
returned asset.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/104

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
2020-05-07 10:06:52 +01:00
Thibault Saunier d1444581f6 asset: Avoid dereferencing NULL pointer
CID 1461286
2020-04-10 11:12:12 -04:00
Thibault Saunier 5ea914a575 project: Do not warn when resetting URI to the same one 2020-03-09 11:49:02 -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
Thibault Saunier 4e4473ef8f ges: Plug leaks in new ges-launch and related 2020-02-25 17:44:51 -03: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
Thibault Saunier e0f8b54a03 project: Add missing safe guard when listing assets 2019-09-30 12:58:24 +00: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
Thibault Saunier 96e022658e project: Properly handle NULL project asset ID 2019-08-11 21:20:21 -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 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 6f9e6d3586 formatter: Enhance error reporting
And add a "loading-error" signal in GESProject so we can report
issue when loading async elements for the timeline.
2019-07-26 13:48:51 -04:00
Thibault Saunier 5847c6e5ed ges: Implement our own idle_add which uses the thread local maincontext 2019-07-26 13:48:51 -04:00
Thibault Saunier cb1ee4b641 project: Use asset ID as URI if possible
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.
2019-07-26 13:48:51 -04:00
Thibault Saunier a5fa2c35aa ges: Implement subprojects
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
2019-07-26 13:48:48 -04:00
Thibault Saunier 5f3adbc1a3 project: Fix our asset cache
It was not talking into account the fact that you can have
several assets with a same ID but different exactractable types.
2019-07-24 10:49:38 -04:00
Thibault Saunier 85e966963e project: Add a signal to notify when a new timeline is starting to load 2019-05-23 18:54:42 -04:00
Thibault Saunier 5caf822526 docs: Minor fixes 2019-05-13 10:30:19 -04:00
Thibault Saunier 2d8be79cb7 xml-formatter: Fix some asset leaks 2019-04-15 17:11:48 -04:00
Thibault Saunier 5c54ba55b7 Plug some GError leaks when loading assets 2019-04-15 17:11:48 -04:00
Thibault Saunier 9d4e0640c7 asset: Plug a leak of EncodingProfiles 2019-04-15 17:11:48 -04:00
Thibault Saunier aa2f29bad3 s/accured/occurred/g 2019-01-29 00:06:32 +00:00
Thibault Saunier bad64296d9 uri-asset: Use the same code path for sync discovery as the async one
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)
2019-01-29 00:06:32 +00:00
Tim-Philipp Müller a7347ca8f7 WIP: ges: fix API export/import and 'inconsistent linkage' on MSVC
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
2018-12-15 00:14:51 +00:00
Thibault Saunier 13b8c8554d Update for g_type_class_add_private() deprecation in recent GLib 2018-09-05 22:57:27 -03:00
Thibault Saunier 5f5cbd111c project: Compute relocation URIs in missing-uri signal
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
2018-07-27 22:56:23 -04:00
Thibault Saunier ad4eb9a065 project: Do not emit 'error-loading-asset' when we are trying to update the ID 2018-07-21 12:02:35 -04:00
Thibault Saunier 35256b47ff docs: Port all docstring to gtk-doc markdown 2017-03-08 18:13:48 -03:00
Sebastian Dröge 1c6893c57d ges-project: Check for set/unset error correctly by dereferencing
... or simply calling g_clear_error() on it which does that for us.

CID 1257630
2017-02-28 12:59:35 +02:00
Justin Kim ee2697be46 project_: improve get_uri doc
The return value of ges_project_get_uri should be freed
after usage.
Differential Revision: https://phabricator.freedesktop.org/D1142
2016-06-29 09:02:07 -04:00
Aurélien Zanelli 813c4b4fb7 ges: add some g-i annotations according to documentation
Mainly (transfer xxx) and (nullable). Also fix some typo.

https://bugzilla.gnome.org/show_bug.cgi?id=766459
2016-05-14 20:36:07 -03:00
Sebastian Dröge 4997c455f4 ges: Fix various g-i warnings 2015-12-26 09:43:23 +01:00
Thibault Saunier d38536ab18 Revert "project: Call asset_added in the first signal emition stage"
This reverts commit 08f927ca68.

That commit was breaking the API and could break other people's code.
2015-12-11 15:21:43 +01:00
Thibault Saunier 08f927ca68 project: Call asset_added in the first signal emition stage
Differential Revision: https://phabricator.freedesktop.org/D520
2015-12-10 14:48:05 +01:00
Thibault Saunier fa512ecdba Implement asset proxying support
API:
  ges_asset_set_proxy
  ges_asset_get_proxy
  ges_asset_list_proxies
  ges_asset_get_proxy_target

Differential Revision: https://phabricator.freedesktop.org/D504
2015-12-10 14:48:02 +01:00
Thibault Saunier 5d82971eef project: Add a 'asset-loading' signal 2015-11-08 22:56:41 +01:00
Justin Kim 807437f9fe project: fix a pointer for error message
https://bugzilla.gnome.org/show_bug.cgi?id=755862
2015-09-30 12:00:16 +02:00
Justin Kim ecb2a7c820 project: don't leak GFileInfo
https://bugzilla.gnome.org/show_bug.cgi?id=755862
2015-09-30 12:00:16 +02:00
Mathieu Duponchelle 47f1713f1e ges-project: Surface a meaningful error when no suitable formatter.
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D67
2015-04-07 14:15:36 +02:00
Thibault Saunier d114cc60bd ges: Do not clear potentially NULL errors
And avoid dereferencing NULL errors
2015-03-23 12:41:00 +01:00
Thibault Saunier 28a1e97aa2 ges: Factor out a GESCommandLineFormatter class
This formatter will allow any user to deserialize a timeline using
the new ges-launch command line interface
2015-03-20 13:53:42 +01:00
Luis de Bethencourt 8b4b2562a6 project: remove unnecessary dereference
g_clear_error() already dereferences the error pointer, no need to manually
check and do it.

CID #1257630
2015-03-05 13:53:32 +00:00
Mathieu Duponchelle 6321a9135f ges-project: no need to commit an empty timeline.
Summary: Can lead to deadlocks if the user commits at the same time.

Test Plan: Ran make check, it worked

Reviewers: tsaunier
2015-02-19 18:24:39 +01:00
Thibault Saunier 7c6ad5e3ba validate: Add an action type to load a project from its content 2014-12-12 12:07:01 +01:00
Thibault Saunier 3b353be8ea ges: Keep backward compatibility for relocated assets CLI
Meaning adding an API for user to add relacation URI paths

API:
    ges_add_missing_uri_relocation_uri
2014-12-06 10:34:16 +01:00
Thibault Saunier 55c88a726e project: Add a method to create assets synchronously
This allows to create a add an asset to a project in a
synchronous way.

API:
  ges_project_create_asset_sync

https://bugzilla.gnome.org/show_bug.cgi?id=740716
2014-12-06 10:34:15 +01:00
Thibault Saunier 58d525a4e7 ges: Add an init option to set media paths for moved assets
Allowing user to easily set a set of paths to look for moved
assets instead of needing the to re implement that logic
over and over.

https://bugzilla.gnome.org/show_bug.cgi?id=740714
2014-12-06 10:34:15 +01:00
Thibault Saunier e8fd816e33 project: Do not concider adding am already tracked asset as failure
It is not really a failure, just a special case.
2014-11-10 16:22:39 +01:00
Thibault Saunier 0d54d796de ges: Avoid to always commit when a project is loaded
In case we are not in a PLAYING state and the project is loaded, the
only thing that should be done is to fill the gaps and this way when the
composition get to PLAYING, their initialization will be enough to get
everything on track.
2014-10-31 11:58:12 +01:00
Tim-Philipp Müller 3e02157f02 project: fix string leak 2014-10-26 20:27:29 +00:00