www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - GStreamer and D

reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
Has anyone got any examples of using GStreamer from D. I found that
GtkD packages a GStreamer API which is great, but there are very few
example codes =E2=80=93 at least that I have found.

--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Feb 26 2016
parent reply Kagamin <spam here.lot> writes:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.htm
#section-helloworld - Hello world.
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/ma
ual/html/index.html - GStreamer Application Development Manual
http://docs.gstreamer.com/display/GstSDK/Basic+tutorials - Basic 
tutorials.
Feb 26 2016
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Fri, 2016-02-26 at 14:40 +0000, Kagamin via Digitalmars-d-learn
wrote:
 https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html
 /chapter-helloworld.html#section-helloworld - Hello world.
 https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html
 /index.html - GStreamer Application Development Manual
 http://docs.gstreamer.com/display/GstSDK/Basic+tutorials - Basic=C2=A0
 tutorials.
This is the C documentation, the issue I have is about the D wrapper and some idiomatic usage examples of it. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Feb 26 2016
parent reply Jay Norwood <jayn prismnet.com> writes:
wow! I hadn't tried this gtkd library before. I was hunting for 
the gstreamer in particular.

The hello_world alsa-sink audio example failed on Windows.  The 
debugger indicates no sink, which I guess is reasonable.

With very little effort, though, I converted the hello_world 
example to generate a video test pattern and use vidoeconvert and 
autovideosink, and that popped up right away on Windows in a 64 
bit build ... so, nice going!

The gstreamer example built without error in msvc 2013 with 
visualD and DMD32 D Compiler v2.073.2
Jun 15 2017
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Thu, 2017-06-15 at 19:27 +0000, Jay Norwood via Digitalmars-d-learn
wrote:
 wow! I hadn't tried this gtkd library before. I was hunting for=20
 the gstreamer in particular.
Welcome to the group of people using GStreamer from D. I suspect I may be the only other member of that club.
 The hello_world alsa-sink audio example failed on Windows.  The=20
 debugger indicates no sink, which I guess is reasonable.
Ah the word Windows. I use only Debian Sid and Fedora Rawhide, with occasional descent into some ancient version of MacOS (Apple refuse to upgrade older laptops, some agist excuse ;-) so I can't help with anything platform specific relating to Windows.=20 Both Debian Sid and Fedora Rawhide have packages for GStreamer and LDC so installation is very easy.
 With very little effort, though, I converted the hello_world=20
 example to generate a video test pattern and use vidoeconvert and=20
 autovideosink, and that popped up right away on Windows in a 64=20
 bit build ... so, nice going!
=20
 The gstreamer example built without error in msvc 2013 with=20
 visualD and DMD32 D Compiler v2.073.2
DMD is not packaged for Debian, but there is D-Apt so it is available, or Fedora, so LDC tends to be the "go to" D compiler. I haven't tried the example codes, but My GStreamer programs in D work nicely. I am just starting to rewrite Me TV from C++14 to D. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 15 2017
parent reply Jay Norwood <jayn prismnet.com> writes:
On Friday, 16 June 2017 at 06:45:38 UTC, Russel Winder wrote:
 Welcome to the group of people using GStreamer from D. I 
 suspect I may be the only other member of that club.
Looks like gst-inspect hasn't been ported... I'm looking at that now.
Jun 16 2017
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Fri, 2017-06-16 at 16:11 +0000, Jay Norwood via Digitalmars-d-learn
wrote:
 On Friday, 16 June 2017 at 06:45:38 UTC, Russel Winder wrote:
 Welcome to the group of people using GStreamer from D. I=20
 suspect I may be the only other member of that club.
=20 Looks like gst-inspect hasn't been ported... I'm looking at that=20 now.
gst-inspect-1.0 is an executable that comes with the installation, however that is done. What are you thinking of when saying "ported"? --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 16 2017
parent reply Jay Norwood <jayn prismnet.com> writes:
On Friday, 16 June 2017 at 16:33:56 UTC, Russel Winder wrote:

 gst-inspect-1.0 is an executable that comes with the 
 installation, however that is done. What are you thinking of 
 when saying "ported"?
gst-inspect is a good demonstration of iteration through the available gstreamer elements and their options. I want to modify that code to generate a model that could be used for persisting a pipeline configuration. https://github.com/GStreamer/gstreamer/blob/master/tools/gst-inspect.c So far, I've looked up about 80 calls used in that program, and only these few don't have c aliases in the d interfaces. I haven't looked to see if these are macros, or perhaps I could be looking at an incompatible version of gst-inspect.c. Anyway, looks pretty good so far. gst_plugin_feature_get_name g_list_next g_return_if_fail g_value_get_boolean
Jun 16 2017
parent Mike Wey <mike-wey example.com> writes:
On 06/17/2017 01:34 AM, Jay Norwood wrote:
 gst_plugin_feature_get_name
This is a macro, the alternative: ``` import gobject.Value; Value name; feature.getProperty("name", name); name.getString(); ``` or if you don't want to use GValue. ``` to!string((cast(GstObject)feature.getPluginFeatureStruct()).name); ```
 g_list_next
https://github.com/gtkd-developers/GtkD/blob/master/generated/gtkd/glib/ListG.d#L75
 g_return_if_fail
Also a macro, witch basically does this: ``` if ( !expression ) return; ```
 g_value_get_boolean
https://github.com/gtkd-developers/GtkD/blob/master/generated/gtkd/gobject/Value.d#L245 -- Mike Wey
Jun 17 2017