]> git.sesse.net Git - vlc/blobdiff - include/interface.h
* ./src/video_output/video_output.c: fixed a vout4 image starvation bug.
[vlc] / include / interface.h
index ba86301b3928b34cb737a2a5317a4f12e82f0399..95e56afae90921118f4f0294ce75f917bb2f46ef 100644 (file)
@@ -4,7 +4,7 @@
  * interface, such as message output.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: interface.h,v 1.22 2001/03/21 13:42:33 sam Exp $
+ * $Id: interface.h,v 1.27 2002/02/19 00:50:18 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-/*****************************************************************************
- * Required headers:
- *  <X11/Xlib.h>
- *  <X11/extensions/XShm.h>
- *  "config.h"
- *  "common.h"
- *  "mtime.h"
- *  "threads.h"
- *  "input.h"
- *  "video.h"
- *  "video_output.h"
- *  "audio_output.h"
- *  "xconsole.h"
- *****************************************************************************/
-
 /*****************************************************************************
  * intf_thread_t: describe an interface thread
  *****************************************************************************
  * This structe describes all interface-specific data of the main (interface)
  * thread.
  *****************************************************************************/
-typedef struct _keyparam
-{
-    int key;
-    int param;
-} keyparm;
-
-typedef struct _key
-{
-    int received_key;
-    keyparm forwarded;
-    struct _key *  next;
-} intf_key;
-
-typedef intf_key * p_intf_key;
-
 typedef struct intf_thread_s
 {
     boolean_t           b_die;                                 /* `die' flag */
@@ -66,7 +36,6 @@ typedef struct intf_thread_s
     /* Specific interfaces */
     p_intf_console_t    p_console;                                /* console */
     p_intf_sys_t        p_sys;                           /* system interface */
-    p_intf_key          p_keys;
     
     /* Plugin used and shortcuts to access its capabilities */
     struct module_s *   p_module;
@@ -77,18 +46,6 @@ typedef struct intf_thread_s
     /* Interface callback */
     void             ( *pf_manage ) ( struct intf_thread_s * );
 
-    /* XXX: Channels array - new API */
-  //p_intf_channel_t *  p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
-
-    /* Channels array - NULL if not used */
-    p_intf_channel_t    p_channel;                /* description of channels */
-
-    /* Main threads - NULL if not active */
-    p_input_thread_t    p_input;
-
-    /* Specific functions */
-    keyparm (*p_intf_get_key)(struct intf_thread_s *p_intf, int r_key) ;
-
     /* XXX: new message passing stuff will go here */
     vlc_mutex_t         change_lock;
     boolean_t           b_menu_change;
@@ -97,14 +54,57 @@ typedef struct intf_thread_s
 } intf_thread_t;
 
 /*****************************************************************************
- * Prototypes
+ * msg_item_t
+ *****************************************************************************
+ * Store a single message. Messages have a maximal size of INTF_MSG_MSGSIZE.
  *****************************************************************************/
-intf_thread_t * intf_Create             ( void );
-void            intf_Destroy            ( intf_thread_t * p_intf );
+typedef struct
+{
+    int     i_type;                               /* message type, see below */
+    char *  psz_msg;                                   /* the message itself */
+
+#if 0
+    mtime_t date;                                     /* date of the message */
+    char *  psz_file;               /* file in which the function was called */
+    char *  psz_function;     /* function from which the function was called */
+    int     i_line;                 /* line at which the function was called */
+#endif
+} msg_item_t;
+
+/* Message types */
+#define INTF_MSG_STD    0                                /* standard message */
+#define INTF_MSG_ERR    1                                   /* error message */
+#define INTF_MSG_WARN   2                                 /* warning message */
+#define INTF_MSG_STAT   3                               /* statistic message */
 
-int             intf_ProcessKey         ( intf_thread_t * p_intf, int i_key );
+/*****************************************************************************
+ * intf_subscription_t
+ *****************************************************************************
+ * Used by interface plugins which subscribe to the message queue.
+ *****************************************************************************/
+typedef struct intf_subscription_s
+{
+    int   i_start;
+    int*  pi_stop;
+
+    msg_item_t*  p_msg;
+    vlc_mutex_t* p_lock;
+} intf_subscription_t;
 
-void intf_AssignKey( intf_thread_t *p_intf, int r_key, int f_key, int param);
-keyparm intf_GetKey( intf_thread_t *p_intf, int r_key);
-void intf_AssignNormalKeys( intf_thread_t *p_intf);
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+intf_thread_t * intf_Create       ( void );
+void            intf_Destroy      ( intf_thread_t * p_intf );
+
+void            intf_MsgCreate    ( void );
+void            intf_MsgDestroy   ( void );
+
+#ifndef PLUGIN
+intf_subscription_t* intf_MsgSub    ( void );
+void                 intf_MsgUnsub  ( intf_subscription_t * );
+#else
+#   define intf_MsgSub p_symbols->intf_MsgSub
+#   define intf_MsgUnsub p_symbols->intf_MsgUnsub
+#endif