]> git.sesse.net Git - vlc/commitdiff
Remove HAL plugin
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 14 Oct 2009 17:13:41 +0000 (20:13 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 14 Oct 2009 17:27:05 +0000 (20:27 +0300)
It was ever dead code within VLC. On top of that, HAL is now officially
deprecated in favor of libudev (and higher level D-Bus middlewares).

configure.ac
include/vlc_devices.h [deleted file]
modules/LIST
modules/misc/Modules.am
modules/misc/probe/Modules.am [deleted file]
modules/misc/probe/hal.c [deleted file]
po/POTFILES.in
src/Makefile.am
src/misc/devices.c [deleted file]

index 5ca0f9689270c7ac3e2c1d748ae727fe8e7d4590..83d643fa3b73e99fcb71be97c5956143a6873098 100644 (file)
@@ -4559,7 +4559,7 @@ PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services d
 
 dnl
 dnl  HAL services discovery
-PKG_ENABLE_MODULES_VLC([HAL], [], [hal >= 0.5.0], [Linux HAL services discovery], [auto])
+PKG_CHECK_MODULES([HAL], [hal >= 0.5.0],, [true])
 
 dnl
 dnl MTP devices services discovery
@@ -5188,7 +5188,6 @@ AC_CONFIG_FILES([
   modules/misc/osd/Makefile
   modules/misc/stats/Makefile
   modules/misc/xml/Makefile
-  modules/misc/probe/Makefile
   modules/mux/Makefile
   modules/mux/mpeg/Makefile
   modules/packetizer/Makefile
diff --git a/include/vlc_devices.h b/include/vlc_devices.h
deleted file mode 100644 (file)
index ba0d5f8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*****************************************************************************
- * vlc_devices.h : Devices handling
- *****************************************************************************
- * Copyright (C) 1999-2006 the VideoLAN team
- * $Id$
- *
- * Authors: Clément Stenac <zorglub@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (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
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU 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.
- *****************************************************************************/
-
-#ifndef VLC_DEVICES_H
-#define VLC_DEVICES_H 1
-
-/**
- * \file
- * This file implements functions, structures for probing devices (DVD, CD, VCD)
- */
-
-enum
-{
-    DEVICE_CAN_DVD,
-    DEVICE_CAN_CD,
-};
-
-enum
-{
-    MEDIA_TYPE_CDDA,
-    MEDIA_TYPE_VCD,
-    MEDIA_TYPE_DVD,
-};
-
-struct device_t
-{
-    int             i_capabilities;
-    int             i_media_type;
-    bool      b_seen;
-    char *psz_uri;
-    char *psz_name;
-};
-
-struct device_probe_t
-{
-    VLC_COMMON_MEMBERS;
-    int         i_devices;
-    device_t  **pp_devices;
-
-    probe_sys_t *p_sys;
-    void      ( *pf_run )    ( device_probe_t * );  /** Run function */
-};
-
-static inline void device_GetDVD(void)
-{
-}
-
-#endif
index 51762b58086b104872d61c3d95f6b85c42050228..2a69e1615e51baf60fa998eefb4eccd40bea1425 100644 (file)
@@ -132,7 +132,6 @@ $Id$
  * growl: announce currently playing stream to growl
  * growl_udp: growl UDP notification plugin
  * h264: H264 decoder
- * hal: Linux HAL services discovery module
  * hd1000a: audio output module for the Roku HD1000 Set-Top-Box
  * hd1000v: video output module for the Roku HD1000 Set-Top-Box
  * headphone_channel_mixer:  headphone channel mixer with virtual spatialization effect
index 4559f955daf8b77cfa2d33e9cb10756a91d4092a..024a4556ae726e4d64bc88cf0de13fe0a01f32f4 100644 (file)
@@ -1,4 +1,4 @@
-BASE_SUBDIRS = dummy memcpy notify testsuite playlist stats osd xml probe
+BASE_SUBDIRS = dummy memcpy notify testsuite playlist stats osd xml
 EXTRA_SUBDIRS = lua
 
 SUBDIRS = $(BASE_SUBDIRS)
diff --git a/modules/misc/probe/Modules.am b/modules/misc/probe/Modules.am
deleted file mode 100644 (file)
index e508b67..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES_probe_hal = hal.c
diff --git a/modules/misc/probe/hal.c b/modules/misc/probe/hal.c
deleted file mode 100644 (file)
index 7bb6dcb..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-/*****************************************************************************
- * hal.c :  HAL probing module
- *****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
- * $Id$
- *
- * Authors: Clément Stenac <zorglub@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (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
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU 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.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_plugin.h>
-#include <vlc_interface.h>
-#include <vlc_devices.h>
-
-#include <hal/libhal.h>
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-struct probe_sys_t
-{
-    DBusConnection *p_connection;
-    LibHalContext *p_ctx;
-    int            i_devices;
-    device_t     **pp_devices;
-};
-
-static int  Open ( vlc_object_t * );
-static void Close( vlc_object_t * );
-
-static void Update ( device_probe_t *p_probe );
-static void UpdateMedia( device_probe_t *p_probe, device_t *p_dev );
-static void AddDevice( device_probe_t * p_probe, device_t *p_dev );
-static device_t * ParseDisc( device_probe_t *p_probe,  char *psz_device );
-
-/*****************************************************************************
- * Module descriptor
- *****************************************************************************/
-vlc_module_begin ()
-    set_description( N_("HAL devices detection") )
-    set_capability( "devices probe", 0 )
-    set_callbacks( Open, Close )
-vlc_module_end ()
-
-
-/*****************************************************************************
- * Open: initialize and create stuff
- *****************************************************************************/
-static int Open( vlc_object_t *p_this )
-{
-    device_probe_t *p_probe = (device_probe_t *)p_this;
-    DBusError       dbus_error;
-    DBusConnection *p_connection;
-    probe_sys_t    *p_sys;
-
-    p_probe->p_sys = p_sys = malloc( sizeof( probe_sys_t ) );
-    p_probe->p_sys->i_devices = 0;
-    p_probe->p_sys->pp_devices = NULL;
-
-    p_probe->pf_run = Update;
-
-    dbus_error_init( &dbus_error );
-
-    p_sys->p_ctx = libhal_ctx_new();
-    if( !p_sys->p_ctx )
-    {
-        msg_Err( p_probe, "unable to create HAL context") ;
-        free( p_sys );
-        return VLC_EGENERIC;
-    }
-    p_connection = dbus_bus_get( DBUS_BUS_SYSTEM, &dbus_error );
-    if( dbus_error_is_set( &dbus_error ) )
-    {
-        msg_Err( p_probe, "unable to connect to DBUS: %s", dbus_error.message );
-        goto error;
-    }
-    p_sys->p_connection = p_connection;
-    libhal_ctx_set_dbus_connection( p_sys->p_ctx, p_connection );
-    if( !libhal_ctx_init( p_sys->p_ctx, &dbus_error ) )
-    {
-        msg_Err( p_probe, "hal not available : %s", dbus_error.message );
-        dbus_connection_unref( p_connection );
-        goto error;
-    }
-    return VLC_SUCCESS;
-error:
-    dbus_error_free( &dbus_error );
-    libhal_ctx_free( p_sys->p_ctx );
-    free( p_sys );
-    return VLC_EGENERIC;
-}
-
-/*****************************************************************************
- * Close:
- *****************************************************************************/
-static void Close( vlc_object_t *p_this )
-{
-    device_probe_t *p_probe = (device_probe_t *) p_this;
-    probe_sys_t *p_sys = p_probe->p_sys;
-    dbus_connection_unref( p_sys->p_connection );
-    libhal_ctx_free( p_sys->p_ctx );
-    free( p_sys );
-}
-#if 0
-static int GetAllDevices( device_probe_t *p_probe, device_t ***ppp_devices )
-{
-    /// \todo : fill the dst array
-    return p_probe->p_sys->i_devices;
-}
-#endif
-static void Update( device_probe_t * p_probe )
-{
-    probe_sys_t *p_sys = p_probe->p_sys;
-    int i, i_devices, j;
-    char **devices;
-    bool b_exists;
-    int canc = vlc_savecancel();
-
-    for ( j = 0 ; j < p_sys->i_devices; j++ )
-        p_sys->pp_devices[j]->b_seen = false;
-
-    /* CD/DVD */
-    if( ( devices = libhal_find_device_by_capability( p_sys->p_ctx,
-                              "storage.cdrom",
-                              &i_devices, NULL ) ) )
-    {
-        for( i = 0; i < i_devices; i++ )
-        {
-            device_t *p_dev = ParseDisc( p_probe, devices[ i ] );
-            b_exists = false;
-
-            for ( j = 0 ; j < p_sys->i_devices; j++ )
-            {
-                if( !strcmp( p_sys->pp_devices[j]->psz_uri,
-                             p_dev->psz_uri ) )
-                {
-                    b_exists = true;
-                    p_dev->b_seen = true;
-                    UpdateMedia( p_probe, p_dev );
-                    break;
-                }
-                if( !b_exists )
-                    AddDevice( p_probe, p_dev );
-            }
-        }
-    }
-    /// \todo Remove unseen devices
-    vlc_restorecancel( canc );
-}
-
-
-static void AddDevice( device_probe_t * p_probe, device_t *p_dev )
-{
-    INSERT_ELEM( p_probe->p_sys->pp_devices,
-                 p_probe->p_sys->i_devices,
-                 p_probe->p_sys->i_devices,
-                 p_dev );
-    /// \todo : emit variable
-}
-
-static device_t * ParseDisc( device_probe_t *p_probe,  char *psz_device )
-{
-    probe_sys_t *p_sys = p_probe->p_sys;
-    device_t *p_dev;
-    char *block_dev;
-    dbus_bool_t b_dvd;
-
-    if( !libhal_device_property_exists( p_sys->p_ctx, psz_device,
-                                        "storage.cdrom.dvd", NULL ) )
-        return NULL;
-
-    p_dev = (device_t *)malloc( sizeof( device_t ) );
-    p_dev->i_media_type = p_dev->i_capabilities = 0;
-    p_dev->psz_name = p_dev->psz_uri = NULL;
-
-    block_dev =  libhal_device_get_property_string( p_sys->p_ctx, psz_device,
-                                                   "block.device" , NULL );
-    if( block_dev )
-    {
-        p_dev->psz_uri = strdup( block_dev );
-        libhal_free_string( block_dev );
-    }
-
-    b_dvd = libhal_device_get_property_bool( p_sys->p_ctx, psz_device,
-                                            "storage.cdrom.dvd", NULL  );
-    if( b_dvd )
-        p_dev->i_capabilities = DEVICE_CAN_DVD | DEVICE_CAN_CD;
-    else
-        p_dev->i_capabilities = DEVICE_CAN_CD;
-
-    UpdateMedia( p_probe, p_dev );
-    return p_dev;
-}
-
-static void UpdateMedia( device_probe_t *p_probe, device_t *p_dev )
-{
-    probe_sys_t *p_sys = p_probe->p_sys;
-    char **matching_media;
-    int i_matching, i;
-    bool b_changed = false;;
-    int i_old_type = p_dev->i_media_type;
-    p_dev->i_media_type = 0;
-
-    /* Find the media in the drive */
-    matching_media = libhal_manager_find_device_string_match( p_sys->p_ctx,
-                                            "block.device", p_dev->psz_uri,
-                                            &i_matching, NULL );
-    for( i = 0; i < i_matching; i++ )
-    {
-        if( libhal_device_property_exists( p_sys->p_ctx, matching_media[i],
-                                           "volume.disc.type", NULL ) )
-        {
-            char *psz_media_name = libhal_device_get_property_string(
-                                            p_sys->p_ctx,
-                                            matching_media[i],
-                                            "volume.label", NULL );
-            if( psz_media_name )
-            {
-                if( p_dev->psz_name && strcmp( p_dev->psz_name, psz_media_name))
-                {
-                    free( p_dev->psz_name );
-                    p_dev->psz_name = NULL;
-                    b_changed = true;
-                }
-                if( !p_dev->psz_name )
-                    p_dev->psz_name = strdup( psz_media_name );
-                libhal_free_string( psz_media_name );
-            }
-
-            if( libhal_device_get_property_bool( p_sys->p_ctx,
-                                             matching_media[i],
-                                             "volume.disc.is_videodvd", NULL) )
-                p_dev->i_media_type = MEDIA_TYPE_DVD;
-            else if( libhal_device_get_property_bool( p_sys->p_ctx,
-                                             matching_media[i],
-                                             "volume.disc.is_vcd", NULL) ||
-                     libhal_device_get_property_bool( p_sys->p_ctx,
-                                             matching_media[i],
-                                             "volume.disc.is_svcd", NULL) )
-               p_dev->i_media_type = MEDIA_TYPE_VCD;
-            else if( libhal_device_get_property_bool( p_sys->p_ctx,
-                                             matching_media[i],
-                                             "volume.disc.has_audio", NULL) )
-               p_dev->i_media_type = MEDIA_TYPE_CDDA;
-
-            break;
-        }
-    }
-    if( b_changed || p_dev->i_media_type != i_old_type )
-    {
-        /// \todo emit changed signal
-    }
-}
index b1fa6ce352ee05a2c58f20c310696645634062ed..0489eb5d4d914da7f2c1e6184a48cd8db804e8c0 100644 (file)
@@ -17,7 +17,6 @@ include/vlc_config.h
 include/vlc_configuration.h
 include/vlc_demux.h
 include/vlc/deprecated.h
-include/vlc_devices.h
 include/vlc_epg.h
 include/vlc_es.h
 include/vlc_es_out.h
@@ -146,7 +145,6 @@ src/misc/beos_specific.cpp
 src/misc/block.c
 src/misc/cpu.c
 src/misc/darwin_specific.c
-src/misc/devices.c
 src/misc/error.c
 src/misc/es_format.c
 src/misc/events.c
index 92e6ce95627c4f051a4636ce6218e41c47028847..5ceb0d1e6a66ae1084b73302dbb3ade4946b28a0 100644 (file)
@@ -109,7 +109,6 @@ noinst_HEADERS = \
        ../include/mmx.h \
        ../include/vlc_codec_synchro.h \
        ../include/vlc_codecs.h \
-       ../include/vlc_devices.h \
        ../include/vlc_fixups.h \
        ../include/vlc_interface.h \
        ../include/vlc_intf_strings.h \
@@ -433,7 +432,6 @@ SOURCES_libvlc_common = \
        misc/update.c \
        misc/update_crypto.c \
        misc/xml.c \
-       misc/devices.c \
        extras/libc.c \
        misc/filter.c \
        misc/filter_chain.c \
diff --git a/src/misc/devices.c b/src/misc/devices.c
deleted file mode 100644 (file)
index a1cc534..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*****************************************************************************
- * devices.c : Handling of devices probing
- *****************************************************************************
- * Copyright (C) 1998-2004 the VideoLAN team
- * $Id$
- *
- * Authors: Clément Stenac <zorglub@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (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
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU 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.
- *****************************************************************************/
-
-#if 0
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc/intf.h>
-#include <vlc_devices.h>
-
-static intf_thread_t *p_probe_thread = NULL;
-
-void devices_ProbeCreate( vlc_object_t *p_this )
-{
-    intf_thread_t * p_probe;
-
-    /* Allocate structure */
-    p_probe = vlc_object_create( p_this, VLC_OBJECT_INTF );
-    if( !p_probe )
-        return;
-    p_probe->p_module = module_need( p_probe, "devices probe", NULL, false );
-    if( p_probe->p_module == NULL )
-    {
-        msg_Err( p_this, "no devices probing module could be loaded" );
-        vlc_object_release( p_probe );
-        return;
-    }
-
-    p_probe_thread = p_probe;
-}
-
-#endif