[vlc-devel] [PATCH 2/4] httpd: add vlc_chromecast_http_HostNew

Thomas Guillem thomas at gllm.fr
Mon Jan 11 15:33:15 UTC 2021



On Mon, Jan 11, 2021, at 16:07, Rémi Denis-Courmont wrote:
> Le maanantaina 11. tammikuuta 2021, 15.32.17 EET Thomas Guillem a écrit :
> > ---
> >  include/vlc_httpd.h | 1 +
> >  src/libvlccore.sym  | 1 +
> >  src/network/httpd.c | 5 +++++
> >  3 files changed, 7 insertions(+)
> > 
> > diff --git a/include/vlc_httpd.h b/include/vlc_httpd.h
> > index 0b8f8c26bd9..be58947d7cc 100644
> > --- a/include/vlc_httpd.h
> > +++ b/include/vlc_httpd.h
> > @@ -67,6 +67,7 @@ typedef struct httpd_client_t httpd_client_t;
> >  VLC_API httpd_host_t *vlc_http_HostNew( vlc_object_t * ) VLC_USED;
> >  VLC_API httpd_host_t *vlc_https_HostNew( vlc_object_t * ) VLC_USED;
> >  VLC_API httpd_host_t *vlc_rtsp_HostNew( vlc_object_t * ) VLC_USED;
> > +VLC_API httpd_host_t *vlc_chromecast_http_HostNew( vlc_object_t *, unsigned
> > port ) VLC_USED; /* delete a host */
> >  VLC_API void httpd_HostDelete( httpd_host_t * );
> > 
> > diff --git a/src/libvlccore.sym b/src/libvlccore.sym
> > index 2cfe0d376cd..6e05665d485 100644
> > --- a/src/libvlccore.sym
> > +++ b/src/libvlccore.sym
> > @@ -151,6 +151,7 @@ vlc_hash_md5_Init
> >  vlc_hash_md5_Update
> >  vlc_hash_md5_Finish
> >  vlc_rtsp_HostNew
> > +vlc_chromecast_http_HostNew
> >  httpd_MsgAdd
> >  httpd_MsgGet
> >  httpd_RedirectDelete
> > diff --git a/src/network/httpd.c b/src/network/httpd.c
> > index 8843c217e55..1b8e9cc1f93 100644
> > --- a/src/network/httpd.c
> > +++ b/src/network/httpd.c
> > @@ -933,6 +933,11 @@ httpd_host_t *vlc_rtsp_HostNew(vlc_object_t *p_this)
> >      return httpd_HostVarCreate(p_this, "rtsp-host", "rtsp-port", NULL,
> > timeout); }
> > 
> > +httpd_host_t *vlc_chromecast_http_HostNew(vlc_object_t *p_this, unsigned
> > port) +{
> > +    return httpd_HostCreate(p_this, "", port, NULL, 10);
> > +}
> > +
> >  static struct httpd
> >  {
> >      vlc_mutex_t  mutex;
> 
> I don't see why this is needed and I don't think Chromecast should be treated 
> as a special snowflake either.
> 
> If the user set VLC to bind to a specific interface, everything should follow 
> the user setting.

I did this patch mainly to let chromecast override the timeout option.
I found that the http-host/port variable creation + setting was quite ugly too.

If you don't want a special snowflake, then we need to expose httpd_HostCreate() (and rename it).

> 
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> 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