I needed to cast GESUriClipAsset to GESAsset using GES_ASSET(asset).
What is more here is the C example of playing file in GES, when the program argument is the address to video file (might leak memory) (most of the code is taken from test1.c):
#include <ges/ges.h>
int main (int argc, gchar ** argv)
{
GESAsset *src_asset;
GESPipeline *pipeline;
GESTimeline *timeline;
GESClip *source;
GESLayer *layer;
GMainLoop *mainloop;
GError **error;
gchar *uri;
GESUriClipAsset *asset;
/* Initialize GStreamer (this will parse environment variables and commandline
* arguments. */
gst_init (&argc, &argv);
/* Initialize the GStreamer Editing Services */
ges_init ();
/* Setup of a A/V timeline */
/* This is our main GESTimeline */
timeline = ges_timeline_new_audio_video ();
/* We are only going to be doing one layer of clips */
layer = ges_layer_new ();
/* Add the tracks and the layer to the timeline */
if (!ges_timeline_add_layer (timeline, layer))
return -1;
/* We create a simple asset able to extract GESTestClip */
uri = gst_filename_to_uri (argv[1], NULL);
asset = ges_uri_clip_asset_request_sync(uri,error);
src_asset = GES_ASSET(asset);
/* Add sources to our layer */
ges_layer_add_asset (layer, src_asset, 0, 0, 4*GST_SECOND,
GES_TRACK_TYPE_UNKNOWN);
/* In order to view our timeline, let's grab a convenience pipeline to put
* our timeline in. */
pipeline = ges_pipeline_new ();
/* Add the timeline to that pipeline */
if (!ges_pipeline_set_timeline (pipeline, timeline))
return -1;
/* The following is standard usage of a GStreamer pipeline (note how you haven't
* had to care about GStreamer so far ?).
*
* We set the pipeline to playing ... */
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
/* .. and we start a GMainLoop. GES **REQUIRES** a GMainLoop to be running in
* order to function properly ! */
mainloop = g_main_loop_new (NULL, FALSE);
/* Simple code to have the mainloop shutdown after 4s */
g_timeout_add_seconds (4, (GSourceFunc) g_main_loop_quit, mainloop);
g_main_loop_run (mainloop);
return 0;
}