Posts

Showing posts with the label Vala

See you in Berlin!

Image
I have a talk where I'll attempt to brain-wash educate the masses about the awesomeness of Vala language. If you are even slightly interested, please do attend. I also have arranged a BoF together with KDE's Friedrich Kossebau to discuss about the possibility of SSDP (discovery protocol used by UPnP) as a system service. See you in Berlin soon!

FOSDEM

Image
Not only that, I am also delivering a talk on one of my favorite programming languages, Vala . My other favorite language is always nicely presented by his awesomeness, Andy Wingo so I don't need to talk about that. :) Yes, I'm not doing a rygel or gupnp talk this time. My apologies if that disappoints anyone. :)

GSSDP 0.7.2, GUPnP 0.13.3, GUPnP AV 0.5.5 & GUPnP Vala 0.6.5

GSSDP 0.7.2 released! Changes since 0.7.1: - Provide gobject-introspection GIR and typelib. - Use silent build rules. - Fix issues with version-independence magic in SSDP code. - Fix build issues in jhbuild environment. Bugs fixed in this release: 2025 - autogen.sh fails to find autoconf macros when they're installed in a non-standard location 1927 - gssdp fails to answer M-SEARCH sometimes 1921 - GObject Introspection Makefile for GSSDP All Contributors: Zeeshan Ali (Khattak) Zach Goldberg Jens Georg Neil Roberts Ross Burton Download source tarball from here GUPnP 0.13.3 released! Changes since 0.13.2: - Include the Content-Type header in the HTTP messages. This satisfies DLNA CTT test cases 7.2.5.9 and 7.2.29.1. - Use g_message instead of g_warning if we can't connect to DBus. - Make the HTTP server listen on the context's interface only. - Fix some potential crashes in GUPnPServiceProxy and GUPnPContextManager code. - Fix build issues in jhbuil

GSSDP 0.7, GUPnP 0.13, GUPnP AV 0.5, GUPnP Tools 0.8 & GUPnP Vala 0.6

GSSDP 0.7 released! Changes in this release: - Join the multicast group on the specified interface. - Put the message src timeout in the specified GMainContext. - "host-ip" property moved from GUPnPContext to parent GSSDPClient. - Use inet_aton instead of inet_addr and handle the error from it. - gssdp-device-sniffer ported to GtkBuilder. - Version-independent target match. This makes client forward and backward compatible with resources that implement different version of the specs than the client. - Version-independent M-SEARCH response. This has the same effect as above but only the other way around. - GSSDPClient now binds to interface rather than IP. - No need to find the default route. - Add "active" property to GSSDPClient. - Fix pkg-config paths. - Add basic .gitignore. - Other minor/internal changes. Bugs fixed: 1621 - new gssdp timeout not added to the specific maincontext 1570 - gupnp doesn't set the pkgconfig lib dir correctly in 64 bit env Dependenc

GUPnP AV 0.4 and GUPnP Vala 0.5.4 released

GUPnP AV 0.4 released. New in this release: - Watch for empty DIDL-Lite nodes. - Escape the URIs before putting them into DIDL-Lite XML. - The '.' must be omitted from duration if fraction part is not included. - Be more lenient when parsing DIDL-Lite XML fragments. - Don't require the DLNA profile string. - Try to guess the DLNA Profile if not provided and put "*" in the whole 4th field of protocolInfo if our guess work fails. - Make sure 4th field of protocolInfo is completely in compliance with DLNA guidelines. This only implies one change in the API: enum dlna_play_speed is replaced by play_speeds, a GList of allowed play speeds as strings. - Use '1' and '0' to express boolean properties in DIDL-Lite XML. - Other minor fixes. All contributors to this release: Henrique Ferreiro García Peter Christensen Sven Neumann Zeeshan Ali (Khattak) Download from here: http://gupnp.org/sources/ gupnp-av/gupnp-av-0.4.tar.gz -----------------------------

Think before you create GObjects

I had always been hearing that GObjects are slow and it's not always a good idea to use/write them but I never saw any evidence to support that. I had this desire to write a test application to get this evidence but felt too lazy to do it in C. I realized a few days ago that I can write such an app very easily in Vala without giving up much on my laziness. :) So here is an app that I wrote last evening after returning from vacation. Here are the results on my laptop: $ ./test-perf 0.000182 seconds taken in creating 10000 structs. 0.001598 seconds taken in creating 10000 instances (compact). 0.003522 seconds taken in creating 10000 instances. 0.090455 seconds taken in creating 10000 instances (GObject). The ranking is exactly how I expected it to be but didn't expect such a big difference between them all.

Regarding closures

After reading/watching Stuart's nice slides on Closures in the context of JavaScript, I have started to like JavaScript. Personally, I don't accept any language as a high-level scripting language if it doesn't support closures. Python is therefore straight out of my window. Although Vala isn't a scripting language, it would be nice to have such support in there as well. It already supports lambda functions with no restrictions and Jürg has concrete plans to support closures, it's more a matter of when rather than why or how. When that support is there, just try and stop me from loving Vala. :) UPDATE : Thanks to Anonymous, I now stand corrected that Python does fully support closures. Although I still don't like the fact that it restricts lambda functions to be one-liner but at least it's not straight out of the window anymore. :) UPDATE#2 : Andy Wingo informs me that python doesn't really fully support closures. He even put up a small code fragment to

GUPnP MediaServer 0.1 released

GUPnP is an object-oriented open source framework for creating UPnP devices and control points, written in C using GObject and libsoup. The GUPnP API is intended to be easy to use, efficient and flexible. GUPnP MediaServer is an implementation of the UPnP MediaServer V 2.0 specification based on GUPnP and tracker . It is written (mostly) in Vala language. Download at http://gupnp.org/sources/gupnp-media-server/

gupnp-vala 0.1 released

Initial release of gupnp-vala. Includes Vala bindings for the whole gupnp stack: * gssdp-1.0 0.6.1 * gupnp-1.0 0.12 * gupnp-ui-1.0 0.1 * gupnp-av-1.0 0.2.1 - Requires Vala 0.3.3 - custom GUPnP types (like GUPnPURI) are not supported yet, use plain strings instead. Custom type support will return shortly in svn version.

gupnp-media-server now written in Vala

I finally managed to port all the existing C code to Vala. What did i achieve from this exercise? For one thing, the code got much simpler, with LOCs being reduced from 2101 to 1117 (46.8 %). Also this proves that (at least the server-side) GUPnP's Vala bindings are already in a stable/usable state. Special thanks to Jürg Billeter , Ali Sabil and Jussi Kukkonen for their continuous support during this exercise and for quickly fixing bugs that I reported.

My new personal hero

Meet my new personal hero, Jussi Kukkonen . The only o-hand employee in Finland who almost single-handedly created the Vala bindings of the whole GUPnP stack and ported all our test apps to Vala in a very short amount of time despite the fact that he was completely unfamiliar to Vala and GUPnP (and UPnP itself) when he started working on this task and the fact that the Vala documentation is hardly any complete (especially binding-generation).

Why Vala?

When I told some people that I will write (which involves re-writing existing code first) the gupnp-media-server in Vala, their question was "Why Vala? Why not Python, Java or C#?". So here are the strong points of Vala, not all of which are found in these languages: Statically-typed Back in the days, when I was hacking on Gazpacho I found the lack of types on variables and function/method parameters really annoying in Python. This can become quite a pain when you are reading other's code and that is exactly what I was doing most of the time. The fact that Johan and Kalle wrote very nice and readable code, helped a lot though. No runtime dependency/overhead This might seem like a small point to many developers but as an embedded-systems developer, this is a big plus for me and I am sure to many (if not most) of the embedded-systems developers out there. Easy integration with C/GObject A big plus for all the GObject/C developers out there. Besides, there are situations

Vala is great!

Ever since Jorn and Matthew mentioned the idea of Vala bindings for GUPnP, I have been eager to learn Vala and so this weekend I finally got around to introduce myself to it. It's really cool. To express my admiration, I have already created a "Vala programming language fan club" group on facebook. :) A few minutes after I mentioned to Emmanuele on IRC about my intention of binding GUPnP for Vala, Ali Sabil had already done the basic work and we already have bindings that work for such basic example application at least: using GLib; using GUPnP; public class Browser: ControlPoint { public MainLoop main_loop { get; private set; } private void on_device_proxy_available(ControlPoint cp, DeviceProxy proxy) { stdout.printf("device %s found\n", proxy.get_friendly_name()); } private bool on_timeout () { this.main_loop.quit(); return false; } public Browser() {