]> git.sesse.net Git - vlc/commitdiff
libvlc: Split libvlc_internal in different independant headers.
authorPierre d'Herbemont <pdherbemont@free.fr>
Mon, 25 May 2009 08:47:38 +0000 (01:47 -0700)
committerPierre d'Herbemont <pdherbemont@free.fr>
Mon, 25 May 2009 09:58:34 +0000 (02:58 -0700)
21 files changed:
src/Makefile.am
src/control/audio.c
src/control/flat_media_list_view.c
src/control/hierarchical_media_list_view.c
src/control/hierarchical_node_media_list_view.c
src/control/libvlc_internal.h
src/control/media.c
src/control/media_discoverer.c
src/control/media_internal.h [new file with mode: 0644]
src/control/media_library.c
src/control/media_list.c
src/control/media_list_internal.h [new file with mode: 0644]
src/control/media_list_path.h
src/control/media_list_player.c
src/control/media_list_view.c
src/control/media_list_view_internal.h [new file with mode: 0644]
src/control/media_player.c
src/control/media_player_internal.h [new file with mode: 0644]
src/control/mediacontrol_audio_video.c
src/control/video.c
src/control/vlm.c

index d9a8266d119d71e5a2b51bcddc8b34fcf2264e44..290ff2c4c32f92a9b90b91808cfedff3b9c74997 100644 (file)
@@ -437,6 +437,10 @@ SOURCES_libvlc = \
 
 SOURCES_libvlc_control = \
        control/libvlc_internal.h \
+       control/media_internal.h \
+       control/media_list_internal.h \
+       control/media_list_view_internal.h \
+       control/media_player_internal.h \
        control/core.c \
        control/log.c \
        control/playlist.c \
index ff794a42d4e94c53bdb5dc8a7cea6a402ee0c30c..ce4f96db54fe5ebb74dbfac872f5a3e6e10747bf 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_player.h>
 
+#include <vlc_common.h>
 #include <vlc_input.h>
 #include <vlc_aout.h>
 
+#include "libvlc_internal.h"
+#include "media_player_internal.h"
 
 /*
  * Remember to release the returned aout_instance_t since it is locked at
index f367e7b8dea64e17615e1c9da93be8d5de2ed374..e5f51401d62cb2f3e00b4977a1793ed208674524 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
-#include <vlc/libvlc.h>
 #include <assert.h>
-#include "vlc_arrays.h"
+
+#include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_list_view.h>
+
+#include "media_list_view_internal.h"
+
 
 //#define DEBUG_FLAT_VIEW
 
index 4d345280ff3a8653fdf2b3b880c5e6d5f91c6997..ee89ba8e5514138dcb6d91c14d3803240457ea95 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
 #include <vlc/libvlc.h>
-#include <assert.h>
-#include "vlc_arrays.h"
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_list_view.h>
+
+#include "media_list_internal.h"
+#include "media_list_view_internal.h"
 
 //#define DEBUG_HIERARCHICAL_VIEW
 
index 6ad50af5475518f9237c9b694b8e709b63c4e780..fed48995bca17c45ce350cbe467f88d7a0d1ea1d 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
 #include <vlc/libvlc.h>
-#include <assert.h>
-#include "vlc_arrays.h"
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_list_view.h>
+
+#include "media_internal.h" // Abuse, could ans should be removed
+#include "media_list_internal.h" // Abuse, could ans should be removed
+#include "media_list_view_internal.h"
 
 /* FIXME: This version is probably a bit overheaded, and we may want to store
  * the items in a vlc_array_t to speed everything up */
index 311a859cd71c0a4b44158083ab1e2c0ede829bfc..392bcce89bbcd407fad0f36a278c6e26782215df 100644 (file)
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
 #include <vlc/libvlc_structures.h>
+#include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_events.h>
 
 #include <vlc_common.h>
-#include <vlc_arrays.h>
-#include <vlc_input.h>
 
 /***************************************************************************
  * Internal creation and destruction functions
@@ -51,8 +51,6 @@ VLC_EXPORT (void, libvlc_InternalWait, ( libvlc_int_t * ) );
  * Opaque structures for libvlc API
  ***************************************************************************/
 
-typedef int * libvlc_media_list_path_t; /* (Media List Player Internal) */
-
 typedef enum libvlc_lock_state_t
 {
     libvlc_Locked,
@@ -71,116 +69,6 @@ struct libvlc_instance_t
     struct libvlc_callback_entry_list_t *p_callback_list;
 };
 
-struct libvlc_media_t
-{
-    libvlc_event_manager_t * p_event_manager;
-    int                b_preparsed;
-    input_item_t      *p_input_item;
-    int                i_refcount;
-    libvlc_instance_t *p_libvlc_instance;
-    libvlc_state_t     state;
-    struct libvlc_media_list_t *p_subitems; /* A media descriptor can have
-                                           * Sub item */
-    void *p_user_data; /* Allows for VLC.framework to hook into media descriptor without creating a new VLCMedia object. */
-};
-
-struct libvlc_media_list_t
-{
-    libvlc_event_manager_t *    p_event_manager;
-    libvlc_instance_t *         p_libvlc_instance;
-    int                         i_refcount;
-    vlc_mutex_t                 object_lock;
-    vlc_mutex_t                 refcount_lock;
-    libvlc_media_t * p_md; /* The media from which the
-                                       * mlist comes, if any. */
-    vlc_array_t                items;
-
-    /* Other way to see that media list */
-    /* Used in flat_media_list.c */
-    libvlc_media_list_t *       p_flat_mlist;
-
-    /* This indicates if this media list is read-only
-     * from a user point of view */
-    bool                  b_read_only;
-};
-
-typedef libvlc_media_list_view_t * (*libvlc_media_list_view_constructor_func_t)( libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e ) ;
-typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ;
-
-typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
-        libvlc_exception_t * ) ;
-
-typedef libvlc_media_t *
-        (*libvlc_media_list_view_item_at_index_func_t)(
-                libvlc_media_list_view_t * p_mlv,
-                int index,
-                libvlc_exception_t * ) ;
-
-typedef libvlc_media_list_view_t *
-        (*libvlc_media_list_view_children_at_index_func_t)(
-                libvlc_media_list_view_t * p_mlv,
-                int index,
-                libvlc_exception_t * ) ;
-
-/* A way to see a media list */
-struct libvlc_media_list_view_t
-{
-    libvlc_event_manager_t *    p_event_manager;
-    libvlc_instance_t *         p_libvlc_instance;
-    int                         i_refcount;
-    vlc_mutex_t                 object_lock;
-
-    libvlc_media_list_t *       p_mlist;
-
-    struct libvlc_media_list_view_private_t * p_this_view_data;
-
-    /* Accessors */
-    libvlc_media_list_view_count_func_t              pf_count;
-    libvlc_media_list_view_item_at_index_func_t      pf_item_at_index;
-    libvlc_media_list_view_children_at_index_func_t  pf_children_at_index;
-
-    libvlc_media_list_view_constructor_func_t        pf_constructor;
-    libvlc_media_list_view_release_func_t            pf_release;
-
-    /* Notification callback */
-    void (*pf_ml_item_added)(const libvlc_event_t *, libvlc_media_list_view_t *);
-    void (*pf_ml_item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *);
-};
-
-struct libvlc_media_player_t
-{
-    int                i_refcount;
-    vlc_mutex_t        object_lock;
-    input_thread_t *   p_input_thread;
-    struct libvlc_instance_t * p_libvlc_instance; /* Parent instance */
-    libvlc_media_t * p_md; /* current media descriptor */
-    libvlc_event_manager_t * p_event_manager;
-    struct
-    {
-        void *hwnd;
-        void *nsobject;
-        uint32_t xid;
-        uint32_t agl;
-    } drawable;
-};
-
-struct libvlc_media_library_t
-{
-    libvlc_event_manager_t * p_event_manager;
-    libvlc_instance_t *      p_libvlc_instance;
-    int                      i_refcount;
-    libvlc_media_list_t *    p_mlist;
-};
-
-struct libvlc_media_discoverer_t
-{
-    libvlc_event_manager_t * p_event_manager;
-    libvlc_instance_t *      p_libvlc_instance;
-    services_discovery_t *   p_sd;
-    libvlc_media_list_t *    p_mlist;
-    bool                     running;
-    vlc_dictionary_t         catname_to_submedialist;
-};
 
 /*
  * Event Handling
@@ -248,65 +136,6 @@ typedef struct libvlc_event_manager_t
 /***************************************************************************
  * Other internal functions
  ***************************************************************************/
-input_thread_t *libvlc_get_input_thread(
-     libvlc_media_player_t *,
-    libvlc_exception_t * );
-
-/* Media Descriptor */
-libvlc_media_t * libvlc_media_new_from_input_item(
-        libvlc_instance_t *, input_item_t *,
-        libvlc_exception_t * );
-
-void libvlc_media_set_state(
-        libvlc_media_t *, libvlc_state_t,
-        libvlc_exception_t * );
-
-/* Media List */
-void _libvlc_media_list_add_media(
-        libvlc_media_list_t * p_mlist,
-        libvlc_media_t * p_md,
-        libvlc_exception_t * p_e );
-
-void _libvlc_media_list_insert_media(
-        libvlc_media_list_t * p_mlist,
-        libvlc_media_t * p_md, int index,
-        libvlc_exception_t * p_e );
-
-void _libvlc_media_list_remove_index(
-        libvlc_media_list_t * p_mlist, int index,
-        libvlc_exception_t * p_e );
-
-/* Media List View */
-libvlc_media_list_view_t * libvlc_media_list_view_new(
-        libvlc_media_list_t * p_mlist,
-        libvlc_media_list_view_count_func_t pf_count,
-        libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
-        libvlc_media_list_view_children_at_index_func_t pf_children_at_index,
-        libvlc_media_list_view_constructor_func_t pf_constructor,
-        libvlc_media_list_view_release_func_t pf_release,
-        void * this_view_data,
-        libvlc_exception_t * p_e );
-
-void libvlc_media_list_view_set_ml_notification_callback(
-        libvlc_media_list_view_t * p_mlv,
-        void (*item_added)(const libvlc_event_t *, libvlc_media_list_view_t *),
-        void (*item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *) );
-
-void libvlc_media_list_view_will_delete_item(
-        libvlc_media_list_view_t * p_mlv,
-        libvlc_media_t * p_item, int index );
-
-void libvlc_media_list_view_item_deleted(
-        libvlc_media_list_view_t * p_mlv,
-        libvlc_media_t * p_item, int index );
-
-void libvlc_media_list_view_will_add_item (
-        libvlc_media_list_view_t * p_mlv,
-        libvlc_media_t * p_item, int index );
-
-void libvlc_media_list_view_item_added(
-        libvlc_media_list_view_t * p_mlv,
-        libvlc_media_t * p_item, int index );
 
 /* Events */
 libvlc_event_manager_t * libvlc_event_manager_new(
@@ -325,12 +154,6 @@ void libvlc_event_send(
         libvlc_event_manager_t * p_em,
         libvlc_event_t * p_event );
 
-/* Media player - audio, video */
-libvlc_track_description_t * libvlc_get_track_description(
-        libvlc_media_player_t *p_mi,
-        const char *psz_variable,
-        libvlc_exception_t *p_e );
-
 
 /* Exception shorcuts */
 
index 400c138bf1c51d5588b624310fa0ed5973ddbb3f..be921277a164515faf284e11cbbb2cc401139145 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
-#include "libvlc.h"
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h> // For the subitems, here for convenience
+#include <vlc/libvlc_events.h>
+
+#include <vlc_common.h>
 #include <vlc_input.h>
 #include <vlc_meta.h>
+#include <vlc_playlist.h> /* For the preparser */
 
-/* For the preparser */
-#include <vlc_playlist.h>
+#include "libvlc.h"
+
+#include "libvlc_internal.h"
+#include "media_internal.h"
 
 static const vlc_meta_type_t libvlc_to_vlc_meta[] =
 {
index 4615d5f51fdb0f99f0f70c26fde5d614d3b94132..94b4b0aef6787fbf4526b6f113e16421a55bf991 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
-#include <vlc/libvlc.h>
 #include <assert.h>
-#include "vlc_services_discovery.h"
+
+#include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_discoverer.h>
+#include <vlc/libvlc_events.h>
+
+#include <vlc_services_discovery.h>
+
+#include "libvlc_internal.h"
+#include "media_internal.h" // libvlc_media_new_from_input_item()
+#include "media_list_internal.h" // _libvlc_media_list_add_media()
+
+struct libvlc_media_discoverer_t
+{
+    libvlc_event_manager_t * p_event_manager;
+    libvlc_instance_t *      p_libvlc_instance;
+    services_discovery_t *   p_sd;
+    libvlc_media_list_t *    p_mlist;
+    bool                     running;
+    vlc_dictionary_t         catname_to_submedialist;
+};
 
 /*
  * Private functions
diff --git a/src/control/media_internal.h b/src/control/media_internal.h
new file mode 100644 (file)
index 0000000..48a6fa8
--- /dev/null
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * libvlc_internal.h : Definition of opaque structures for libvlc exported API
+ * Also contains some internal utility functions
+ *****************************************************************************
+ * Copyright (C) 2005-2009 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 _LIBVLC_MEDIA_INTERNAL_H
+#define _LIBVLC_MEDIA_INTERNAL_H 1
+
+#include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+
+#include <vlc_common.h>
+#include <vlc_input.h>
+
+struct libvlc_media_t
+{
+    libvlc_event_manager_t * p_event_manager;
+    int                b_preparsed;
+    input_item_t      *p_input_item;
+    int                i_refcount;
+    libvlc_instance_t *p_libvlc_instance;
+    libvlc_state_t     state;
+    VLC_FORWARD_DECLARE_OBJECT(libvlc_media_list_t*) p_subitems; /* A media descriptor can have Sub items. This is the only dependancy we really have on media_list */
+    void *p_user_data;
+};
+
+/* Media Descriptor */
+libvlc_media_t * libvlc_media_new_from_input_item(
+        libvlc_instance_t *, input_item_t *,
+        libvlc_exception_t * );
+
+void libvlc_media_set_state(
+        libvlc_media_t *, libvlc_state_t,
+        libvlc_exception_t * );
+
+#endif
index a85c1b92e333063f1c5d48f61124cb75732b8249..7be475f0d4cc2d5ecde4a704a629c18be6e6a9a5 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
-#include "libvlc_internal.h"
+
 #include <vlc/libvlc.h>
-#include "libvlc.h"
-#include "vlc_arrays.h"
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_library.h>
+#include <vlc/libvlc_events.h>
+
+#include <vlc_common.h>
+
+#include "libvlc_internal.h"
+
+struct libvlc_media_library_t
+{
+    libvlc_event_manager_t * p_event_manager;
+    libvlc_instance_t *      p_libvlc_instance;
+    int                      i_refcount;
+    libvlc_media_list_t *    p_mlist;
+};
+
 
 /*
  * Private functions
index e8ae52bb04668ba649483f4b3d2ad1bc76f02b16..5fa32527b79bd15478387ed3d05b741fb7241a86 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
-#include <vlc/libvlc.h>
 #include <assert.h>
-#include "vlc_arrays.h"
+
+#include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_events.h>
+
+#include <vlc_common.h>
+#include <vlc_input.h>
+
+#include "libvlc_internal.h"
+#include "media_internal.h" // libvlc_media_new_from_input_item()
+#include "media_list_internal.h"
 
 typedef enum EventPlaceInTime {
     EventWillHappen,
diff --git a/src/control/media_list_internal.h b/src/control/media_list_internal.h
new file mode 100644 (file)
index 0000000..a9ee2c7
--- /dev/null
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * libvlc_internal.h : Definition of opaque structures for libvlc exported API
+ * Also contains some internal utility functions
+ *****************************************************************************
+ * Copyright (C) 2005-2009 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 _LIBVLC_MEDIA_LIST_INTERNAL_H
+#define _LIBVLC_MEDIA_LIST_INTERNAL_H 1
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc/vlc.h>
+#include <vlc/libvlc_structures.h>
+#include <vlc/libvlc_media.h>
+
+#include <vlc_common.h>
+
+struct libvlc_media_list_t
+{
+    libvlc_event_manager_t *    p_event_manager;
+    libvlc_instance_t *         p_libvlc_instance;
+    int                         i_refcount;
+    vlc_mutex_t                 object_lock;
+    vlc_mutex_t                 refcount_lock;
+    libvlc_media_t * p_md; /* The media from which the
+                                       * mlist comes, if any. */
+    vlc_array_t                items;
+
+    /* Other way to see that media list */
+    /* Used in flat_media_list.c */
+    libvlc_media_list_t *       p_flat_mlist;
+
+    /* This indicates if this media list is read-only
+     * from a user point of view */
+    bool                  b_read_only;
+};
+
+/* Media List */
+void _libvlc_media_list_add_media(
+        libvlc_media_list_t * p_mlist,
+        libvlc_media_t * p_md,
+        libvlc_exception_t * p_e );
+
+void _libvlc_media_list_insert_media(
+        libvlc_media_list_t * p_mlist,
+        libvlc_media_t * p_md, int index,
+        libvlc_exception_t * p_e );
+
+void _libvlc_media_list_remove_index(
+        libvlc_media_list_t * p_mlist, int index,
+        libvlc_exception_t * p_e );
+
+#endif
index 00216dad432d8e822814ba7f43ecc44214d20830..a73dbe0beb0fac3fdfdcafaa2fa74bc3871dc737 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef _LIBVLC_MEDIA_LIST_PATH_H
 #define _LIBVLC_MEDIA_LIST_PATH_H 1
 
+typedef int * libvlc_media_list_path_t; /* (Media List Player Internal) */
+
 /**************************************************************************
  *       path_empty (Media List Player Internal)
  **************************************************************************/
index 19c029eb9a86fda7fbf8d9f1c99268fd4128f88b..1ed1af0b324b10fb3d79127718a99877066d19ef 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
-#include "libvlc_internal.h"
+
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_player.h>
+#include <vlc/libvlc_media_list_player.h>
+#include <vlc/libvlc_events.h>
+
+#include "libvlc_internal.h"
+
+#include "media_internal.h" // Abuse, could and should be removed
 #include "media_list_path.h"
 
 
index 5ed71d0f9d77e395fdc6ffade8eb2204261209db..62818f8274c89b37848e43f52cdff28d70a282bf 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
 #include <vlc/libvlc.h>
-#include <assert.h>
-#include "vlc_arrays.h"
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_list_view.h>
+#include <vlc/libvlc_events.h>
+
+#include "libvlc_internal.h"  // Abuse, could and should be removed
+
+#include "media_internal.h"  // Abuse, could and should be removed
+#include "media_list_internal.h"  // Abuse, could and should be removed
+#include "media_list_view_internal.h"
 
 //#define DEBUG_FLAT_LIST
 
diff --git a/src/control/media_list_view_internal.h b/src/control/media_list_view_internal.h
new file mode 100644 (file)
index 0000000..b453478
--- /dev/null
@@ -0,0 +1,113 @@
+/*****************************************************************************
+ * libvlc_internal.h : Definition of opaque structures for libvlc exported API
+ * Also contains some internal utility functions
+ *****************************************************************************
+ * Copyright (C) 2005-2009 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 LIBVLC_MEDIA_LIST_VIEW_INTERNAL_H
+#define LIBVLC_MEDIA_LIST_VIEW_INTERNAL_H 1
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc/vlc.h>
+#include <vlc/libvlc_structures.h>
+#include <vlc/libvlc_media_list.h>
+
+#include <vlc_common.h>
+
+typedef libvlc_media_list_view_t * (*libvlc_media_list_view_constructor_func_t)( libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e ) ;
+typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ;
+
+typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
+        libvlc_exception_t * ) ;
+
+typedef libvlc_media_t *
+        (*libvlc_media_list_view_item_at_index_func_t)(
+                libvlc_media_list_view_t * p_mlv,
+                int index,
+                libvlc_exception_t * ) ;
+
+typedef libvlc_media_list_view_t *
+        (*libvlc_media_list_view_children_at_index_func_t)(
+                libvlc_media_list_view_t * p_mlv,
+                int index,
+                libvlc_exception_t * ) ;
+
+/* A way to see a media list */
+struct libvlc_media_list_view_t
+{
+    libvlc_event_manager_t *    p_event_manager;
+    libvlc_instance_t *         p_libvlc_instance;
+    int                         i_refcount;
+    vlc_mutex_t                 object_lock;
+
+    libvlc_media_list_t *       p_mlist;
+
+    struct libvlc_media_list_view_private_t * p_this_view_data;
+
+    /* Accessors */
+    libvlc_media_list_view_count_func_t              pf_count;
+    libvlc_media_list_view_item_at_index_func_t      pf_item_at_index;
+    libvlc_media_list_view_children_at_index_func_t  pf_children_at_index;
+
+    libvlc_media_list_view_constructor_func_t        pf_constructor;
+    libvlc_media_list_view_release_func_t            pf_release;
+
+    /* Notification callback */
+    void (*pf_ml_item_added)(const libvlc_event_t *, libvlc_media_list_view_t *);
+    void (*pf_ml_item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *);
+};
+
+/* Media List View */
+libvlc_media_list_view_t * libvlc_media_list_view_new(
+        libvlc_media_list_t * p_mlist,
+        libvlc_media_list_view_count_func_t pf_count,
+        libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
+        libvlc_media_list_view_children_at_index_func_t pf_children_at_index,
+        libvlc_media_list_view_constructor_func_t pf_constructor,
+        libvlc_media_list_view_release_func_t pf_release,
+        void * this_view_data,
+        libvlc_exception_t * p_e );
+
+void libvlc_media_list_view_set_ml_notification_callback(
+        libvlc_media_list_view_t * p_mlv,
+        void (*item_added)(const libvlc_event_t *, libvlc_media_list_view_t *),
+        void (*item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *) );
+
+void libvlc_media_list_view_will_delete_item(
+        libvlc_media_list_view_t * p_mlv,
+        libvlc_media_t * p_item, int index );
+
+void libvlc_media_list_view_item_deleted(
+        libvlc_media_list_view_t * p_mlv,
+        libvlc_media_t * p_item, int index );
+
+void libvlc_media_list_view_will_add_item (
+        libvlc_media_list_view_t * p_mlv,
+        libvlc_media_t * p_item, int index );
+
+void libvlc_media_list_view_item_added(
+        libvlc_media_list_view_t * p_mlv,
+        libvlc_media_t * p_item, int index );
+
+#endif
index 82fab1e3579f3a9e92e1445a78b7f962c01d8290..da585f31806d3ca2573fe420376347e268396da7 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
+#include <assert.h>
 
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_events.h>
+
 #include <vlc_demux.h>
 #include <vlc_input.h>
 #include <vlc_vout.h>
+
 #include "libvlc.h"
-#include <assert.h>
+
+#include "libvlc_internal.h"
+#include "media_internal.h" // libvlc_media_set_state()
+#include "media_player_internal.h"
 
 static int
 input_seekable_changed( vlc_object_t * p_this, char const * psz_cmd,
diff --git a/src/control/media_player_internal.h b/src/control/media_player_internal.h
new file mode 100644 (file)
index 0000000..3eeda53
--- /dev/null
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * libvlc_internal.h : Definition of opaque structures for libvlc exported API
+ * Also contains some internal utility functions
+ *****************************************************************************
+ * Copyright (C) 2005-2009 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 _LIBVLC_MEDIA_PLAYER_INTERNAL_H
+#define _LIBVLC_MEDIA_PLAYER_INTERNAL_H 1
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc/vlc.h>
+#include <vlc/libvlc_structures.h>
+#include <vlc/libvlc_media.h>
+
+struct libvlc_media_player_t
+{
+    int                i_refcount;
+    vlc_mutex_t        object_lock;
+    input_thread_t *   p_input_thread;
+    struct libvlc_instance_t * p_libvlc_instance; /* Parent instance */
+    libvlc_media_t * p_md; /* current media descriptor */
+    libvlc_event_manager_t * p_event_manager;
+    struct
+    {
+        void *hwnd;
+        void *nsobject;
+        uint32_t xid;
+        uint32_t agl;
+    } drawable;
+};
+
+/* Media player - audio, video */
+input_thread_t *libvlc_get_input_thread(libvlc_media_player_t *, libvlc_exception_t * );
+
+
+libvlc_track_description_t * libvlc_get_track_description(
+        libvlc_media_player_t *p_mi,
+        const char *psz_variable,
+        libvlc_exception_t *p_e );
+
+#endif
index 401adcfaf5cd1559153bacf7a4dab96edd66171a..cb28ccfacbe8fae680e1282d0cae041ce7e3b37b 100644 (file)
 #endif
 #include "mediacontrol_internal.h"
 #include "libvlc_internal.h"
+#include "media_player_internal.h"
 
 #include <vlc/mediacontrol.h>
 #include <vlc/libvlc.h>
 
 #include <vlc_vout.h>
+#include <vlc_input.h>
 #include <vlc_osd.h>
 #include <vlc_block.h>
 
index 380decdb300437233140c4486023ffb8db1070e1..3b79f555f9a22e112425b05aff680c6335405b82 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
-
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_player.h>
+
+#include <vlc_common.h>
 #include <vlc_input.h>
 #include <vlc_vout.h>
 
+#include "media_player_internal.h"
+
 /*
  * Remember to release the returned vout_thread_t.
  */
index 5c1b15f5720bed37758602860eedf9695672dfe2..30c598c208e7126cabed68ead822ca920dea5fe7 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "libvlc_internal.h"
-
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_vlm.h>
 #include <vlc_es.h>
 #include <vlc_input.h>
 #include <vlc_vlm.h>
 
+#include "libvlc_internal.h"
+
 #if 0
 /* local function to be used in libvlc_vlm_show_media only */
 static char* recurse_answer( char* psz_prefix, vlm_message_t *p_answer ) {