2007-10-11 03:02:50 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* vlc_services_discovery.h : Services Discover functions
|
|
|
|
*****************************************************************************
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* Copyright (C) 1999-2004 VLC authors and VideoLAN
|
2007-10-11 03:02:50 +02:00
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
|
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
2007-10-11 03:02:50 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
2007-10-11 03:02:50 +02:00
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2007-10-11 03:02:50 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2008-08-11 18:13:10 +02:00
|
|
|
#ifndef VLC_SERVICES_DISCOVERY_H_
|
|
|
|
#define VLC_SERVICES_DISCOVERY_H_
|
2007-10-11 03:02:50 +02:00
|
|
|
|
2009-12-20 00:51:38 +01:00
|
|
|
#include <vlc_input.h>
|
|
|
|
#include <vlc_probe.h>
|
|
|
|
|
2008-08-11 17:31:57 +02:00
|
|
|
/**
|
|
|
|
* \file
|
2011-04-24 20:56:07 +02:00
|
|
|
* This file lists functions and structures for service discovery (SD) in vlc
|
2008-08-11 17:31:57 +02:00
|
|
|
*/
|
|
|
|
|
2007-10-11 03:02:50 +02:00
|
|
|
# ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
# endif
|
|
|
|
|
2011-04-24 21:23:56 +02:00
|
|
|
/**
|
2007-10-11 03:02:50 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2011-04-24 21:23:56 +02:00
|
|
|
|
2016-11-14 20:48:38 +01:00
|
|
|
struct services_discovery_owner_t
|
|
|
|
{
|
|
|
|
void *sys; /**< Private data for the owner callbacks */
|
2017-05-14 10:22:28 +02:00
|
|
|
void (*item_added)(struct services_discovery_t *sd, input_item_t *parent,
|
|
|
|
input_item_t *item, const char *category);
|
2016-11-14 20:48:38 +01:00
|
|
|
void (*item_removed)(struct services_discovery_t *sd, input_item_t *item);
|
|
|
|
};
|
|
|
|
|
2011-04-24 21:23:56 +02:00
|
|
|
/**
|
|
|
|
* Main service discovery structure to build a SD module
|
|
|
|
*/
|
2007-10-11 03:02:50 +02:00
|
|
|
struct services_discovery_t
|
|
|
|
{
|
|
|
|
VLC_COMMON_MEMBERS
|
2011-04-24 20:56:07 +02:00
|
|
|
module_t * p_module; /**< Loaded module */
|
2010-02-24 16:55:05 +01:00
|
|
|
|
2011-04-24 20:56:07 +02:00
|
|
|
char *psz_name; /**< Main name of the SD */
|
|
|
|
config_chain_t *p_cfg; /**< Configuration for the SD */
|
2010-02-24 16:55:05 +01:00
|
|
|
|
2016-11-15 18:10:44 +01:00
|
|
|
const char *description; /**< Human-readable name */
|
|
|
|
|
2011-04-24 20:56:07 +02:00
|
|
|
/** Control function
|
|
|
|
* \see services_discovery_command_e
|
|
|
|
*/
|
2010-10-24 03:52:12 +02:00
|
|
|
int ( *pf_control ) ( services_discovery_t *, int, va_list );
|
2010-10-18 06:56:57 +02:00
|
|
|
|
2011-04-24 20:56:07 +02:00
|
|
|
services_discovery_sys_t *p_sys; /**< Custom private data */
|
2016-11-14 20:48:38 +01:00
|
|
|
|
|
|
|
struct services_discovery_owner_t owner; /**< Owner callbacks */
|
2007-10-11 03:02:50 +02:00
|
|
|
};
|
|
|
|
|
2010-10-24 03:52:12 +02:00
|
|
|
/**
|
|
|
|
* Service discovery categories
|
2011-04-24 21:23:56 +02:00
|
|
|
* \see vlc_sd_probe_Add
|
2010-10-24 03:52:12 +02:00
|
|
|
*/
|
2010-02-10 02:12:36 +01:00
|
|
|
enum services_discovery_category_e
|
|
|
|
{
|
2011-04-24 20:56:07 +02:00
|
|
|
SD_CAT_DEVICES = 1, /**< Devices, like portable music players */
|
|
|
|
SD_CAT_LAN, /**< LAN/WAN services, like Upnp or SAP */
|
|
|
|
SD_CAT_INTERNET, /**< Internet or Website channels services */
|
|
|
|
SD_CAT_MYCOMPUTER /**< Computer services, like Discs or Apps */
|
2010-02-10 02:12:36 +01:00
|
|
|
};
|
|
|
|
|
2010-10-24 03:52:12 +02:00
|
|
|
/**
|
|
|
|
* Service discovery control commands
|
|
|
|
*/
|
|
|
|
enum services_discovery_command_e
|
|
|
|
{
|
|
|
|
SD_CMD_SEARCH = 1, /**< arg1 = query */
|
2010-11-02 08:31:09 +01:00
|
|
|
SD_CMD_DESCRIPTOR /**< arg1 = services_discovery_descriptor_t* */
|
2010-10-24 03:52:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Service discovery capabilities
|
|
|
|
*/
|
|
|
|
enum services_discovery_capability_e
|
|
|
|
{
|
2011-04-24 20:56:07 +02:00
|
|
|
SD_CAP_SEARCH = 1 /**< One can search in the SD */
|
2010-10-24 03:52:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Service discovery descriptor
|
2011-04-24 21:23:56 +02:00
|
|
|
* \see services_discovery_command_e
|
2010-10-24 03:52:12 +02:00
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2011-04-24 20:56:07 +02:00
|
|
|
char *psz_short_desc; /**< The short description, human-readable */
|
|
|
|
char *psz_icon_url; /**< URL to the icon that represents it */
|
|
|
|
char *psz_url; /**< URL for the service */
|
|
|
|
int i_capabilities; /**< \see services_discovery_capability_e */
|
2010-10-24 03:52:12 +02:00
|
|
|
} services_discovery_descriptor_t;
|
|
|
|
|
2011-04-24 21:23:56 +02:00
|
|
|
|
2007-10-11 03:02:50 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* Service Discovery
|
|
|
|
***********************************************************************/
|
|
|
|
|
2010-10-18 06:56:57 +02:00
|
|
|
/**
|
|
|
|
* Ask for a research in the SD
|
|
|
|
* @param p_sd: the Service Discovery
|
2010-10-24 03:52:12 +02:00
|
|
|
* @param i_control: the command to issue
|
|
|
|
* @param args: the argument list
|
2010-10-18 06:56:57 +02:00
|
|
|
* @return VLC_SUCCESS in case of success, the error code overwise
|
|
|
|
*/
|
2010-10-24 03:52:12 +02:00
|
|
|
static inline int vlc_sd_control( services_discovery_t *p_sd, int i_control, va_list args )
|
2010-10-18 06:56:57 +02:00
|
|
|
{
|
2010-10-24 03:52:12 +02:00
|
|
|
if( p_sd->pf_control )
|
|
|
|
return p_sd->pf_control( p_sd, i_control, args );
|
2010-10-18 06:56:57 +02:00
|
|
|
else
|
|
|
|
return VLC_EGENERIC;
|
|
|
|
}
|
|
|
|
|
2007-10-11 03:02:50 +02:00
|
|
|
/* Get the services discovery modules names to use in Create(), in a null
|
|
|
|
* terminated string array. Array and string must be freed after use. */
|
2011-05-07 22:02:08 +02:00
|
|
|
VLC_API char ** vlc_sd_GetNames( vlc_object_t *, char ***, int ** ) VLC_USED;
|
2010-02-10 02:12:36 +01:00
|
|
|
#define vlc_sd_GetNames(obj, pln, pcat ) \
|
|
|
|
vlc_sd_GetNames(VLC_OBJECT(obj), pln, pcat)
|
2007-10-11 03:02:50 +02:00
|
|
|
|
2016-11-14 20:48:38 +01:00
|
|
|
/**
|
|
|
|
* Creates a services discoverer.
|
|
|
|
*/
|
|
|
|
VLC_API services_discovery_t *vlc_sd_Create(vlc_object_t *parent,
|
|
|
|
const char *chain, const struct services_discovery_owner_t *owner)
|
|
|
|
VLC_USED;
|
|
|
|
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API void vlc_sd_Destroy( services_discovery_t * );
|
2009-01-10 18:28:34 +01:00
|
|
|
|
2017-05-14 10:22:28 +02:00
|
|
|
/**
|
|
|
|
* Added top-level service callback.
|
|
|
|
*
|
|
|
|
* This is a convenience wrapper for services_discovery_AddSubItem().
|
|
|
|
* It covers the most comomn case wherby the added item is a top-level service,
|
|
|
|
* i.e. it has no parent node.
|
|
|
|
*/
|
|
|
|
static inline void services_discovery_AddItem(services_discovery_t *sd,
|
|
|
|
input_item_t *item)
|
|
|
|
{
|
2017-07-12 11:20:47 +02:00
|
|
|
sd->owner.item_added(sd, NULL, item, NULL);
|
2017-05-14 10:22:28 +02:00
|
|
|
}
|
|
|
|
|
2016-11-14 20:48:38 +01:00
|
|
|
/**
|
|
|
|
* Added service callback.
|
|
|
|
*
|
|
|
|
* A services discovery module invokes this function when it "discovers" a new
|
|
|
|
* service, i.e. a new input item.
|
|
|
|
*
|
2017-05-14 10:22:28 +02:00
|
|
|
* @note This callback does not take ownership of the input item; it might
|
|
|
|
* however (and most probably will) add one of more references to the item.
|
|
|
|
*
|
|
|
|
* The caller is responsible for releasing its own reference(s) eventually.
|
|
|
|
* Keeping a reference is necessary to call services_discovery_RemoveItem() or
|
|
|
|
* to alter the item later. However, if the caller will never remove nor alter
|
|
|
|
* the item, it can drop its reference(s) immediately.
|
2016-11-14 20:48:38 +01:00
|
|
|
*
|
|
|
|
* @param sd services discoverer / services discovery module instance
|
|
|
|
* @param item input item to add
|
2017-05-14 09:36:07 +02:00
|
|
|
*/
|
2017-05-14 10:22:28 +02:00
|
|
|
static inline void services_discovery_AddSubItem(services_discovery_t *sd,
|
|
|
|
input_item_t *parent,
|
|
|
|
input_item_t *item)
|
2017-05-14 09:36:07 +02:00
|
|
|
{
|
2017-07-12 11:20:47 +02:00
|
|
|
sd->owner.item_added(sd, parent, item, NULL);
|
2017-05-14 09:36:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Added service backward compatibility callback.
|
|
|
|
*
|
2016-11-14 20:48:38 +01:00
|
|
|
* @param category Optional name of a group that the item belongs in
|
|
|
|
* (for backward compatibility with legacy modules)
|
|
|
|
*/
|
2017-05-14 09:36:07 +02:00
|
|
|
VLC_DEPRECATED
|
|
|
|
static inline void services_discovery_AddItemCat(services_discovery_t *sd,
|
|
|
|
input_item_t *item,
|
|
|
|
const char *category)
|
2016-11-14 20:48:38 +01:00
|
|
|
{
|
2017-07-12 11:20:47 +02:00
|
|
|
sd->owner.item_added(sd, NULL, item, category);
|
2016-11-14 20:48:38 +01:00
|
|
|
}
|
2007-10-11 03:02:50 +02:00
|
|
|
|
2016-11-14 20:48:38 +01:00
|
|
|
/**
|
|
|
|
* Removed service callback.
|
|
|
|
*
|
|
|
|
* A services discovery module invokes this function when it senses that a
|
|
|
|
* service is no longer available.
|
|
|
|
*/
|
|
|
|
static inline void services_discovery_RemoveItem(services_discovery_t *sd,
|
|
|
|
input_item_t *item)
|
|
|
|
{
|
2017-07-12 11:20:47 +02:00
|
|
|
sd->owner.item_removed(sd, item);
|
2016-11-14 20:48:38 +01:00
|
|
|
}
|
2009-12-20 00:51:38 +01:00
|
|
|
|
|
|
|
/* SD probing */
|
|
|
|
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API int vlc_sd_probe_Add(vlc_probe_t *, const char *, const char *, int category);
|
2009-12-20 00:51:38 +01:00
|
|
|
|
|
|
|
#define VLC_SD_PROBE_SUBMODULE \
|
|
|
|
add_submodule() \
|
|
|
|
set_capability( "services probe", 100 ) \
|
|
|
|
set_callbacks( vlc_sd_probe_Open, NULL )
|
|
|
|
|
2010-02-10 02:12:36 +01:00
|
|
|
#define VLC_SD_PROBE_HELPER(name, longname, cat) \
|
2009-12-20 00:51:38 +01:00
|
|
|
static int vlc_sd_probe_Open (vlc_object_t *obj) \
|
|
|
|
{ \
|
2016-11-15 18:12:35 +01:00
|
|
|
return vlc_sd_probe_Add ((struct vlc_probe_t *)obj, name, \
|
2010-02-10 16:38:33 +01:00
|
|
|
longname, cat); \
|
2009-12-20 00:51:38 +01:00
|
|
|
}
|
|
|
|
|
2007-10-11 03:02:50 +02:00
|
|
|
/** @} */
|
|
|
|
# ifdef __cplusplus
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#endif
|