]> git.sesse.net Git - vlc/blob - plugins/x11/xvideo.c
* ./plugins/chroma/i420_rgb16.c: 24/32 bpp software YUV.
[vlc] / plugins / x11 / xvideo.c
1 /*****************************************************************************
2  * xvideo.c : Xvideo plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 1998-2001 VideoLAN
5  * $Id: xvideo.c,v 1.6 2001/12/30 07:09:56 sam Exp $
6  *
7  * Authors: Shane Harper <shanegh@optusnet.com.au>
8  *          Vincent Seguin <seguin@via.ecp.fr>
9  *          Samuel Hocevar <sam@zoy.org>
10  *          David Kennedy <dkennedy@tinytoad.com>
11  *      
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
25  *****************************************************************************/
26
27 /*****************************************************************************
28  * Preamble
29  *****************************************************************************/
30 #include <stdlib.h>                                      /* malloc(), free() */
31 #include <string.h>                                            /* strerror() */
32
33 #include <videolan/vlc.h>
34
35 #include "xcommon.h"
36
37 /*****************************************************************************
38  * Building configuration tree
39  *****************************************************************************/
40 MODULE_CONFIG_START
41     ADD_WINDOW( "Configuration for xvideo module" )
42         ADD_COMMENT( "For now, the xvideo module cannot be configured" )
43 MODULE_CONFIG_STOP
44
45 MODULE_INIT_START
46     SET_DESCRIPTION( "XVideo extension module" )
47     ADD_CAPABILITY( VOUT, 150 )
48     ADD_SHORTCUT( "xvideo" )
49 MODULE_INIT_STOP
50
51 MODULE_ACTIVATE_START
52     _M( vout_getfunctions )( &p_module->p_functions->vout );
53 MODULE_ACTIVATE_STOP
54
55 MODULE_DEACTIVATE_START
56 MODULE_DEACTIVATE_STOP
57
58 /* following functions are local */
59
60 #if 0
61 /*****************************************************************************
62  * XVideoSetAttribute
63  *****************************************************************************
64  * This function can be used to set attributes, e.g. XV_BRIGHTNESS and
65  * XV_CONTRAST. "f_value" should be in the range of 0 to 1.
66  *****************************************************************************/
67 static void XVideoSetAttribute( vout_thread_t *p_vout,
68                                 char *attr_name, float f_value )
69 {
70     int             i_attrib;
71     XvAttribute    *p_attrib;
72     Display        *p_display = p_vout->p_sys->p_display;
73     int             i_xvport  = p_vout->p_sys->i_xvport;
74
75     p_attrib = XvQueryPortAttributes( p_display, i_xvport, &i_attrib );
76
77     do
78     {
79         i_attrib--;
80
81         if( i_attrib >= 0 && !strcmp( p_attrib[ i_attrib ].name, attr_name ) )
82         {
83             int i_sv = f_value * ( p_attrib[ i_attrib ].max_value
84                                     - p_attrib[ i_attrib ].min_value + 1 )
85                         + p_attrib[ i_attrib ].min_value;
86
87             XvSetPortAttribute( p_display, i_xvport,
88                             XInternAtom( p_display, attr_name, False ), i_sv );
89             break;
90         }
91
92     } while( i_attrib > 0 );
93
94     if( p_attrib )
95         XFree( p_attrib );
96 }
97 #endif
98