In !427, I removed the call to get_devices in order to always
print added devices from the bus handler, however this requires
the main loop to run until all pending messages have been consumed.
This commit achieves this by always running the main loop, and
simply adding an idle source to quit it in the non --follow case.
Print a gst-launch-1.0 line that could get to this device,
useful as we don't have other ways to see what it does exactly.
This may not work if the create element has configurations other than
properties.
https://bugzilla.gnome.org/show_bug.cgi?id=781152
When g_option_context_parse fails, context and error variables are not getting free'd
which results in memory leaks. Free'ing the same.
And replacing g_error_free with g_clear_error, which checks if the error being passed
is not NULL and sets the variable to NULL on free'ing.
https://bugzilla.gnome.org/show_bug.cgi?id=753852
Just shows devices with basic info and exits. Or will
wait for more devices to show up or be removed with
the --follow option. It's also possible to pass filters
as command line arguments in the form DEVICE_CLASSES
or DEVICE_CLASSES:CAPS.