gst-launch tab-completion!

David Röthlisberger david at rothlis.net
Sat Dec 22 05:24:25 PST 2012


On 21 Dec 2012, at 10:51, David Röthlisberger wrote:
> On 21 Dec 2012, at 09:44, David Röthlisberger wrote:
>> On 21 Dec 2012, at 09:30, Stirling Westrup wrote:
>>> On Thu, Dec 20, 2012 at 6:54 PM, David Röthlisberger <david at rothlis.net> wrote:
>>>> On 20 Dec 2012, at 20:09, Stirling Westrup wrote:
>>>>> This is great, but I should point out that under Debian, I have 3
>>>>> versions of gst-launch and gst-inspect, because I have both v 0.10 and
>>>>> v1.0 installed.
>>>>> 
>>>>> gst-launch and gst-inspect are symlinked to gst-launch-0.1 and
>>>>> gst-inspect-0.1, and I also have gst-launch-1.0 and gst-inspect-1.0.
>>>>> This is necessary if one is trying to make a backward compatible
>>>>> gstreamer app.  It would be nice if your completions could handle
>>>>> this.
>>>> 
>>>> 
>>>> In what way does the completion script not handle your setup?
>>>> 
>>> 
>>> You have two scripts with the same name, one for v1.0, one for v0.1.
>>> Installing both means renaming them, and I assumed that would break
>>> things. As well, its not clear if these completion scripts will work
>>> when I invoke gst-inspect-1.0 rather than just gst-inspect, although I
>>> admit I haven't had a chance to check it out yet.
>> 
>> 
>> The script on the 0.10 branch registers to complete for "gst-launch" and
>> "gst-launch-0.10". The script on the 1.0 branch registers to complete
>> for "gst-launch-1.0". Otherwise, the scripts are identical. So it should
>> be safe for you to install both copies of the script to
>> /etc/bash_completion.d if you rename one of them.
> 
> 
> I was wrong: It isn't entirely safe. Depending on which order the two
> scripts are loaded, _all_ the suggested completions will come from
> either 1.0 or 0.10 plugins, regardless of the version of gst-launch on
> the command line being completed.
> 
> I will work on a fix this evening. Thanks for the feedback! :-)
> 

What do you think of this solution:
https://github.com/drothlis/gstreamer/commit/f1205fe3

The intention is for the 1.0 script to be renamed to
gstreamer-completion-1.0 with the two entry functions renamed to
_gst_inspect_1_0 and _gst_launch_1_0, but for all the remaining helper
functions to be shared between the 1.0 and 0.10 completion scripts
(because neither the format of the gst-launch pipeline, nor of the
output of gst-inspect, have changed from 0.10 to 1.0).

Dave.



More information about the gstreamer-devel mailing list