/*****************************************************************************
* bonjour.c: Bonjour services discovery module
*****************************************************************************
/*****************************************************************************
* bonjour.c: Bonjour services discovery module
*****************************************************************************
-#ifdef HAVE_AVAHI_06
-# include <avahi-client/publish.h>
-# include <avahi-client/lookup.h>
-#endif
-#include <avahi-common/simple-watch.h>
+#include <avahi-client/publish.h>
+#include <avahi-client/lookup.h>
+#include <avahi-common/thread-watch.h>
set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_SD );
set_capability( "services_discovery", 0 );
set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_SD );
set_capability( "services_discovery", 0 );
/*****************************************************************************
* client_callback
*****************************************************************************/
/*****************************************************************************
* client_callback
*****************************************************************************/
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
void* userdata )
{
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
VLC_UNUSED(interface); VLC_UNUSED(host_name);
void* userdata )
{
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
VLC_UNUSED(interface); VLC_UNUSED(host_name);
- p_input = input_ItemNewExt( p_sd, psz_uri, name, 0, NULL, -1 );
+ p_input = input_item_NewExt( p_sd, psz_uri, name, 0, NULL, -1 );
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
if( event == AVAHI_BROWSER_NEW )
{
if( avahi_service_resolver_new( p_sys->client, interface, protocol,
name, type, domain, AVAHI_PROTO_UNSPEC,
services_discovery_t *p_sd = ( services_discovery_t* )userdata;
services_discovery_sys_t *p_sys = p_sd->p_sys;
if( event == AVAHI_BROWSER_NEW )
{
if( avahi_service_resolver_new( p_sys->client, interface, protocol,
name, type, domain, AVAHI_PROTO_UNSPEC,
resolve_callback, userdata ) == NULL )
{
msg_Err( p_sd, "failed to resolve service '%s': %s", name,
resolve_callback, userdata ) == NULL )
{
msg_Err( p_sd, "failed to resolve service '%s': %s", name,
- p_sys->client = avahi_client_new( avahi_simple_poll_get(p_sys->simple_poll),
-#ifdef HAVE_AVAHI_06
- 0,
-#endif
- client_callback, p_sd, &err );
+ p_sys->client = avahi_client_new( avahi_threaded_poll_get(p_sys->poll),
+ 0, client_callback, p_sd, &err );
if( p_sys->client == NULL )
{
msg_Err( p_sd, "failed to create avahi client: %s",
if( p_sys->client == NULL )
{
msg_Err( p_sd, "failed to create avahi client: %s",
avahi_service_browser_free( p_sys->sb );
if( p_sys->client != NULL )
avahi_client_free( p_sys->client );
avahi_service_browser_free( p_sys->sb );
if( p_sys->client != NULL )
avahi_client_free( p_sys->client );
-
-/*****************************************************************************
- * Run: main thread
- *****************************************************************************/
-static void Run( services_discovery_t *p_sd )
-{
- services_discovery_sys_t *p_sys = p_sd->p_sys;
-
- while( !p_sd->b_die )
- {
- if( avahi_simple_poll_iterate( p_sys->simple_poll, 100 ) != 0 )
- {
- msg_Err( p_sd, "poll iterate failed" );
- break;
- }
- }
-}