After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742115 - Examples: Accept a 'port' argument for running multiple instances
Examples: Accept a 'port' argument for running multiple instances
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-30 13:03 UTC by Nirbheek Chauhan
Modified: 2014-12-30 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add command-line parsing and take a 'port' argument (8.78 KB, patch)
2014-12-30 13:03 UTC, Nirbheek Chauhan
none Details | Review
Add command-line parsing and take a 'port' argument (8.09 KB, patch)
2014-12-30 13:45 UTC, Nirbheek Chauhan
committed Details | Review

Description Nirbheek Chauhan 2014-12-30 13:03:43 UTC
Created attachment 293475 [details] [review]
Add command-line parsing and take a 'port' argument

For examples that take arguments (a launch pipeline, a filename, uri, etc), add a port argument so that users can run multiple instances for testing.

The implementation uses GOptionEntry, so the patch is rather trivial.
Comment 1 Tim-Philipp Müller 2014-12-30 13:13:01 UTC
 - any reason not to make the port an INT argument? Seems more natural.

 - I think these lines should just be copy'n'pasted into each .c file instead of having a shared header just for this
Comment 2 Nirbheek Chauhan 2014-12-30 13:15:23 UTC
(In reply to comment #1)
>  - any reason not to make the port an INT argument? Seems more natural.
> 

The "service" property on the server (which is the port) takes a string argument, so I thought I'd just pass it straight on instead of doing a conversion.

>  - I think these lines should just be copy'n'pasted into each .c file instead
> of having a shared header just for this

Updated patch incoming. :)
Comment 3 Nirbheek Chauhan 2014-12-30 13:45:19 UTC
Created attachment 293476 [details] [review]
Add command-line parsing and take a 'port' argument

This patch removes the header and copy-pastes the code into each file. In addition, the variables are now static.
Comment 4 Tim-Philipp Müller 2014-12-30 16:07:16 UTC
Thanks, pushed:

commit e0d3807cbbba6c24d24b6a9cf8e8e11005b74c51
Author: Nirbheek Chauhan <nirbheek@centricular.com>
Date:   Tue Dec 30 18:13:49 2014 +0530

    examples: Add command-line parsing and take a 'port' argument
    
    This allows users to run multiple servers on different ports for testing.
    
    Only done for examples that actually take arguments and hence are capable of
    outputting different streams for each instance on each port.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742115