Commit graph

71 commits

Author SHA1 Message Date
Thibault Saunier
4c985b4155 ges: Fix reloading UriClipAsset synchronously
And add tests for that
2020-04-08 14:35:28 +01: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
dfe3b805f3 docs: update GESAsset 2020-03-05 17:04:51 -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
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
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
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
b8c897308d asset: Handle trying to proxy an asset to itself
And avoid infinite recursion
2019-07-15 10:30:44 -04:00
Thibault Saunier
5774d5256a assets: Recurse in the chain of proxies
When linking loaded proxies and trying to setup their targets
2019-06-16 23:20:12 -04:00
Thibault Saunier
5caf822526 docs: Minor fixes 2019-05-13 10:30:19 -04:00
Thibault Saunier
b09ed0d0c3 asset: Avoid unrefing a task we do not own 2019-04-18 16:44:41 -04:00
Thibault Saunier
6a0f2358ce asset: Do not take an extra ref on asset when already initialized
The task already has a ref so this one doesn't make sense and leads to leaks
2019-04-15 17:11:48 -04:00
Thibault Saunier
de7c0731f5 asset: Plug a GError leak 2019-04-15 17:11:48 -04:00
Thibault Saunier
61c14b6406 asset: s/unsure/ensure 2019-04-15 17:11:48 -04:00
Thibault Saunier
0dcf78f3ec asset: plug a GTask leak 2019-04-15 17:11:48 -04:00
Seungha Yang
41597dfdfd ges: Enhance ges_{init/deinit} documentation
Add some init/deinit related comment and make assertion when
ges_deinit() is called from unexpected thread.
2019-03-12 15:17:18 +00:00
Thibault Saunier
aa2f29bad3 s/accured/occurred/g 2019-01-29 00:06:32 +00:00
Seungha Yang
e1fff8f864 asset: Fix various leak 2019-01-18 20:32:02 +00:00
Seungha Yang
ef173bb7c4 ges: Cleanup internal hash table on deinit
System-wide once allocated but it makes tracing leak hard
2019-01-18 20:32:02 +00:00
Seungha Yang
691b6f6f04 asset: Use static lock
The mutex life cycle follows processs.
2019-01-18 20:32:02 +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
Mathieu Duponchelle
38a78651e2 asset: documentation fix 2018-06-26 16:21:22 +02:00
Edward Hervey
d91cc7e7b6 ges: Fix sizeof() usage
The entries of the array are "gchar *" and not "gchar **"

CID #1427091
CID #1427120
2018-01-11 10:57:30 +01:00
Edward Hervey
9a45d0ef85 ges: Fix a bunch of leaks
There are definitely more left, but don't have time for more debugging
2017-11-27 11:49:43 +01:00
Ashish Kumar
23e9044b4e GESAsset, GESLayer: add some function guards
https://bugzilla.gnome.org/show_bug.cgi?id=789521
2017-11-21 14:13:53 +01:00
Thibault Saunier
9a76617fc7 asset: Add a function to stop proxying an asset
And remove any reference as it beeing a proxy.
2017-07-31 13:14:04 -04:00
Thibault Saunier
eae6b70523 asset: Clear loading error when reload is requested 2017-07-31 13:03:59 -04:00
Thibault Saunier
88a5894fbd ges: Handle g_object_newv deprecation in latest GLib 2017-06-23 16:17:57 -04:00
Thibault Saunier
35256b47ff docs: Port all docstring to gtk-doc markdown 2017-03-08 18:13:48 -03:00
Alexandru Băluț
872d15eb9d asset: Fix set_proxy to abort when an error happens
Differential Revision: https://phabricator.freedesktop.org/D1574
2017-01-09 11:43:13 -03:00
Alexandru Băluț
6b9faec7dc asset: Reuse local variable
Differential Revision: https://phabricator.freedesktop.org/D1573
2017-01-09 11:43:11 -03: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
Aurélien Zanelli
dc95299080 asset: fix ges_asset_set_proxy() return value documentation
https://bugzilla.gnome.org/show_bug.cgi?id=766459
2016-05-14 20:36:07 -03:00
Sebastian Dröge
7500fab036 ges-asset: Don't dereference NULL proxy assets when resolving fails
CID 1346531
2015-12-29 18:08:03 +02:00
Sebastian Dröge
4997c455f4 ges: Fix various g-i warnings 2015-12-26 09:43:23 +01:00
Thibault Saunier
f473386b88 asset: Add a way to set asset as "needing reload"
Allowing application to force the asset system to recheck if an
asset has been "fixed" and can be used again

API:
    + ges_asset_needs_reload

Differential Revision: https://phabricator.freedesktop.org/D584
2015-12-10 14:48:08 +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
5e069976f6 asset: Add a method to retrieve the GError of an asset loaded with error
API:
    ges_asset_get_error
2015-11-08 22:56:41 +01:00
Justin Kim
8bce0baf62 asset: simplify if-statement in cache_set_loaded
Summary:
Manual iteration can be replaced with foreach function.
In addition, this patch fixes mismatched GFunc type for
g_list_foreach and adds debug cateory for gst-asset for
convenient debugging.

Reviewers: thiblahute

Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D312
2015-10-02 16:19:14 +02:00
Thibault Saunier
724418b75d assets: Avoid deadlock when done initialising asset
Avoid to hold the CACHE lock when setting the GTasks return values.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=752300
2015-07-13 13:54:35 +02:00
Thibault Saunier
7be28b29b2 asset: Port use of deprecated GSimpleAsyncResult to GTask 2015-07-06 10:32:32 +02:00
Thibault Saunier
a1bf40b9e1 ges: Assert if an asset is not in the global hashtable
COVERITY CID 1151679
2014-05-10 22:38:21 +02:00
Christoph Reiter
a66e674649 Include class related section documentation in the gir file.
g-ir-scanner includes section docs as class/interface docs if the section name is equal to the lowercase type name.
Since all the documentation is in section blocks, rename them to match the type names.

https://bugzilla.gnome.org/show_bug.cgi?id=727776
2014-04-07 22:13:25 +02:00
Alexandru Băluț
eef3861272 Minor documentation fixes: GESExtractable, GESAsset 2014-02-27 09:54:41 +01:00
Thibault Saunier
94dbf20400 ges-asset: Do not forget to give a ref to the registry
+ Add test in the testsuite
+ Fix broken tests

https://bugzilla.gnome.org/show_bug.cgi?id=721111
2014-01-30 22:27:54 +01:00