GUINT_TO_POINTER (g_ascii_strtoll (func_udata[1], NULL, 10)));
params[2].name = "supported-formats";
- g_value_init (¶ms[2].value, G_TYPE_ENUM);
- g_value_set_enum (¶ms[2].value, GES_TRACK_TYPE_CUSTOM);
+ g_value_init (¶ms[2].value, GES_TYPE_TRACK_TYPE);
+ g_value_set_flags (¶ms[2].value, GES_TRACK_TYPE_CUSTOM);
g_strfreev (func_udata);
gpointer user_data)
{
GESCustomSourceClip *src;
+ GESAsset *asset = ges_asset_custom_source_clip_new (func, user_data);
- src = g_object_new (GES_TYPE_CUSTOM_SOURCE_CLIP, "supported-formats",
- GES_TRACK_TYPE_CUSTOM, NULL);
- src->priv->filltrackelementfunc = func;
- src->priv->user_data = user_data;
+ src = GES_CUSTOM_SOURCE_CLIP (ges_asset_extract (asset, NULL));
+ gst_object_unref (asset);
return src;
}
ges_effect_clip_new (const gchar * video_bin_description,
const gchar * audio_bin_description)
{
+ /* FIXME Handle GESAsset! */
return g_object_new (GES_TYPE_EFFECT_CLIP,
"video-bin-description", video_bin_description,
"audio-bin-description", audio_bin_description, NULL);
GESTestClip *
ges_test_clip_new (void)
{
- /* FIXME : Check for validity/existence of URI */
- return g_object_new (GES_TYPE_TEST_CLIP, NULL);
+ GESTestClip *new_clip;
+ GESAsset *asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
+
+ new_clip = GES_TEST_CLIP (ges_asset_extract (asset, NULL));
+ g_object_unref (asset);
+
+ return new_clip;
}
/**
value = g_enum_get_value_by_nick (klass, nick);
if (value) {
- ret = g_object_new (GES_TYPE_TEST_CLIP, "vpattern",
- (gint) value->value, NULL);
+ ret = ges_test_clip_new ();
+ ges_test_clip_set_vpattern (ret, value->value);
}
g_type_class_unref (klass);
GESTextOverlayClip *
ges_text_overlay_clip_new (void)
{
- /* FIXME : Check for validity/existence of URI */
- return g_object_new (GES_TYPE_OVERLAY_TEXT_CLIP, NULL);
+ GESTextOverlayClip *new_clip;
+ GESAsset *asset = ges_asset_request (GES_TYPE_OVERLAY_TEXT_CLIP, NULL, NULL);
+
+ new_clip = GES_OVERLAY_TEXT_CLIP (ges_asset_extract (asset, NULL));
+ g_object_unref (asset);
+
+ return new_clip;
}
GESTitleClip *
ges_title_clip_new (void)
{
- /* FIXME : Check for validity/existence of URI */
- return g_object_new (GES_TYPE_TITLE_CLIP, NULL);
+ GESTitleClip *new_clip;
+ GESAsset *asset = ges_asset_request (GES_TYPE_TITLE_CLIP, NULL, NULL);
+
+ new_clip = GES_TITLE_CLIP (ges_asset_extract (asset, NULL));
+ g_object_unref (asset);
+
+ return new_clip;
}
GESTransitionClip *
ges_transition_clip_new (GESVideoStandardTransitionType vtype)
{
- return g_object_new (GES_TYPE_TRANSITION_CLIP, "vtype", (gint) vtype, NULL);
+ GEnumValue *value;
+ GEnumClass *klass;
+ GESTransitionClip *ret = NULL;
+
+ klass =
+ G_ENUM_CLASS (g_type_class_ref (GES_VIDEO_STANDARD_TRANSITION_TYPE_TYPE));
+ if (!klass) {
+ GST_ERROR ("Could not find the StandarTransitionType enum class");
+ return NULL;
+ }
+
+ value = g_enum_get_value (klass, vtype);
+ if (!value) {
+ GST_ERROR ("Could not find enum value for %i", vtype);
+ return NULL;
+ }
+
+ ret = ges_transition_clip_new_for_nick (((gchar *) value->value_nick));
+ g_type_class_unref (klass);
+
+ return ret;
}
/**
GESTransitionClip *
ges_transition_clip_new_for_nick (gchar * nick)
{
- GEnumValue *value;
- GEnumClass *klass;
GESTransitionClip *ret = NULL;
+ GESAsset *asset = ges_asset_request (GES_TYPE_TRANSITION_CLIP, nick, NULL);
- klass =
- G_ENUM_CLASS (g_type_class_ref (GES_VIDEO_STANDARD_TRANSITION_TYPE_TYPE));
- if (!klass)
- return NULL;
+ if (asset != NULL) {
+ ret = GES_TRANSITION_CLIP (ges_asset_extract (asset, NULL));
- value = g_enum_get_value_by_nick (klass, nick);
- if (value) {
- ret = g_object_new (GES_TYPE_TRANSITION_CLIP, "vtype",
- (gint) value->value, NULL);
- }
+ gst_object_unref (asset);
+ } else
+ GST_WARNING ("No asset found for nick: %s", nick);
- g_type_class_unref (klass);
return ret;
}