00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <stdlib.h>
00028 #include <string.h>
00029
00030 #include <vlc/vlc.h>
00031 #include <vlc/vout.h>
00032
00033 #define DUMMY_WIDTH 16
00034 #define DUMMY_HEIGHT 16
00035 #define DUMMY_MAX_DIRECTBUFFERS 10
00036
00037
00038
00039
00040 static int Init ( vout_thread_t * );
00041 static void End ( vout_thread_t * );
00042 static int Manage ( vout_thread_t * );
00043 static void Render ( vout_thread_t *, picture_t * );
00044 static void Display ( vout_thread_t *, picture_t * );
00045 static void SetPalette ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
00046
00047
00048
00049
00050
00051
00052 int E_(OpenVideo) ( vlc_object_t *p_this )
00053 {
00054 vout_thread_t * p_vout = (vout_thread_t *)p_this;
00055
00056 p_vout->pf_init = Init;
00057 p_vout->pf_end = End;
00058 p_vout->pf_manage = Manage;
00059 p_vout->pf_render = Render;
00060 p_vout->pf_display = Display;
00061
00062 return VLC_SUCCESS;
00063 }
00064
00065
00066
00067
00068 static int Init( vout_thread_t *p_vout )
00069 {
00070 int i_index, i_chroma;
00071 char *psz_chroma;
00072 picture_t *p_pic;
00073 vlc_bool_t b_chroma = 0;
00074
00075 psz_chroma = config_GetPsz( p_vout, "dummy-chroma" );
00076 if( psz_chroma )
00077 {
00078 if( strlen( psz_chroma ) >= 4 )
00079 {
00080 i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
00081 psz_chroma[2], psz_chroma[3] );
00082 b_chroma = 1;
00083 }
00084
00085 free( psz_chroma );
00086 }
00087
00088 I_OUTPUTPICTURES = 0;
00089
00090
00091 if( b_chroma )
00092 {
00093 msg_Dbg( p_vout, "forcing chroma 0x%.8x (%4.4s)",
00094 i_chroma, (char*)&i_chroma );
00095 p_vout->output.i_chroma = i_chroma;
00096 if ( i_chroma == VLC_FOURCC( 'R', 'G', 'B', '2' ) )
00097 {
00098 p_vout->output.pf_setpalette = SetPalette;
00099 }
00100 p_vout->output.i_width = p_vout->render.i_width;
00101 p_vout->output.i_height = p_vout->render.i_height;
00102 p_vout->output.i_aspect = p_vout->render.i_aspect;
00103 }
00104 else
00105 {
00106
00107 p_vout->output.i_chroma = p_vout->render.i_chroma;
00108 p_vout->output.i_rmask = p_vout->render.i_rmask;
00109 p_vout->output.i_gmask = p_vout->render.i_gmask;
00110 p_vout->output.i_bmask = p_vout->render.i_bmask;
00111 p_vout->output.i_width = p_vout->render.i_width;
00112 p_vout->output.i_height = p_vout->render.i_height;
00113 p_vout->output.i_aspect = p_vout->render.i_aspect;
00114 }
00115
00116
00117 while( I_OUTPUTPICTURES < DUMMY_MAX_DIRECTBUFFERS )
00118 {
00119 p_pic = NULL;
00120
00121
00122 for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
00123 {
00124 if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
00125 {
00126 p_pic = p_vout->p_picture + i_index;
00127 break;
00128 }
00129 }
00130
00131
00132 if( p_pic == NULL )
00133 {
00134 break;
00135 }
00136
00137 vout_AllocatePicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
00138 p_vout->output.i_width, p_vout->output.i_height,
00139 p_vout->output.i_aspect );
00140
00141 if( p_pic->i_planes == 0 )
00142 {
00143 break;
00144 }
00145
00146 p_pic->i_status = DESTROYED_PICTURE;
00147 p_pic->i_type = DIRECT_PICTURE;
00148
00149 PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
00150
00151 I_OUTPUTPICTURES++;
00152 }
00153
00154 return( 0 );
00155 }
00156
00157
00158
00159
00160 static void End( vout_thread_t *p_vout )
00161 {
00162 int i_index;
00163
00164
00165 for( i_index = I_OUTPUTPICTURES ; i_index ; )
00166 {
00167 i_index--;
00168 free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
00169 }
00170 }
00171
00172
00173
00174
00175
00176
00177
00178 static int Manage( vout_thread_t *p_vout )
00179 {
00180 return( 0 );
00181 }
00182
00183
00184
00185
00186 static void Render( vout_thread_t *p_vout, picture_t *p_pic )
00187 {
00188
00189 }
00190
00191
00192
00193
00194 static void Display( vout_thread_t *p_vout, picture_t *p_pic )
00195 {
00196
00197 }
00198
00199
00200
00201
00202 static void SetPalette ( vout_thread_t *p_vout,
00203 uint16_t *red, uint16_t *green, uint16_t *blue )
00204 {
00205
00206 }