Fixed several GES examples, but confused with GESAsset and GESClip
Guofeng Zhang
guofengzh at auslides.com
Mon Nov 9 06:19:34 PST 2015
see the attached.
note:
1. It is 1.6.1 release
2. for it to work, I merged your fix
"5f81e64b596d3234406df75ccfde11009c422729" about ges_uri_clip_new().
On 2015/11/9 20:17, Thibault Saunier wrote:
> Hello,
>
> Please provide patches when you fix bugs in the examples :)
>
> Regards,
>
> Thibault
>
> On Mon, Nov 9, 2015 at 1:06 PM, Guofeng Zhang <guofengzh at auslides.com> wrote:
>> Thibault,
>>
>> Your are right, adding
>> ges_timeline_commit (timeline);
>> before setting the pipepline to PLAYING solve it.
>>
>> Thanks very much for your help.
>>
>> Guofeng
>>
>>
>>
>> On 2015/11/9 4:28, Thibault Saunier wrote:
>>> Hello,
>>>
>>> GES will add testsrc for gaps yes. No idea why it would not work. Make
>>> sure the timeline is commited in that example.
>>>
>>> Regards,
>>>
>>> Thibault
>>>
>>> On Sun, Nov 8, 2015 at 5:18 PM, Guofeng Zhang <guofengzh at auslides.com>
>>> wrote:
>>>> Thibault
>>>>
>>>> For the simple1.c, If I change the value of the start property to a
>>>> non-zero
>>>> value, for example, 1 second, I heard nothing. If I reset its value to 0,
>>>> it
>>>> works as expected.
>>>>
>>>> Does this mean that I should make sure that there is not any gap in the
>>>> timeline? I think GES will use audiotestsrc for the audio gap, am I
>>>> right?
>>>>
>>>> Thanks for your help.
>>>>
>>>> Guofeng
>>>>
>>>>
>>>> On 2015/10/30 18:14, Thibault Saunier wrote:
>>>>> Hello Guofeng,
>>>>>
>>>>>> test1.c worked well, it use:
>>>>>> GESAsset *src_asset;
>>>>>> ...
>>>>>> src_asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
>>>>>> to instantiate a GESTestClip.
>>>>>>
>>>>>> but test2.c and simple1.c does not work. They all use
>>>>>> GESUriClip *src = ges_uri_clip_new (uri);
>>>>> I just fixed that with:
>>>>>
>>>>> commit 5f81e64b596d3234406df75ccfde11009c422729
>>>>> Author: Thibault Saunier <tsaunier at gnome.org>
>>>>> Date: Fri Oct 30 10:52:12 2015 +0100
>>>>>
>>>>> uri-clip: Make sure to instantiate an asset to back
>>>>> GESUriClip-s
>>>>>
>>>>>
>>>>>> I tried to use
>>>>>> GESAsset *src = ges_asset_request (GES_TYPE_URI_CLIP, uri, NULL);
>>>>>> but not succeeded.
>>>>>>
>>>>>> The comment for ges_asset_request() describes that I should use
>>>>>> ges_uri_clip_asset_request_sync, so I made the following change:
>>>>>> GESAsset *src = ges_uri_clip_asset_request_sync( uri, &error) ;
>>>>>> ...
>>>>>> ges_layer_add_asset (layer, src, offset, 0, 5 * GST_SECOND,
>>>>>> GES_TRACK_TYPE_AUDIO);
>>>>>> Now test2.c and simple1.c worked well.
>>>>> That is the correct way of doing it (GESUriClipAsset is a special case
>>>>> as
>>>>> we concider in most cases it should be created async), we still let the
>>>>> user
>>>>> create it synchronously with that helper.
>>>>>
>>>>>> What make me confused is
>>>>>> (1) ges_uri_clip_asset_request_sync() also use
>>>>>> ges_asset_request (GES_TYPE_URI_CLIP, uri, &lerror)
>>>>>> to instantiate the GESAsset, but it works (mine not), why?
>>>>> ges_uri_clip_asset_request_sync does ges_asset_request to check if the
>>>>> media file
>>>>> has already been discovered in which case it just uses the cached asset,
>>>>> in the case it is not it will go through a particular mechanism of
>>>>> synchronous
>>>>> discovery.
>>>>>
>>>>>> (2) The GESTAsset and GESClip has one to one relationship, that is, as
>>>>>> documented that assets will represent for example a GESUriClips,
>>>>>> GESBaseEffect etc.
>>>>>> each clip has a asset associated with it. But GESTestClip has no
>>>>>> GESTestClipAsset (something like it) defined, how could an asset
>>>>>> existed
>>>>>> for
>>>>>> GESTestClip? or testsrc does not need a resource to represent it, so it
>>>>>> does
>>>>>> not need a corresponding asset? if so, for appsrc, I could only define
>>>>>> a
>>>>>> clip for it and it will work with the GES framework?
>>>>> GESTestClip does not need a specialized asset to represent it, so in
>>>>> that case we
>>>>> just use the standard GESAsset (not a subclass of it).
>>>>>
>>>>> Hoping that answers your questions.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Thibault
>>>>> _______________________________________________
>>>>> gstreamer-devel mailing list
>>>>> gstreamer-devel at lists.freedesktop.org
>>>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>>
>>>> _______________________________________________
>>>> gstreamer-devel mailing list
>>>> gstreamer-devel at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
--- simple1.c 2015-10-22 16:09:39.000000000 +0800
+++ simple1-new.c 2015-11-09 22:11:07.688855568 +0800
@@ -95,6 +95,9 @@
g_object_set (src, "start", 0, "in-point", inpoint * GST_SECOND,
"duration", duration * GST_SECOND, "mute", mute, NULL);
ges_layer_add_clip (layer1, GES_CLIP (src));
+
+ /* commit the timeline. it is required when the value of the start property is not 0 */
+ ges_timeline_commit (timeline);
}
/* Play the pipeline */
More information about the gstreamer-devel
mailing list