| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
#ifdef HAVE_CONFIG_H |
|---|
| 32 |
# include "config.h" |
|---|
| 33 |
#endif |
|---|
| 34 |
|
|---|
| 35 |
#include <vlc_common.h> |
|---|
| 36 |
#include <vlc_plugin.h> |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
extern int Activate ( vlc_object_t * ); |
|---|
| 42 |
extern void Deactivate ( vlc_object_t * ); |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
#define ADAPTOR_TEXT N_("XVideo adaptor number") |
|---|
| 48 |
#define ADAPTOR_LONGTEXT N_( \ |
|---|
| 49 |
"If your graphics card provides several adaptors, you need to choose " \ |
|---|
| 50 |
"which one will be used (you shouldn't have to change this).") |
|---|
| 51 |
|
|---|
| 52 |
#define ALT_FS_TEXT N_("Alternate fullscreen method") |
|---|
| 53 |
#define ALT_FS_LONGTEXT N_( \ |
|---|
| 54 |
"There are two ways to make a fullscreen window, unfortunately each one " \ |
|---|
| 55 |
"has its drawbacks.\n" \ |
|---|
| 56 |
"1) Let the window manager handle your fullscreen window (default), but " \ |
|---|
| 57 |
"things like taskbars will likely show on top of the video.\n" \ |
|---|
| 58 |
"2) Completely bypass the window manager, but then nothing will be able " \ |
|---|
| 59 |
"to show on top of the video.") |
|---|
| 60 |
|
|---|
| 61 |
#define DISPLAY_TEXT N_("X11 display") |
|---|
| 62 |
#define DISPLAY_LONGTEXT N_( \ |
|---|
| 63 |
"X11 hardware display to use. By default VLC will " \ |
|---|
| 64 |
"use the value of the DISPLAY environment variable.") |
|---|
| 65 |
|
|---|
| 66 |
#define CHROMA_TEXT N_("XVimage chroma format") |
|---|
| 67 |
#define CHROMA_LONGTEXT N_( \ |
|---|
| 68 |
"Force the XVideo renderer to use a specific chroma format instead of " \ |
|---|
| 69 |
"trying to improve performances by using the most efficient one.") |
|---|
| 70 |
|
|---|
| 71 |
#define SHM_TEXT N_("Use shared memory") |
|---|
| 72 |
#define SHM_LONGTEXT N_( \ |
|---|
| 73 |
"Use shared memory to communicate between VLC and the X server.") |
|---|
| 74 |
|
|---|
| 75 |
#define SCREEN_TEXT N_("Screen for fullscreen mode.") |
|---|
| 76 |
#define SCREEN_LONGTEXT N_( \ |
|---|
| 77 |
"Screen to use in fullscreen mode. For instance " \ |
|---|
| 78 |
"set it to 0 for first screen, 1 for the second.") |
|---|
| 79 |
|
|---|
| 80 |
vlc_module_begin(); |
|---|
| 81 |
set_shortname( "XVideo" ); |
|---|
| 82 |
set_category( CAT_VIDEO ); |
|---|
| 83 |
set_subcategory( SUBCAT_VIDEO_VOUT ); |
|---|
| 84 |
add_string( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, true ); |
|---|
| 85 |
add_integer( "xvideo-adaptor", -1, NULL, ADAPTOR_TEXT, ADAPTOR_LONGTEXT, true ); |
|---|
| 86 |
add_bool( "xvideo-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT, true ); |
|---|
| 87 |
add_string( "xvideo-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true ); |
|---|
| 88 |
#ifdef HAVE_SYS_SHM_H |
|---|
| 89 |
add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true ); |
|---|
| 90 |
#endif |
|---|
| 91 |
#ifdef HAVE_XINERAMA |
|---|
| 92 |
add_integer ( "xvideo-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true ); |
|---|
| 93 |
#endif |
|---|
| 94 |
|
|---|
| 95 |
set_description( N_("XVideo extension video output") ); |
|---|
| 96 |
set_capability( "video output", 150 ); |
|---|
| 97 |
set_callbacks( Activate, Deactivate ); |
|---|
| 98 |
vlc_module_end(); |
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
#if 0 |
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
static void XVideoSetAttribute( vout_thread_t *p_vout, |
|---|
| 110 |
char *attr_name, float f_value ) |
|---|
| 111 |
{ |
|---|
| 112 |
int i_attrib; |
|---|
| 113 |
XvAttribute *p_attrib; |
|---|
| 114 |
Display *p_display = p_vout->p_sys->p_display; |
|---|
| 115 |
int i_xvport = p_vout->p_sys->i_xvport; |
|---|
| 116 |
|
|---|
| 117 |
p_attrib = XvQueryPortAttributes( p_display, i_xvport, &i_attrib ); |
|---|
| 118 |
|
|---|
| 119 |
do |
|---|
| 120 |
{ |
|---|
| 121 |
i_attrib--; |
|---|
| 122 |
|
|---|
| 123 |
if( i_attrib >= 0 && !strcmp( p_attrib[ i_attrib ].name, attr_name ) ) |
|---|
| 124 |
{ |
|---|
| 125 |
int i_sv = f_value * ( p_attrib[ i_attrib ].max_value |
|---|
| 126 |
- p_attrib[ i_attrib ].min_value + 1 ) |
|---|
| 127 |
+ p_attrib[ i_attrib ].min_value; |
|---|
| 128 |
|
|---|
| 129 |
XvSetPortAttribute( p_display, i_xvport, |
|---|
| 130 |
XInternAtom( p_display, attr_name, False ), i_sv ); |
|---|
| 131 |
break; |
|---|
| 132 |
} |
|---|
| 133 |
|
|---|
| 134 |
} while( i_attrib > 0 ); |
|---|
| 135 |
|
|---|
| 136 |
if( p_attrib ) |
|---|
| 137 |
XFree( p_attrib ); |
|---|
| 138 |
} |
|---|
| 139 |
#endif |
|---|
| 140 |
|
|---|