[vlc-commits] lib: remove libvlc_event_manager_register_event_type()

Rémi Denis-Courmont git at videolan.org
Wed Aug 5 20:31:28 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug  5 21:29:55 2015 +0300| [5fb1ac638e850d11bfaadf6217056ca05f7269f0] | committer: Rémi Denis-Courmont

lib: remove libvlc_event_manager_register_event_type()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5fb1ac638e850d11bfaadf6217056ca05f7269f0
---

 lib/event.c             |   14 --------------
 lib/libvlc_internal.h   |    4 ----
 lib/media.c             |    9 ---------
 lib/media_discoverer.c  |    5 -----
 lib/media_list.c        |   11 -----------
 lib/media_list_player.c |    8 --------
 lib/media_player.c      |   40 ----------------------------------------
 lib/vlm.c               |   33 ---------------------------------
 8 files changed, 124 deletions(-)

diff --git a/lib/event.c b/lib/event.c
index b97c8c7..9f0d1b6 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -51,8 +51,6 @@
  * {
  *        ...
  *        p_self->p_event_manager = libvlc_event_manager_new( p_self )
- *        libvlc_event_manager_register_event_type(p_self->p_event_manager,
- *                libvlc_MyCoolObjectDidSomething, p_e)
  *        ...
  * }
  *
@@ -131,18 +129,6 @@ void libvlc_event_manager_release( libvlc_event_manager_t * p_em )
 }
 
 /**************************************************************************
- *       libvlc_event_manager_register_event_type (internal) :
- *
- * Init an object's event manager.
- **************************************************************************/
-void libvlc_event_manager_register_event_type(
-        libvlc_event_manager_t * p_em,
-        libvlc_event_type_t event_type )
-{
-    (void) p_em; (void) event_type;
-}
-
-/**************************************************************************
  *       libvlc_event_send (internal) :
  *
  * Send a callback.
diff --git a/lib/libvlc_internal.h b/lib/libvlc_internal.h
index 65ecb14..b37b749 100644
--- a/lib/libvlc_internal.h
+++ b/lib/libvlc_internal.h
@@ -95,10 +95,6 @@ libvlc_event_manager_t * libvlc_event_manager_new(void * p_obj);
 void libvlc_event_manager_release(
         libvlc_event_manager_t * p_em );
 
-void libvlc_event_manager_register_event_type(
-        libvlc_event_manager_t * p_em,
-        libvlc_event_type_t event_type );
-
 void libvlc_event_send(
         libvlc_event_manager_t * p_em,
         libvlc_event_t * p_event );
diff --git a/lib/media.c b/lib/media.c
index 493f95f..a403d14 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -362,15 +362,6 @@ libvlc_media_t * libvlc_media_new_from_input_item(
         return NULL;
     }
 
-    libvlc_event_manager_t *em = p_md->p_event_manager;
-    libvlc_event_manager_register_event_type(em, libvlc_MediaMetaChanged);
-    libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemAdded);
-    libvlc_event_manager_register_event_type(em, libvlc_MediaFreed);
-    libvlc_event_manager_register_event_type(em, libvlc_MediaDurationChanged);
-    libvlc_event_manager_register_event_type(em, libvlc_MediaStateChanged);
-    libvlc_event_manager_register_event_type(em, libvlc_MediaParsedChanged);
-    libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemTreeAdded);
-
     vlc_gc_incref( p_md->p_input_item );
 
     install_input_item_observer( p_md );
diff --git a/lib/media_discoverer.c b/lib/media_discoverer.c
index ec1b288..ed9390b 100644
--- a/lib/media_discoverer.c
+++ b/lib/media_discoverer.c
@@ -217,11 +217,6 @@ libvlc_media_discoverer_new( libvlc_instance_t * p_inst, const char * psz_name )
         return NULL;
     }
 
-    libvlc_event_manager_register_event_type( p_mdis->p_event_manager,
-            libvlc_MediaDiscovererStarted );
-    libvlc_event_manager_register_event_type( p_mdis->p_event_manager,
-            libvlc_MediaDiscovererEnded );
-
     p_mdis->p_sd = vlc_sd_Create( (vlc_object_t*)p_inst->p_libvlc_int,
                                   psz_name );
     if( unlikely(p_mdis->p_sd == NULL) )
diff --git a/lib/media_list.c b/lib/media_list.c
index 330aa53..73076f3 100644
--- a/lib/media_list.c
+++ b/lib/media_list.c
@@ -169,17 +169,6 @@ libvlc_media_list_new( libvlc_instance_t * p_inst )
 
     p_mlist->b_read_only = false;
 
-    libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
-            libvlc_MediaListItemAdded );
-    libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
-            libvlc_MediaListWillAddItem );
-    libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
-            libvlc_MediaListItemDeleted );
-    libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
-            libvlc_MediaListWillDeleteItem );
-    libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
-            libvlc_MediaListEndReached );
-
     vlc_mutex_init( &p_mlist->object_lock );
     vlc_mutex_init( &p_mlist->refcount_lock ); // FIXME: spinlock?
 
diff --git a/lib/media_list_player.c b/lib/media_list_player.c
index 00e4c8a..e6119ea 100644
--- a/lib/media_list_player.c
+++ b/lib/media_list_player.c
@@ -496,14 +496,6 @@ libvlc_media_list_player_new(libvlc_instance_t * p_instance)
         goto error;
     }
 
-    libvlc_event_manager_register_event_type( p_mlp->p_event_manager,
-            libvlc_MediaListPlayerNextItemSet );
-    libvlc_event_manager_register_event_type( p_mlp->p_event_manager,
-            libvlc_MediaListPlayerStopped );
-    libvlc_event_manager_register_event_type( p_mlp->p_event_manager,
-            libvlc_MediaListPlayerPlayed );
-    p_mlp->e_playback_mode = libvlc_playback_mode_default;
-
     if (vlc_clone(&p_mlp->thread, playlist_thread, p_mlp,
                   VLC_THREAD_PRIORITY_LOW))
     {
diff --git a/lib/media_player.c b/lib/media_player.c
index 5784dfb..a94593e 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -95,12 +95,6 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi );
  * Shortcuts
  */
 
-#define register_event(a, b) __register_event(a, libvlc_MediaPlayer ## b)
-static inline void __register_event(libvlc_media_player_t *mp, libvlc_event_type_t type)
-{
-    libvlc_event_manager_register_event_type(mp->p_event_manager, type);
-}
-
 /*
  * The input lock protects the input and input resource pointer.
  * It MUST NOT be used from callbacks.
@@ -687,46 +681,12 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     }
     vlc_mutex_init(&mp->object_lock);
 
-    register_event(mp, NothingSpecial);
-    register_event(mp, Opening);
-    register_event(mp, Buffering);
-    register_event(mp, Playing);
-    register_event(mp, Paused);
-    register_event(mp, Stopped);
-    register_event(mp, Forward);
-    register_event(mp, Backward);
-    register_event(mp, EndReached);
-    register_event(mp, EncounteredError);
-    register_event(mp, SeekableChanged);
-
-    register_event(mp, PositionChanged);
-    register_event(mp, TimeChanged);
-    register_event(mp, LengthChanged);
-    register_event(mp, TitleChanged);
-    register_event(mp, PausableChanged);
-
-    register_event(mp, Vout);
-    register_event(mp, ScrambledChanged);
-    register_event(mp, ESAdded);
-    register_event(mp, ESDeleted);
-    register_event(mp, ESSelected);
-    register_event(mp, Corked);
-    register_event(mp, Uncorked);
-    register_event(mp, Muted);
-    register_event(mp, Unmuted);
-    register_event(mp, AudioVolume);
-    register_event(mp, AudioDevice);
-
     var_AddCallback(mp, "corks", corks_changed, NULL);
     var_AddCallback(mp, "audio-device", audio_device_changed, NULL);
     var_AddCallback(mp, "mute", mute_changed, NULL);
     var_AddCallback(mp, "volume", volume_changed, NULL);
 
     /* Snapshot initialization */
-    register_event(mp, SnapshotTaken);
-
-    register_event(mp, MediaChanged);
-
     /* Attach a var callback to the global object to provide the glue between
      * vout_thread that generates the event and media_player that re-emits it
      * with its own event manager
diff --git a/lib/vlm.c b/lib/vlm.c
index 2f5fc9a..8093dc8 100644
--- a/lib/vlm.c
+++ b/lib/vlm.c
@@ -128,39 +128,6 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance )
             libvlc_event_manager_new( p_instance->libvlc_vlm.p_vlm );
         if( unlikely(p_instance->libvlc_vlm.p_event_manager == NULL) )
             return VLC_ENOMEM;
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaAdded );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaRemoved );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaChanged );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStarted );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStopped );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStatusInit );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStatusOpening );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStatusPlaying );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStatusPause );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStatusEnd );
-        libvlc_event_manager_register_event_type(
-            p_instance->libvlc_vlm.p_event_manager,
-            libvlc_VlmMediaInstanceStatusError );
     }
 
     if( !p_instance->libvlc_vlm.p_vlm )



More information about the vlc-commits mailing list