[vlc-devel] [PATCH 1/7] Add mDNS Services Advertisement submodule (stub)

Marvin Scholz epirat07 at gmail.com
Fri Jul 26 13:54:58 CEST 2019


Hi, thanks for your patch!

Some remarks:

I think in general what you want is to allow individual plugins to use
the service advertisement module(s) to advertise themselves or add
advertisements.

The service advertisement module can not know what to advertise and 
hardcoding
a specific advertisement seems wrong.

For example what you likely want to advertise instead or in addition to
_vlc._tcp.local is _http._tcp.local for the VLC web interface.

And for the address, only the module actually listening to the socket 
and
providing whatever service you want to announce can know which address 
to
announce, unless I misunderstand something here.

For example if the VLC http module only listens on v4 only, you do not 
want
to announce the v6 address too.

On 24 Jul 2019, at 17:43, Roland Bewick wrote:

> ---
>  modules/services_discovery/microdns.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/modules/services_discovery/microdns.c 
> b/modules/services_discovery/microdns.c
> index ad0d2691f7..e9ff0c6380 100644
> --- a/modules/services_discovery/microdns.c
> +++ b/modules/services_discovery/microdns.c
> @@ -40,6 +40,8 @@ static int OpenSD( vlc_object_t * );
>  static void CloseSD( vlc_object_t * );
>  static int OpenRD( vlc_object_t * );
>  static void CloseRD( vlc_object_t * );
> +static int OpenSA( vlc_object_t * );
> +static void CloseSA( vlc_object_t * );
>
>  VLC_SD_PROBE_HELPER( "microdns", N_("mDNS Network Discovery"), 
> SD_CAT_LAN )
>  VLC_RD_PROBE_HELPER( "microdns_renderer", "mDNS renderer Discovery" )
> @@ -69,6 +71,14 @@ vlc_module_begin()
>          set_callbacks( OpenRD, CloseRD )
>          add_shortcut( "mdns_renderer", "microdns_renderer" )
>          VLC_RD_PROBE_SUBMODULE
> +    add_submodule() \
> +        set_description( N_( "mDNS Services Advertisement" ) )
> +        set_category( CAT_ADVANCED )
> +        set_subcategory( SUBCAT_ADVANCED_NETWORK )
> +        set_capability( "services_advertisement", 0 )
> +        set_callbacks( OpenSA, CloseSA )
> +        add_shortcut( "mdns", "microdns" )
> +        VLC_RD_PROBE_SUBMODULE
>  vlc_module_end ()
>
>  static const struct
> @@ -673,3 +683,16 @@ CloseRD( vlc_object_t *p_this )
>
>      CleanCommon( p_sys );
>  }
> +
> +static int
> +OpenSA( vlc_object_t *p_obj )
> +{
> +    msg_Dbg(p_obj, "TODO: Open service advertisement module");
> +    return VLC_SUCCESS;
> +}
> +
> +static void
> +CloseSA( vlc_object_t *p_this )
> +{
> +    msg_Dbg(p_this, "TODO: Close service advertisement module");
> +}
> \ No newline at end of file
> -- 
> 2.11.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list