| 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 |
#ifdef HAVE_CONFIG_H |
|---|
| 30 |
# include "config.h" |
|---|
| 31 |
#endif |
|---|
| 32 |
|
|---|
| 33 |
#include <vlc_common.h> |
|---|
| 34 |
#include <vlc_vout.h> |
|---|
| 35 |
#include <vlc_osd.h> |
|---|
| 36 |
#include <vlc_filter.h> |
|---|
| 37 |
#include "vout_pictures.h" |
|---|
| 38 |
#include "vout_internal.h" |
|---|
| 39 |
|
|---|
| 40 |
#include <assert.h> |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic ) |
|---|
| 50 |
{ |
|---|
| 51 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 52 |
switch( p_pic->i_status ) |
|---|
| 53 |
{ |
|---|
| 54 |
case RESERVED_PICTURE: |
|---|
| 55 |
p_pic->i_status = RESERVED_DISP_PICTURE; |
|---|
| 56 |
break; |
|---|
| 57 |
case RESERVED_DATED_PICTURE: |
|---|
| 58 |
p_pic->i_status = READY_PICTURE; |
|---|
| 59 |
break; |
|---|
| 60 |
default: |
|---|
| 61 |
msg_Err( p_vout, "picture to display %p has invalid status %d", |
|---|
| 62 |
p_pic, p_pic->i_status ); |
|---|
| 63 |
break; |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 67 |
} |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
void vout_DatePicture( vout_thread_t *p_vout, |
|---|
| 80 |
picture_t *p_pic, mtime_t date ) |
|---|
| 81 |
{ |
|---|
| 82 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 83 |
p_pic->date = date; |
|---|
| 84 |
switch( p_pic->i_status ) |
|---|
| 85 |
{ |
|---|
| 86 |
case RESERVED_PICTURE: |
|---|
| 87 |
p_pic->i_status = RESERVED_DATED_PICTURE; |
|---|
| 88 |
break; |
|---|
| 89 |
case RESERVED_DISP_PICTURE: |
|---|
| 90 |
p_pic->i_status = READY_PICTURE; |
|---|
| 91 |
break; |
|---|
| 92 |
default: |
|---|
| 93 |
msg_Err( p_vout, "picture to date %p has invalid status %d", |
|---|
| 94 |
p_pic, p_pic->i_status ); |
|---|
| 95 |
break; |
|---|
| 96 |
} |
|---|
| 97 |
|
|---|
| 98 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 99 |
} |
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
int vout_CountPictureAvailable( vout_thread_t *p_vout ) |
|---|
| 111 |
{ |
|---|
| 112 |
int i_free = 0; |
|---|
| 113 |
int i_pic; |
|---|
| 114 |
|
|---|
| 115 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 116 |
for( i_pic = 0; i_pic < I_RENDERPICTURES; i_pic++ ) |
|---|
| 117 |
{ |
|---|
| 118 |
picture_t *p_pic = PP_RENDERPICTURE[(p_vout->render.i_last_used_pic + i_pic + 1) % I_RENDERPICTURES]; |
|---|
| 119 |
|
|---|
| 120 |
switch( p_pic->i_status ) |
|---|
| 121 |
{ |
|---|
| 122 |
case DESTROYED_PICTURE: |
|---|
| 123 |
i_free++; |
|---|
| 124 |
break; |
|---|
| 125 |
|
|---|
| 126 |
case FREE_PICTURE: |
|---|
| 127 |
i_free++; |
|---|
| 128 |
break; |
|---|
| 129 |
|
|---|
| 130 |
default: |
|---|
| 131 |
break; |
|---|
| 132 |
} |
|---|
| 133 |
} |
|---|
| 134 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 135 |
|
|---|
| 136 |
return i_free; |
|---|
| 137 |
} |
|---|
| 138 |
|
|---|
| 139 |
picture_t *vout_CreatePicture( vout_thread_t *p_vout, |
|---|
| 140 |
bool b_progressive, |
|---|
| 141 |
bool b_top_field_first, |
|---|
| 142 |
unsigned int i_nb_fields ) |
|---|
| 143 |
{ |
|---|
| 144 |
int i_pic; |
|---|
| 145 |
picture_t * p_pic; |
|---|
| 146 |
picture_t * p_freepic = NULL; |
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
for( i_pic = 0; i_pic < I_RENDERPICTURES; i_pic++ ) |
|---|
| 155 |
{ |
|---|
| 156 |
p_pic = PP_RENDERPICTURE[(p_vout->render.i_last_used_pic + i_pic + 1) |
|---|
| 157 |
% I_RENDERPICTURES]; |
|---|
| 158 |
|
|---|
| 159 |
switch( p_pic->i_status ) |
|---|
| 160 |
{ |
|---|
| 161 |
case DESTROYED_PICTURE: |
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
p_pic->i_status = RESERVED_PICTURE; |
|---|
| 166 |
p_pic->i_refcount = 0; |
|---|
| 167 |
p_pic->b_force = 0; |
|---|
| 168 |
|
|---|
| 169 |
p_pic->b_progressive = b_progressive; |
|---|
| 170 |
p_pic->i_nb_fields = i_nb_fields; |
|---|
| 171 |
p_pic->b_top_field_first = b_top_field_first; |
|---|
| 172 |
|
|---|
| 173 |
p_vout->i_heap_size++; |
|---|
| 174 |
p_vout->render.i_last_used_pic = |
|---|
| 175 |
( p_vout->render.i_last_used_pic + i_pic + 1 ) |
|---|
| 176 |
% I_RENDERPICTURES; |
|---|
| 177 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 178 |
return( p_pic ); |
|---|
| 179 |
|
|---|
| 180 |
case FREE_PICTURE: |
|---|
| 181 |
|
|---|
| 182 |
p_vout->render.i_last_used_pic = |
|---|
| 183 |
( p_vout->render.i_last_used_pic + i_pic + 1 ) |
|---|
| 184 |
% I_RENDERPICTURES; |
|---|
| 185 |
p_freepic = p_pic; |
|---|
| 186 |
break; |
|---|
| 187 |
|
|---|
| 188 |
default: |
|---|
| 189 |
break; |
|---|
| 190 |
} |
|---|
| 191 |
} |
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
if( p_freepic != NULL ) |
|---|
| 197 |
{ |
|---|
| 198 |
vout_AllocatePicture( VLC_OBJECT(p_vout), |
|---|
| 199 |
p_freepic, p_vout->render.i_chroma, |
|---|
| 200 |
p_vout->render.i_width, p_vout->render.i_height, |
|---|
| 201 |
p_vout->render.i_aspect ); |
|---|
| 202 |
|
|---|
| 203 |
if( p_freepic->i_planes ) |
|---|
| 204 |
{ |
|---|
| 205 |
|
|---|
| 206 |
p_freepic->i_status = RESERVED_PICTURE; |
|---|
| 207 |
p_freepic->i_type = MEMORY_PICTURE; |
|---|
| 208 |
p_freepic->b_slow = 0; |
|---|
| 209 |
|
|---|
| 210 |
p_freepic->i_refcount = 0; |
|---|
| 211 |
p_freepic->b_force = 0; |
|---|
| 212 |
|
|---|
| 213 |
p_freepic->b_progressive = b_progressive; |
|---|
| 214 |
p_freepic->i_nb_fields = i_nb_fields; |
|---|
| 215 |
p_freepic->b_top_field_first = b_top_field_first; |
|---|
| 216 |
|
|---|
| 217 |
p_freepic->i_matrix_coefficients = 1; |
|---|
| 218 |
|
|---|
| 219 |
p_vout->i_heap_size++; |
|---|
| 220 |
} |
|---|
| 221 |
else |
|---|
| 222 |
{ |
|---|
| 223 |
|
|---|
| 224 |
p_freepic->i_status = FREE_PICTURE; |
|---|
| 225 |
p_freepic = NULL; |
|---|
| 226 |
|
|---|
| 227 |
msg_Err( p_vout, "picture allocation failed" ); |
|---|
| 228 |
} |
|---|
| 229 |
|
|---|
| 230 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 231 |
|
|---|
| 232 |
return( p_freepic ); |
|---|
| 233 |
} |
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 238 |
|
|---|
| 239 |
return( NULL ); |
|---|
| 240 |
} |
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 |
|
|---|
| 249 |
void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic ) |
|---|
| 250 |
{ |
|---|
| 251 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 252 |
|
|---|
| 253 |
#ifndef NDEBUG |
|---|
| 254 |
|
|---|
| 255 |
if( (p_pic->i_status != RESERVED_PICTURE) && |
|---|
| 256 |
(p_pic->i_status != RESERVED_DATED_PICTURE) && |
|---|
| 257 |
(p_pic->i_status != RESERVED_DISP_PICTURE) ) |
|---|
| 258 |
{ |
|---|
| 259 |
msg_Err( p_vout, "picture to destroy %p has invalid status %d", |
|---|
| 260 |
p_pic, p_pic->i_status ); |
|---|
| 261 |
} |
|---|
| 262 |
#endif |
|---|
| 263 |
|
|---|
| 264 |
p_pic->i_status = DESTROYED_PICTURE; |
|---|
| 265 |
p_vout->i_heap_size--; |
|---|
| 266 |
picture_CleanupQuant( p_pic ); |
|---|
| 267 |
|
|---|
| 268 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 269 |
} |
|---|
| 270 |
|
|---|
| 271 |
|
|---|
| 272 |
|
|---|
| 273 |
|
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 |
|
|---|
| 277 |
void vout_LinkPicture( vout_thread_t *p_vout, picture_t *p_pic ) |
|---|
| 278 |
{ |
|---|
| 279 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 280 |
p_pic->i_refcount++; |
|---|
| 281 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 282 |
} |
|---|
| 283 |
|
|---|
| 284 |
|
|---|
| 285 |
|
|---|
| 286 |
|
|---|
| 287 |
|
|---|
| 288 |
|
|---|
| 289 |
void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic ) |
|---|
| 290 |
{ |
|---|
| 291 |
vlc_mutex_lock( &p_vout->picture_lock ); |
|---|
| 292 |
p_pic->i_refcount--; |
|---|
| 293 |
|
|---|
| 294 |
if( ( p_pic->i_refcount == 0 ) && |
|---|
| 295 |
( p_pic->i_status == DISPLAYED_PICTURE ) ) |
|---|
| 296 |
{ |
|---|
| 297 |
p_pic->i_status = DESTROYED_PICTURE; |
|---|
| 298 |
p_vout->i_heap_size--; |
|---|
| 299 |
picture_CleanupQuant( p_pic ); |
|---|
| 300 |
} |
|---|
| 301 |
|
|---|
| 302 |
vlc_mutex_unlock( &p_vout->picture_lock ); |
|---|
| 303 |
} |
|---|
| 304 |
|
|---|
| 305 |
static int vout_LockPicture( vout_thread_t *p_vout, picture_t *p_picture ) |
|---|
| 306 |
{ |
|---|
| 307 |
if( p_picture->pf_lock ) |
|---|
| 308 |
return p_picture->pf_lock( p_vout, p_picture ); |
|---|
| 309 |
return VLC_SUCCESS; |
|---|
| 310 |
} |
|---|
| 311 |
static void vout_UnlockPicture( vout_thread_t *p_vout, picture_t *p_picture ) |
|---|
| 312 |
{ |
|---|
| 313 |
if( p_picture->pf_unlock ) |
|---|
| 314 |
p_picture->pf_unlock( p_vout, p_picture ); |
|---|
| 315 |
} |
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 |
|
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, |
|---|
| 325 |
subpicture_t *p_subpic, bool b_paused ) |
|---|
| 326 |
{ |
|---|
| 327 |
if( p_pic == NULL ) |
|---|
| 328 |
return NULL; |
|---|
| 329 |
|
|---|
| 330 |
if( p_pic->i_type == DIRECT_PICTURE ) |
|---|
| 331 |
{ |
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 |
if( p_subpic != NULL ) |
|---|
| 335 |
{ |
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 |
if( vout_LockPicture( p_vout, PP_OUTPUTPICTURE[0] ) ) |
|---|
| 340 |
return NULL; |
|---|
| 341 |
|
|---|
| 342 |
picture_Copy( PP_OUTPUTPICTURE[0], p_pic ); |
|---|
| 343 |
|
|---|
| 344 |
spu_RenderSubpictures( p_vout->p_spu, |
|---|
| 345 |
PP_OUTPUTPICTURE[0], &p_vout->fmt_out, |
|---|
| 346 |
p_subpic, &p_vout->fmt_in, b_paused ); |
|---|
| 347 |
|
|---|
| 348 |
vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] ); |
|---|
| 349 |
|
|---|
| 350 |
return PP_OUTPUTPICTURE[0]; |
|---|
| 351 |
} |
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
return p_pic; |
|---|
| 357 |
} |
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
|
|---|
| 361 |
if( p_vout->p->b_direct ) |
|---|
| 362 |
{ |
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
|
|---|
| 367 |
if( vout_LockPicture( p_vout, PP_OUTPUTPICTURE[0] ) ) |
|---|
| 368 |
return NULL; |
|---|
| 369 |
|
|---|
| 370 |
picture_Copy( PP_OUTPUTPICTURE[0], p_pic ); |
|---|
| 371 |
spu_RenderSubpictures( p_vout->p_spu, |
|---|
| 372 |
PP_OUTPUTPICTURE[0], &p_vout->fmt_out, |
|---|
| 373 |
p_subpic, &p_vout->fmt_in, b_paused ); |
|---|
| 374 |
|
|---|
| 375 |
vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] ); |
|---|
| 376 |
|
|---|
| 377 |
return PP_OUTPUTPICTURE[0]; |
|---|
| 378 |
} |
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
if( p_subpic != NULL && p_vout->p_picture[0].b_slow ) |
|---|
| 386 |
{ |
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 |
picture_t *p_tmp_pic = &p_vout->p_picture[2 * VOUT_MAX_PICTURES]; |
|---|
| 391 |
if( p_tmp_pic->i_status == FREE_PICTURE ) |
|---|
| 392 |
{ |
|---|
| 393 |
vout_AllocatePicture( VLC_OBJECT(p_vout), |
|---|
| 394 |
p_tmp_pic, p_vout->fmt_out.i_chroma, |
|---|
| 395 |
p_vout->fmt_out.i_width, |
|---|
| 396 |
p_vout->fmt_out.i_height, |
|---|
| 397 |
p_vout->fmt_out.i_aspect ); |
|---|
| 398 |
p_tmp_pic->i_type = MEMORY_PICTURE; |
|---|
| 399 |
p_tmp_pic->i_status = RESERVED_PICTURE; |
|---|
| 400 |
|
|---|
| 401 |
p_tmp_pic->p_heap = &p_vout->output; |
|---|
| 402 |
} |
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 |
p_vout->p->p_chroma->p_owner = (filter_owner_sys_t *)p_tmp_pic; |
|---|
| 406 |
p_vout->p->p_chroma->pf_video_filter( p_vout->p->p_chroma, p_pic ); |
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
spu_RenderSubpictures( p_vout->p_spu, |
|---|
| 410 |
p_tmp_pic, &p_vout->fmt_out, |
|---|
| 411 |
p_subpic, &p_vout->fmt_in, b_paused ); |
|---|
| 412 |
|
|---|
| 413 |
if( vout_LockPicture( p_vout, &p_vout->p_picture[0] ) ) |
|---|
| 414 |
return NULL; |
|---|
| 415 |
|
|---|
| 416 |
picture_Copy( &p_vout->p_picture[0], p_tmp_pic ); |
|---|
| 417 |
} |
|---|
| 418 |
else |
|---|
| 419 |
{ |
|---|
| 420 |
if( vout_LockPicture( p_vout, &p_vout->p_picture[0] ) ) |
|---|
| 421 |
return NULL; |
|---|
| 422 |
|
|---|
| 423 |
|
|---|
| 424 |
p_vout->p->p_chroma->p_owner = (filter_owner_sys_t *)&p_vout->p_picture[0]; |
|---|
| 425 |
p_vout->p->p_chroma->pf_video_filter( p_vout->p->p_chroma, p_pic ); |
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 |
spu_RenderSubpictures( p_vout->p_spu, |
|---|
| 429 |
&p_vout->p_picture[0], &p_vout->fmt_out, |
|---|
| 430 |
p_subpic, &p_vout->fmt_in, b_paused ); |
|---|
| 431 |
} |
|---|
| 432 |
|
|---|
| 433 |
vout_UnlockPicture( p_vout, &p_vout->p_picture[0] ); |
|---|
| 434 |
|
|---|
| 435 |
return &p_vout->p_picture[0]; |
|---|
| 436 |
} |
|---|
| 437 |
|
|---|
| 438 |
|
|---|
| 439 |
|
|---|
| 440 |
|
|---|
| 441 |
|
|---|
| 442 |
|
|---|
| 443 |
|
|---|
| 444 |
void vout_PlacePicture( vout_thread_t *p_vout, |
|---|
| 445 |
unsigned int i_width, unsigned int i_height, |
|---|
| 446 |
unsigned int *pi_x, unsigned int *pi_y, |
|---|
| 447 |
unsigned int *pi_width, unsigned int *pi_height ) |
|---|
| 448 |
{ |
|---|
| 449 |
if( (i_width <= 0) || (i_height <=0) ) |
|---|
| 450 |
{ |
|---|
| 451 |
*pi_width = *pi_height = *pi_x = *pi_y = 0; |
|---|
| 452 |
return; |
|---|
| 453 |
} |
|---|
| 454 |
|
|---|
| 455 |
if( p_vout->b_scale ) |
|---|
| 456 |
{ |
|---|
| 457 |
*pi_width = i_width; |
|---|
| 458 |
*pi_height = i_height; |
|---|
| 459 |
} |
|---|
| 460 |
else |
|---|
| 461 |
{ |
|---|
| 462 |
*pi_width = __MIN( i_width, p_vout->fmt_in.i_visible_width ); |
|---|
| 463 |
*pi_height = __MIN( i_height, p_vout->fmt_in.i_visible_height ); |
|---|
| 464 |
} |
|---|
| 465 |
|
|---|
| 466 |
int64_t i_scaled_width = p_vout->fmt_in.i_visible_width * (int64_t)p_vout->fmt_in.i_sar_num * |
|---|
| 467 |
*pi_height / p_vout->fmt_in.i_visible_height / p_vout->fmt_in.i_sar_den; |
|---|
| 468 |
int64_t i_scaled_height = p_vout->fmt_in.i_visible_height * (int64_t)p_vout->fmt_in.i_sar_den * |
|---|
| 469 |
*pi_width / p_vout->fmt_in.i_visible_width / p_vout->fmt_in.i_sar_num; |
|---|
| 470 |
|
|---|
| 471 |
if( i_scaled_width <= 0 || i_scaled_height <= 0 ) |
|---|
| 472 |
{ |
|---|
| 473 |
msg_Warn( p_vout, "ignoring broken aspect ratio" ); |
|---|
| 474 |
i_scaled_width = *pi_width; |
|---|
| 475 |
i_scaled_height = *pi_height; |
|---|
| 476 |
} |
|---|
| 477 |
|
|---|
| 478 |
if( i_scaled_width > *pi_width ) |
|---|
| 479 |
*pi_height = i_scaled_height; |
|---|
| 480 |
else |
|---|
| 481 |
*pi_width = i_scaled_width; |
|---|
| 482 |
|
|---|
| 483 |
switch( p_vout->i_alignment & VOUT_ALIGN_HMASK ) |
|---|
| 484 |
{ |
|---|
| 485 |
case VOUT_ALIGN_LEFT: |
|---|
| 486 |
*pi_x = 0; |
|---|
| 487 |
break; |
|---|
| 488 |
case VOUT_ALIGN_RIGHT: |
|---|
| 489 |
*pi_x = i_width - *pi_width; |
|---|
| 490 |
break; |
|---|
| 491 |
default: |
|---|
| 492 |
*pi_x = ( i_width - *pi_width ) / 2; |
|---|
| 493 |
} |
|---|
| 494 |
|
|---|
| 495 |
switch( p_vout->i_alignment & VOUT_ALIGN_VMASK ) |
|---|
| 496 |
{ |
|---|
| 497 |
case VOUT_ALIGN_TOP: |
|---|
| 498 |
*pi_y = 0; |
|---|
| 499 |
break; |
|---|
| 500 |
case VOUT_ALIGN_BOTTOM: |
|---|
| 501 |
*pi_y = i_height - *pi_height; |
|---|
| 502 |
break; |
|---|
| 503 |
default: |
|---|
| 504 |
*pi_y = ( i_height - *pi_height ) / 2; |
|---|
| 505 |
} |
|---|
| 506 |
} |
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 |
|
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic, |
|---|
| 516 |
vlc_fourcc_t i_chroma, |
|---|
| 517 |
int i_width, int i_height, int i_aspect ) |
|---|
| 518 |
{ |
|---|
| 519 |
int i_bytes, i_index, i_width_aligned, i_height_aligned; |
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
i_width_aligned = (i_width + 15) >> 4 << 4; |
|---|
| 523 |
i_height_aligned = (i_height + 15) >> 4 << 4; |
|---|
| 524 |
|
|---|
| 525 |
if( vout_InitPicture( p_this, p_pic, i_chroma, |
|---|
| 526 |
i_width, i_height, i_aspect ) != VLC_SUCCESS ) |
|---|
| 527 |
{ |
|---|
| 528 |
p_pic->i_planes = 0; |
|---|
| 529 |
return VLC_EGENERIC; |
|---|
| 530 |
} |
|---|
| 531 |
|
|---|
| 532 |
|
|---|
| 533 |
i_bytes = p_pic->format.i_bits_per_pixel * |
|---|
| 534 |
i_width_aligned * i_height_aligned / 8; |
|---|
| 535 |
|
|---|
| 536 |
p_pic->p_data = vlc_memalign( &p_pic->p_data_orig, 16, i_bytes ); |
|---|
| 537 |
|
|---|
| 538 |
if( p_pic->p_data == NULL ) |
|---|
| 539 |
{ |
|---|
| 540 |
p_pic->i_planes = 0; |
|---|
| 541 |
return VLC_EGENERIC; |
|---|
| 542 |
} |
|---|
| 543 |
|
|---|
| 544 |
|
|---|
| 545 |
p_pic->p[ 0 ].p_pixels = p_pic->p_data; |
|---|
| 546 |
|
|---|
| 547 |
for( i_index = 1; i_index < p_pic->i_planes; i_index++ ) |
|---|
| 548 |
{ |
|---|
| 549 |
p_pic->p[i_index].p_pixels = p_pic->p[i_index-1].p_pixels + |
|---|
| 550 |
p_pic->p[i_index-1].i_lines * p_pic->p[i_index-1].i_pitch; |
|---|
| 551 |
} |
|---|
| 552 |
|
|---|
| 553 |
return VLC_SUCCESS; |
|---|
| 554 |
} |
|---|
| 555 |
|
|---|
| 556 |
|
|---|
| 557 |
|
|---|
| 558 |
|
|---|
| 559 |
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 |
|
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma, |
|---|
| 568 |
int i_width, int i_height, int i_aspect ) |
|---|
| 569 |
{ |
|---|
| 570 |
p_format->i_chroma = i_chroma; |
|---|
| 571 |
p_format->i_width = p_format->i_visible_width = i_width; |
|---|
| 572 |
p_format->i_height = p_format->i_visible_height = i_height; |
|---|
| 573 |
p_format->i_x_offset = p_format->i_y_offset = 0; |
|---|
| 574 |
p_format->i_aspect = i_aspect; |
|---|
| 575 |
|
|---|
| 576 |
#if 0 |
|---|
| 577 |
|
|---|
| 578 |
if( i_width && i_height ) |
|---|
| 579 |
p_format->i_aspect = i_width * VOUT_ASPECT_FACTOR / i_height; |
|---|
| 580 |
else |
|---|
| 581 |
p_format->i_aspect = 0; |
|---|
| 582 |
#endif |
|---|
| 583 |
|
|---|
| 584 |
switch( i_chroma ) |
|---|
| 585 |
{ |
|---|
| 586 |
case FOURCC_YUVA: |
|---|
| 587 |
p_format->i_bits_per_pixel = 32; |
|---|
| 588 |
break; |
|---|
| 589 |
case FOURCC_I444: |
|---|
| 590 |
case FOURCC_J444: |
|---|
| 591 |
p_format->i_bits_per_pixel = 24; |
|---|
| 592 |
break; |
|---|
| 593 |
case FOURCC_I422: |
|---|
| 594 |
case FOURCC_YUY2: |
|---|
| 595 |
case FOURCC_UYVY: |
|---|
| 596 |
case FOURCC_J422: |
|---|
| 597 |
p_format->i_bits_per_pixel = 16; |
|---|
| 598 |
break; |
|---|
| 599 |
case FOURCC_I440: |
|---|
| 600 |
case FOURCC_J440: |
|---|
| 601 |
p_format->i_bits_per_pixel = 16; |
|---|
| 602 |
break; |
|---|
| 603 |
case FOURCC_I411: |
|---|
| 604 |
case FOURCC_YV12: |
|---|
| 605 |
case FOURCC_I420: |
|---|
| 606 |
case FOURCC_J420: |
|---|
| 607 |
case FOURCC_IYUV: |
|---|
| 608 |
p_format->i_bits_per_pixel = 12; |
|---|
| 609 |
break; |
|---|
| 610 |
case FOURCC_I410: |
|---|
| 611 |
case FOURCC_YVU9: |
|---|
| 612 |
p_format->i_bits_per_pixel = 9; |
|---|
| 613 |
break; |
|---|
| 614 |
case FOURCC_Y211: |
|---|
| 615 |
p_format->i_bits_per_pixel = 8; |
|---|
| 616 |
break; |
|---|
| 617 |
case FOURCC_YUVP: |
|---|
| 618 |
p_format->i_bits_per_pixel = 8; |
|---|
| 619 |
break; |
|---|
| 620 |
|
|---|
| 621 |
case FOURCC_RV32: |
|---|
| 622 |
case FOURCC_RGBA: |
|---|
| 623 |
p_format->i_bits_per_pixel = 32; |
|---|
| 624 |
break; |
|---|
| 625 |
case FOURCC_RV24: |
|---|
| 626 |
p_format->i_bits_per_pixel = 24; |
|---|
| 627 |
break; |
|---|
| 628 |
case FOURCC_RV15: |
|---|
| 629 |
case FOURCC_RV16: |
|---|
| 630 |
p_format->i_bits_per_pixel = 16; |
|---|
| 631 |
break; |
|---|
| 632 |
case FOURCC_RGB2: |
|---|
| 633 |
p_format->i_bits_per_pixel = 8; |
|---|
| 634 |
break; |
|---|
| 635 |
|
|---|
| 636 |
case FOURCC_GREY: |
|---|
| 637 |
case FOURCC_Y800: |
|---|
| 638 |
case FOURCC_Y8: |
|---|
| 639 |
case FOURCC_RGBP: |
|---|
| 640 |
p_format->i_bits_per_pixel = 8; |
|---|
| 641 |
break; |
|---|
| 642 |
|
|---|
| 643 |
default: |
|---|
| 644 |
p_format->i_bits_per_pixel = 0; |
|---|
| 645 |
break; |
|---|
| 646 |
} |
|---|
| 647 |
} |
|---|
| 648 |
|
|---|
| 649 |
|
|---|
| 650 |
|
|---|
| 651 |
|
|---|
| 652 |
|
|---|
| 653 |
|
|---|
| 654 |
|
|---|
| 655 |
|
|---|
| 656 |
|
|---|
| 657 |
|
|---|
| 658 |
|
|---|
| 659 |
|
|---|
| 660 |
|
|---|
| 661 |
int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, |
|---|
| 662 |
vlc_fourcc_t i_chroma, |
|---|
| 663 |
int i_width, int i_height, int i_aspect ) |
|---|
| 664 |
{ |
|---|
| 665 |
int i_index, i_width_aligned, i_height_aligned; |
|---|
| 666 |
|
|---|
| 667 |
|
|---|
| 668 |
for( i_index = 0; i_index < VOUT_MAX_PLANES; i_index++ ) |
|---|
| 669 |
{ |
|---|
| 670 |
p_pic->p[i_index].p_pixels = NULL; |
|---|
| 671 |
p_pic->p[i_index].i_pixel_pitch = 1; |
|---|
| 672 |
} |
|---|
| 673 |
|
|---|
| 674 |
p_pic->pf_release = NULL; |
|---|
| 675 |
p_pic->pf_lock = NULL; |
|---|
| 676 |
p_pic->pf_unlock = NULL; |
|---|
| 677 |
p_pic->i_refcount = 0; |
|---|
| 678 |
|
|---|
| 679 |
p_pic->p_q = NULL; |
|---|
| 680 |
p_pic->i_qstride = 0; |
|---|
| 681 |
p_pic->i_qtype = 0; |
|---|
| 682 |
|
|---|
| 683 |
vout_InitFormat( &p_pic->format, i_chroma, i_width, i_height, i_aspect ); |
|---|
| 684 |
|
|---|
| 685 |
|
|---|
| 686 |
i_width_aligned = (i_width + 15) >> 4 << 4; |
|---|
| 687 |
i_height_aligned = (i_height + 15) >> 4 << 4; |
|---|
| 688 |
|
|---|
| 689 |
|
|---|
| 690 |
switch( i_chroma ) |
|---|
| 691 |
{ |
|---|
| 692 |
case FOURCC_I411: |
|---|
| 693 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 694 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 695 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 696 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 697 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned; |
|---|
| 698 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height; |
|---|
| 699 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 4; |
|---|
| 700 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 4; |
|---|
| 701 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned; |
|---|
| 702 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height; |
|---|
| 703 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 4; |
|---|
| 704 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 4; |
|---|
| 705 |
p_pic->i_planes = 3; |
|---|
| 706 |
break; |
|---|
| 707 |
|
|---|
| 708 |
case FOURCC_I410: |
|---|
| 709 |
case FOURCC_YVU9: |
|---|
| 710 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 711 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 712 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 713 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 714 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 4; |
|---|
| 715 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height / 4; |
|---|
| 716 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 4; |
|---|
| 717 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 4; |
|---|
| 718 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 4; |
|---|
| 719 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height / 4; |
|---|
| 720 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 4; |
|---|
| 721 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 4; |
|---|
| 722 |
p_pic->i_planes = 3; |
|---|
| 723 |
break; |
|---|
| 724 |
|
|---|
| 725 |
case FOURCC_YV12: |
|---|
| 726 |
case FOURCC_I420: |
|---|
| 727 |
case FOURCC_IYUV: |
|---|
| 728 |
case FOURCC_J420: |
|---|
| 729 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 730 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 731 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 732 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 733 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 2; |
|---|
| 734 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height / 2; |
|---|
| 735 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 2; |
|---|
| 736 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 2; |
|---|
| 737 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 2; |
|---|
| 738 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height / 2; |
|---|
| 739 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 2; |
|---|
| 740 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 2; |
|---|
| 741 |
p_pic->i_planes = 3; |
|---|
| 742 |
break; |
|---|
| 743 |
|
|---|
| 744 |
case FOURCC_I422: |
|---|
| 745 |
case FOURCC_J422: |
|---|
| 746 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 747 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 748 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 749 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 750 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned; |
|---|
| 751 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height; |
|---|
| 752 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 2; |
|---|
| 753 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 2; |
|---|
| 754 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned; |
|---|
| 755 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height; |
|---|
| 756 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 2; |
|---|
| 757 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 2; |
|---|
| 758 |
p_pic->i_planes = 3; |
|---|
| 759 |
break; |
|---|
| 760 |
|
|---|
| 761 |
case FOURCC_I440: |
|---|
| 762 |
case FOURCC_J440: |
|---|
| 763 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 764 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 765 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 766 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 767 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 2; |
|---|
| 768 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height / 2; |
|---|
| 769 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned; |
|---|
| 770 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width; |
|---|
| 771 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 2; |
|---|
| 772 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height / 2; |
|---|
| 773 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned; |
|---|
| 774 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width; |
|---|
| 775 |
p_pic->i_planes = 3; |
|---|
| 776 |
break; |
|---|
| 777 |
|
|---|
| 778 |
case FOURCC_I444: |
|---|
| 779 |
case FOURCC_J444: |
|---|
| 780 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 781 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 782 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 783 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 784 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned; |
|---|
| 785 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height; |
|---|
| 786 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned; |
|---|
| 787 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width; |
|---|
| 788 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned; |
|---|
| 789 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height; |
|---|
| 790 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned; |
|---|
| 791 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width; |
|---|
| 792 |
p_pic->i_planes = 3; |
|---|
| 793 |
break; |
|---|
| 794 |
|
|---|
| 795 |
case FOURCC_YUVA: |
|---|
| 796 |
p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; |
|---|
| 797 |
p_pic->p[ Y_PLANE ].i_visible_lines = i_height; |
|---|
| 798 |
p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; |
|---|
| 799 |
p_pic->p[ Y_PLANE ].i_visible_pitch = i_width; |
|---|
| 800 |
p_pic->p[ U_PLANE ].i_lines = i_height_aligned; |
|---|
| 801 |
p_pic->p[ U_PLANE ].i_visible_lines = i_height; |
|---|
| 802 |
p_pic->p[ U_PLANE ].i_pitch = i_width_aligned; |
|---|
| 803 |
p_pic->p[ U_PLANE ].i_visible_pitch = i_width; |
|---|
| 804 |
p_pic->p[ V_PLANE ].i_lines = i_height_aligned; |
|---|
| 805 |
p_pic->p[ V_PLANE ].i_visible_lines = i_height; |
|---|
| 806 |
p_pic->p[ V_PLANE ].i_pitch = i_width_aligned; |
|---|
| 807 |
p_pic->p[ V_PLANE ].i_visible_pitch = i_width; |
|---|
| 808 |
p_pic->p[ A_PLANE ].i_lines = i_height_aligned; |
|---|
| 809 |
p_pic->p[ A_PLANE ].i_visible_lines = i_height; |
|---|
| 810 |
p_pic->p[ A_PLANE ].i_pitch = i_width_aligned; |
|---|
| 811 |
p_pic->p[ A_PLANE ].i_visible_pitch = i_width; |
|---|
| 812 |
p_pic->i_planes = 4; |
|---|
| 813 |
break; |
|---|
| 814 |
|
|---|
| 815 |
case FOURCC_YUVP: |
|---|
| 816 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 817 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 818 |
p_pic->p->i_pitch = i_width_aligned; |
|---|
| 819 |
p_pic->p->i_visible_pitch = i_width; |
|---|
| 820 |
p_pic->p->i_pixel_pitch = 8; |
|---|
| 821 |
p_pic->i_planes = 1; |
|---|
| 822 |
break; |
|---|
| 823 |
|
|---|
| 824 |
case FOURCC_Y211: |
|---|
| 825 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 826 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 827 |
p_pic->p->i_pitch = i_width_aligned; |
|---|
| 828 |
p_pic->p->i_visible_pitch = i_width; |
|---|
| 829 |
p_pic->p->i_pixel_pitch = 4; |
|---|
| 830 |
p_pic->i_planes = 1; |
|---|
| 831 |
break; |
|---|
| 832 |
|
|---|
| 833 |
case FOURCC_UYVY: |
|---|
| 834 |
case FOURCC_YUY2: |
|---|
| 835 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 836 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 837 |
p_pic->p->i_pitch = i_width_aligned * 2; |
|---|
| 838 |
p_pic->p->i_visible_pitch = i_width * 2; |
|---|
| 839 |
p_pic->p->i_pixel_pitch = 4; |
|---|
| 840 |
p_pic->i_planes = 1; |
|---|
| 841 |
break; |
|---|
| 842 |
|
|---|
| 843 |
case FOURCC_RGB2: |
|---|
| 844 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 845 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 846 |
p_pic->p->i_pitch = i_width_aligned; |
|---|
| 847 |
p_pic->p->i_visible_pitch = i_width; |
|---|
| 848 |
p_pic->p->i_pixel_pitch = 1; |
|---|
| 849 |
p_pic->i_planes = 1; |
|---|
| 850 |
break; |
|---|
| 851 |
|
|---|
| 852 |
case FOURCC_RV15: |
|---|
| 853 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 854 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 855 |
p_pic->p->i_pitch = i_width_aligned * 2; |
|---|
| 856 |
p_pic->p->i_visible_pitch = i_width * 2; |
|---|
| 857 |
p_pic->p->i_pixel_pitch = 2; |
|---|
| 858 |
p_pic->i_planes = 1; |
|---|
| 859 |
break; |
|---|
| 860 |
|
|---|
| 861 |
case FOURCC_RV16: |
|---|
| 862 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 863 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 864 |
p_pic->p->i_pitch = i_width_aligned * 2; |
|---|
| 865 |
p_pic->p->i_visible_pitch = i_width * 2; |
|---|
| 866 |
p_pic->p->i_pixel_pitch = 2; |
|---|
| 867 |
p_pic->i_planes = 1; |
|---|
| 868 |
break; |
|---|
| 869 |
|
|---|
| 870 |
case FOURCC_RV24: |
|---|
| 871 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 872 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 873 |
p_pic->p->i_pitch = i_width_aligned * 3; |
|---|
| 874 |
p_pic->p->i_visible_pitch = i_width * 3; |
|---|
| 875 |
p_pic->p->i_pixel_pitch = 3; |
|---|
| 876 |
p_pic->i_planes = 1; |
|---|
| 877 |
break; |
|---|
| 878 |
|
|---|
| 879 |
case FOURCC_RV32: |
|---|
| 880 |
case FOURCC_RGBA: |
|---|
| 881 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 882 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 883 |
p_pic->p->i_pitch = i_width_aligned * 4; |
|---|
| 884 |
p_pic->p->i_visible_pitch = i_width * 4; |
|---|
| 885 |
p_pic->p->i_pixel_pitch = 4; |
|---|
| 886 |
p_pic->i_planes = 1; |
|---|
| 887 |
break; |
|---|
| 888 |
|
|---|
| 889 |
case FOURCC_GREY: |
|---|
| 890 |
case FOURCC_Y800: |
|---|
| 891 |
case FOURCC_Y8: |
|---|
| 892 |
case FOURCC_RGBP: |
|---|
| 893 |
p_pic->p->i_lines = i_height_aligned; |
|---|
| 894 |
p_pic->p->i_visible_lines = i_height; |
|---|
| 895 |
p_pic->p->i_pitch = i_width_aligned; |
|---|
| 896 |
p_pic->p->i_visible_pitch = i_width; |
|---|
| 897 |
p_pic->p->i_pixel_pitch = 1; |
|---|
| 898 |
p_pic->i_planes = 1; |
|---|
| 899 |
break; |
|---|
| 900 |
|
|---|
| 901 |
default: |
|---|
| 902 |
if( p_this ) |
|---|
| 903 |
msg_Err( p_this, "unknown chroma type 0x%.8x (%4.4s)", |
|---|
| 904 |
i_chroma, (char*)&i_chroma ); |
|---|
|
|---|