Is there any example to subclass GstSystemClock?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there any example to subclass GstSystemClock?

Halley Zhao
Hi Expert:
I want to reuse gst codec in another media framework.
(yes, it is something odd, but it is my fact. i have existing player and media framework; but I want to reuse hw codec plugins of gstreamer -- most SoC vendor release Linux BSP with gstreamer hw codec plugins).

the way I want to try is: construct a short gst pipeline: appsrc-->videodecode-->videosink;
then I can get video frames from my player and feed them to gstreamer hw codec and render through appsrc.
comments are welcomed, thanks.

next, I need control a/v sycn, where audio rendering happens in my existing player, while video rendering happens in gst pipeline.
I want to create a GstClock (subclass from GstSystemClock) which generate timeline from my player's audio rendering, then use the clock to control the video rendering by gst_pipeline_set_clock().

so, my question is:
is there any guidance to subclass GstSystemClock?
is there any example code?

thanks.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there any example to subclass GstSystemClock?

Krzysztof Konopko-3
Hi,

Might not be exactly your use case, but at least you might get some inspiration from something that was used to "synchronise" two different clock domains (GStreamer and VCOS on RPi).

Cheers,
Kris

On Fri, 2019-04-12 at 19:44 +0800, Halley Zhao wrote:
Hi Expert:
I want to reuse gst codec in another media framework.
(yes, it is something odd, but it is my fact. i have existing player and media framework; but I want to reuse hw codec plugins of gstreamer -- most SoC vendor release Linux BSP with gstreamer hw codec plugins).

the way I want to try is: construct a short gst pipeline: appsrc-->videodecode-->videosink;
then I can get video frames from my player and feed them to gstreamer hw codec and render through appsrc.
comments are welcomed, thanks.

next, I need control a/v sycn, where audio rendering happens in my existing player, while video rendering happens in gst pipeline.
I want to create a GstClock (subclass from GstSystemClock) which generate timeline from my player's audio rendering, then use the clock to control the video rendering by gst_pipeline_set_clock().

so, my question is:
is there any guidance to subclass GstSystemClock?
is there any example code?

thanks.

_______________________________________________
gstreamer-devel mailing list
[hidden email]

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there any example to subclass GstSystemClock?

Halley Zhao
thanks, it helps me understand GstClock.

then, I will subclass GstSystemClock, then override get_internal_time func to provide time by my existing player.



Krzysztof Konopko <[hidden email]> 于2019年4月12日周五 下午9:28写道:
Hi,

Might not be exactly your use case, but at least you might get some inspiration from something that was used to "synchronise" two different clock domains (GStreamer and VCOS on RPi).

Cheers,
Kris

On Fri, 2019-04-12 at 19:44 +0800, Halley Zhao wrote:
Hi Expert:
I want to reuse gst codec in another media framework.
(yes, it is something odd, but it is my fact. i have existing player and media framework; but I want to reuse hw codec plugins of gstreamer -- most SoC vendor release Linux BSP with gstreamer hw codec plugins).

the way I want to try is: construct a short gst pipeline: appsrc-->videodecode-->videosink;
then I can get video frames from my player and feed them to gstreamer hw codec and render through appsrc.
comments are welcomed, thanks.

next, I need control a/v sycn, where audio rendering happens in my existing player, while video rendering happens in gst pipeline.
I want to create a GstClock (subclass from GstSystemClock) which generate timeline from my player's audio rendering, then use the clock to control the video rendering by gst_pipeline_set_clock().

so, my question is:
is there any guidance to subclass GstSystemClock?
is there any example code?

thanks.

_______________________________________________
gstreamer-devel mailing list
[hidden email]

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there any example to subclass GstSystemClock?

Halley Zhao
I looked into GstAudioClock, pulsesink; and find that the simple solution may be creating a GstAudioClock with customized GstAudioClockGetTimeFunc.
expect it will work for me.

  GST_AUDIO_BASE_SINK (pulsesink)->provided_clock =
      gst_audio_clock_new ("GstPulseSinkClock",
      (GstAudioClockGetTimeFunc) gst_pulsesink_get_time, pulsesink, NULL);


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there any example to subclass GstSystemClock?

yuan.fang
hi expert

I met a same problem with you, do you have an example or guidance to
subclass a  GstSystemClock now?

Thanks!
Halley Zhao wrote

> I looked into GstAudioClock, pulsesink; and find that the simple solution
> may be creating a GstAudioClock with customized GstAudioClockGetTimeFunc.
> expect it will work for me.
>
>   GST_AUDIO_BASE_SINK (pulsesink)->provided_clock =
>       gst_audio_clock_new ("GstPulseSinkClock",
>       (GstAudioClockGetTimeFunc) gst_pulsesink_get_time, pulsesink, NULL);
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there any example to subclass GstSystemClock?

Halley Zhao
In reply to this post by Halley Zhao
I create a clock like following:
mGstClock = GST_AUDIO_CLOCK(gst_audio_clock_new("my_clock_name", (GstAudioClockGetTimeFunc)getMyClockTimeForGst, this, NULL/*GDestroyNotify destroy_notify*/));

yuan.fang <[hidden email]> 于2019年5月28日周二 下午9:10写道:
Hi expert

I met a same issue with you , have you get an example or guidance to
subclass GstSystemClock?

Thanks!
Halley Zhao wrote
> I looked into GstAudioClock, pulsesink; and find that the simple solution
> may be creating a GstAudioClock with customized GstAudioClockGetTimeFunc.
> expect it will work for me.
>
>   GST_AUDIO_BASE_SINK (pulsesink)->provided_clock =
>       gst_audio_clock_new ("GstPulseSinkClock",
>       (GstAudioClockGetTimeFunc) gst_pulsesink_get_time, pulsesink, NULL);
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there any example to subclass GstSystemClock?

yuan.fang
Thanks Halley, it helps me a lot.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel