mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-30 07:42:32 +00:00
uri-asset: Add a way to control discoverer timeout through envvar
Making it possible to run ges-launch test under valgrind for example
This commit is contained in:
parent
967bb50814
commit
4f83cde172
1 changed files with 15 additions and 2 deletions
|
@ -27,6 +27,7 @@
|
||||||
* let you get information about the medias. Also, the tags found in the media file are
|
* let you get information about the medias. Also, the tags found in the media file are
|
||||||
* set as Metadatas of the Asser.
|
* set as Metadatas of the Asser.
|
||||||
*/
|
*/
|
||||||
|
#include <errno.h>
|
||||||
#include <gst/pbutils/pbutils.h>
|
#include <gst/pbutils/pbutils.h>
|
||||||
#include "ges.h"
|
#include "ges.h"
|
||||||
#include "ges-internal.h"
|
#include "ges-internal.h"
|
||||||
|
@ -181,6 +182,8 @@ _asset_proxied (GESAsset * self, const gchar * new_uri)
|
||||||
static void
|
static void
|
||||||
ges_uri_clip_asset_class_init (GESUriClipAssetClass * klass)
|
ges_uri_clip_asset_class_init (GESUriClipAssetClass * klass)
|
||||||
{
|
{
|
||||||
|
GstClockTime timeout;
|
||||||
|
const gchar *timeout_str;
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
g_type_class_add_private (klass, sizeof (GESUriClipAssetPrivate));
|
g_type_class_add_private (klass, sizeof (GESUriClipAssetPrivate));
|
||||||
|
|
||||||
|
@ -203,8 +206,18 @@ ges_uri_clip_asset_class_init (GESUriClipAssetClass * klass)
|
||||||
g_object_class_install_property (object_class, PROP_DURATION,
|
g_object_class_install_property (object_class, PROP_DURATION,
|
||||||
properties[PROP_DURATION]);
|
properties[PROP_DURATION]);
|
||||||
|
|
||||||
klass->discoverer = gst_discoverer_new (GST_SECOND, NULL);
|
errno = 0;
|
||||||
klass->sync_discoverer = gst_discoverer_new (GST_SECOND, NULL);
|
timeout_str = g_getenv ("GES_DISCOVERY_TIMEOUT");
|
||||||
|
if (timeout_str)
|
||||||
|
timeout = g_ascii_strtod (timeout_str, NULL) * GST_SECOND;
|
||||||
|
else
|
||||||
|
errno = 10;
|
||||||
|
|
||||||
|
if (errno)
|
||||||
|
timeout = GST_SECOND;
|
||||||
|
|
||||||
|
klass->discoverer = gst_discoverer_new (timeout, NULL);
|
||||||
|
klass->sync_discoverer = gst_discoverer_new (timeout, NULL);
|
||||||
g_signal_connect (klass->discoverer, "discovered",
|
g_signal_connect (klass->discoverer, "discovered",
|
||||||
G_CALLBACK (discoverer_discovered_cb), NULL);
|
G_CALLBACK (discoverer_discovered_cb), NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue