control.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * control.h : vout internal control
00003  *****************************************************************************
00004  * Copyright (C) 2009-2010 Laurent Aimar
00005  * $Id: 2e25cb856c31dfd5da5405b548ac98103d5d56b6 $
00006  *
00007  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Lesser General Public License as published by
00011  * the Free Software Foundation; either version 2.1 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017  * GNU Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public License
00020  * along with this program; if not, write to the Free Software Foundation,
00021  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef LIBVLC_VOUT_INTERNAL_CONTROL_H
00025 #define LIBVLC_VOUT_INTERNAL_CONTROL_H
00026 
00027 /* */
00028 enum {
00029     VOUT_CONTROL_INIT,
00030     VOUT_CONTROL_CLEAN,
00031     VOUT_CONTROL_REINIT,                /* cfg */
00032 
00033 #if 0
00034     /* */
00035     VOUT_CONTROL_START,
00036     VOUT_CONTROL_STOP,
00037 #endif
00038     VOUT_CONTROL_SUBPICTURE,            /* subpicture */
00039     VOUT_CONTROL_FLUSH_SUBPICTURE,      /* integer */
00040     VOUT_CONTROL_OSD_TITLE,             /* string */
00041     VOUT_CONTROL_CHANGE_FILTERS,        /* string */
00042     VOUT_CONTROL_CHANGE_SUB_SOURCES,    /* string */
00043     VOUT_CONTROL_CHANGE_SUB_FILTERS,    /* string */
00044     VOUT_CONTROL_CHANGE_SUB_MARGIN,     /* integer */
00045 
00046     VOUT_CONTROL_PAUSE,
00047     VOUT_CONTROL_RESET,
00048     VOUT_CONTROL_FLUSH,                 /* time */
00049     VOUT_CONTROL_STEP,                  /* time_ptr */
00050 
00051     VOUT_CONTROL_FULLSCREEN,            /* bool */
00052     VOUT_CONTROL_ON_TOP,                /* bool */
00053     VOUT_CONTROL_DISPLAY_FILLED,        /* bool */
00054     VOUT_CONTROL_ZOOM,                  /* pair */
00055 
00056     VOUT_CONTROL_ASPECT_RATIO,          /* pair */
00057     VOUT_CONTROL_CROP_BORDER,           /* border */
00058     VOUT_CONTROL_CROP_RATIO,            /* pair */
00059     VOUT_CONTROL_CROP_WINDOW,           /* window */
00060 };
00061 
00062 typedef struct {
00063     int type;
00064 
00065     union {
00066         bool    boolean;
00067         mtime_t time;
00068         mtime_t *time_ptr;
00069         char    *string;
00070         int     integer;
00071         struct {
00072             int a;
00073             int b;
00074         } pair;
00075         struct {
00076             bool is_on;
00077             mtime_t date;
00078         } pause;
00079         struct {
00080             int channel;
00081             char *string;
00082         } message;
00083         struct {
00084             unsigned left;
00085             unsigned top;
00086             unsigned right;
00087             unsigned bottom;
00088         } border;
00089         struct {
00090             unsigned x;
00091             unsigned y;
00092             unsigned width;
00093             unsigned height;
00094         } window;
00095         const vout_configuration_t *cfg;
00096         subpicture_t *subpicture;
00097     } u;
00098 } vout_control_cmd_t;
00099 
00100 void vout_control_cmd_Init(vout_control_cmd_t *, int type);
00101 void vout_control_cmd_Clean(vout_control_cmd_t *);
00102 
00103 typedef struct {
00104     vlc_mutex_t lock;
00105     vlc_cond_t  wait_request;
00106     vlc_cond_t  wait_acknowledge;
00107 
00108     /* */
00109     bool is_dead;
00110     bool is_sleeping;
00111     bool can_sleep;
00112     bool is_processing;
00113     DECL_ARRAY(vout_control_cmd_t) cmd;
00114 } vout_control_t;
00115 
00116 /* */
00117 void vout_control_Init(vout_control_t *);
00118 void vout_control_Clean(vout_control_t *);
00119 
00120 /* controls outside of the vout thread */
00121 void vout_control_WaitEmpty(vout_control_t *);
00122 
00123 void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
00124 void vout_control_PushVoid(vout_control_t *, int type);
00125 void vout_control_PushBool(vout_control_t *, int type, bool boolean);
00126 void vout_control_PushInteger(vout_control_t *, int type, int integer);
00127 void vout_control_PushTime(vout_control_t *, int type, mtime_t time);
00128 void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string);
00129 void vout_control_PushPair(vout_control_t *, int type, int a, int b);
00130 void vout_control_PushString(vout_control_t *, int type, const char *string);
00131 void vout_control_Wake(vout_control_t *);
00132 
00133 /* control inside of the vout thread */
00134 int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, mtime_t deadline, mtime_t timeout);
00135 void vout_control_Dead(vout_control_t *);
00136 
00137 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines