Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
a0b1b870 by Thomas Guillem at 2022-03-16T10:01:32+00:00
libvlc: media: remove state handling

Incomplete since c0c35a50025df54cee95ddb00b325438b1f47e5e

The state should be fetched from the player, the list_player or the
parser.

Fixes #26705

- - - - -


6 changed files:

- include/vlc/libvlc_events.h
- include/vlc/libvlc_media.h
- lib/libvlc.sym
- lib/media.c
- lib/media_internal.h
- lib/media_player.c


Changes:

=====================================
include/vlc/libvlc_events.h
=====================================
@@ -72,17 +72,12 @@ enum libvlc_event_e {
     libvlc_MediaParsedChanged,
 
     /* Removed: libvlc_MediaFreed, */
+    /* Removed: libvlc_MediaStateChanged */
 
-    /**
-     * \link #libvlc_state_t State\endlink of the \link
-     * #libvlc_media_t media item\endlink changed
-     * \see libvlc_media_get_state()
-     */
-    libvlc_MediaStateChanged = libvlc_MediaParsedChanged + 2,
     /**
      * Subitem tree was added to a \link #libvlc_media_t media item\endlink
      */
-    libvlc_MediaSubItemTreeAdded,
+    libvlc_MediaSubItemTreeAdded = libvlc_MediaParsedChanged + 3,
     /**
      * A thumbnail generation for this \link #libvlc_media_t media \endlink 
completed.
      * \see libvlc_media_thumbnail_request_by_time()


=====================================
include/vlc/libvlc_media.h
=====================================
@@ -496,20 +496,6 @@ LIBVLC_API void libvlc_media_set_meta( libvlc_media_t 
*p_md,
  */
 LIBVLC_API int libvlc_media_save_meta( libvlc_media_t *p_md );
 
-
-/**
- * Get current state of media descriptor object. Possible media states are
- * libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Playing, libvlc_Paused,
- * libvlc_Stopped, libvlc_Stopping, libvlc_Error.
- *
- * \see libvlc_state_t
- * \param p_md a media descriptor object
- * \return state of media descriptor object
- */
-LIBVLC_API libvlc_state_t libvlc_media_get_state(
-                                   libvlc_media_t *p_md );
-
-
 /**
  * Get the current statistics about the media
  * \param p_md media descriptor object


=====================================
lib/libvlc.sym
=====================================
@@ -73,7 +73,6 @@ libvlc_media_get_duration
 libvlc_media_get_filestat
 libvlc_media_get_meta
 libvlc_media_get_mrl
-libvlc_media_get_state
 libvlc_media_get_stats
 libvlc_media_get_tracklist
 libvlc_media_get_type


=====================================
lib/media.c
=====================================
@@ -513,8 +513,6 @@ libvlc_media_t * libvlc_media_new_from_input_item(
     vlc_mutex_init(&p_md->subitems_lock);
     atomic_init(&p_md->worker_count, 0);
 
-    p_md->state = libvlc_NothingSpecial;
-
     /* A media descriptor can be a playlist. When you open a playlist
      * It can give a bunch of item to read. */
     p_md->p_subitems        = NULL;
@@ -736,31 +734,6 @@ int libvlc_media_save_meta( libvlc_media_t *p_md )
     return input_item_WriteMeta( p_obj, p_md->p_input_item ) == VLC_SUCCESS;
 }
 
-// Getter for state information
-libvlc_state_t
-libvlc_media_get_state( libvlc_media_t *p_md )
-{
-    assert( p_md );
-    return p_md->state;
-}
-
-// Setter for state information (LibVLC Internal)
-void
-libvlc_media_set_state( libvlc_media_t *p_md,
-                                   libvlc_state_t state )
-{
-    libvlc_event_t event;
-
-    p_md->state = state;
-
-    /* Construct the event */
-    event.type = libvlc_MediaStateChanged;
-    event.u.media_state_changed.new_state = state;
-
-    /* Send the event */
-    libvlc_event_send( &p_md->event_manager, &event );
-}
-
 // Get subitems of media descriptor object.
 libvlc_media_list_t *
 libvlc_media_subitems( libvlc_media_t * p_md )


=====================================
lib/media_internal.h
=====================================
@@ -38,7 +38,6 @@ struct libvlc_media_t
 
     input_item_t      *p_input_item;
     libvlc_instance_t *p_libvlc_instance;
-    libvlc_state_t     state;
     vlc_atomic_rc_t    rc;
 
     VLC_FORWARD_DECLARE_OBJECT(libvlc_media_list_t*) p_subitems; /* A media 
descriptor can have Sub items. This is the only dependency we really have on 
media_list */
@@ -62,7 +61,6 @@ struct libvlc_media_t
 libvlc_media_t * libvlc_media_new_from_input_item(
         libvlc_instance_t *, input_item_t * );
 
-void libvlc_media_set_state( libvlc_media_t *, libvlc_state_t );
 void libvlc_media_add_subtree(libvlc_media_t *, input_item_node_t *);
 
 static inline enum es_format_category_e


=====================================
lib/media_player.c
=====================================
@@ -38,7 +38,6 @@
 #include <vlc_actions.h>
 
 #include "libvlc_internal.h"
-#include "media_internal.h" // libvlc_media_set_state()
 #include "media_player_internal.h"
 #include "renderer_discoverer_internal.h"
 



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/a0b1b8703558b45e931b69fcf00642f503b6f45a

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/a0b1b8703558b45e931b69fcf00642f503b6f45a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to