comparison libmpdemux/tvi_v4l.c @ 3220:b35b40ade7e9

update
author alex
date Fri, 30 Nov 2001 16:59:02 +0000
parents 4307478ad922
children 3bd16d4a94e2
comparison
equal deleted inserted replaced
3219:2998f74ad64e 3220:b35b40ade7e9
86 86
87 static int palette2depth(int palette) 87 static int palette2depth(int palette)
88 { 88 {
89 switch(palette) 89 switch(palette)
90 { 90 {
91 /* component */
91 case VIDEO_PALETTE_RGB555: 92 case VIDEO_PALETTE_RGB555:
92 return(15); 93 return(15);
93 case VIDEO_PALETTE_RGB565: 94 case VIDEO_PALETTE_RGB565:
94 return(16); 95 return(16);
95 case VIDEO_PALETTE_RGB24: 96 case VIDEO_PALETTE_RGB24:
96 return(24); 97 return(24);
97 case VIDEO_PALETTE_RGB32: 98 case VIDEO_PALETTE_RGB32:
98 return(32); 99 return(32);
100 /* planar */
101 case VIDEO_PALETTE_YUV422P:
102 case VIDEO_PALETTE_YUV411P:
99 case VIDEO_PALETTE_YUV420P: 103 case VIDEO_PALETTE_YUV420P:
104 case VIDEO_PALETTE_YUV410P:
100 return(12); 105 return(12);
106 /* packed */
101 case VIDEO_PALETTE_YUV422: 107 case VIDEO_PALETTE_YUV422:
108 case VIDEO_PALETTE_YUYV:
102 case VIDEO_PALETTE_UYVY: 109 case VIDEO_PALETTE_UYVY:
110 case VIDEO_PALETTE_YUV420:
111 case VIDEO_PALETTE_YUV411:
103 return(16); 112 return(16);
104 } 113 }
105 return(-1); 114 return(-1);
106 } 115 }
107 116
477 /* ========== VIDEO controls =========== */ 486 /* ========== VIDEO controls =========== */
478 case TVI_CONTROL_VID_GET_FORMAT: 487 case TVI_CONTROL_VID_GET_FORMAT:
479 { 488 {
480 int output_fmt = -1; 489 int output_fmt = -1;
481 490
482 #if 0
483 switch(priv->palette)
484 {
485 case VIDEO_PALETTE_RGB555:
486 output_fmt = IMGFMT_RGB15;
487 break;
488 case VIDEO_PALETTE_RGB565:
489 output_fmt = IMGFMT_RGB16;
490 break;
491 case VIDEO_PALETTE_RGB24:
492 output_fmt = IMGFMT_RGB24;
493 break;
494 case VIDEO_PALETTE_RGB32:
495 output_fmt = IMGFMT_RGB32;
496 break;
497 case VIDEO_PALETTE_UYVY:
498 output_fmt = IMGFMT_UYVY;
499 break;
500 case VIDEO_PALETTE_YUV420P:
501 output_fmt = IMGFMT_YV12;
502 break;
503 default:
504 mp_msg(MSGT_TV, MSGL_ERR, "no suitable output format found (%s)\n",
505 PALETTE(priv->palette));
506 return(TVI_CONTROL_FALSE);
507 }
508 #endif
509 output_fmt = priv->format; 491 output_fmt = priv->format;
510 (int)*(void **)arg = output_fmt; 492 (int)*(void **)arg = output_fmt;
511 mp_msg(MSGT_TV, MSGL_INFO, "Output format: %s\n", vo_format_name(output_fmt)); 493 mp_msg(MSGT_TV, MSGL_INFO, "Output format: %s\n", vo_format_name(output_fmt));
512 return(TVI_CONTROL_TRUE); 494 return(TVI_CONTROL_TRUE);
513 } 495 }
514 case TVI_CONTROL_VID_SET_FORMAT: 496 case TVI_CONTROL_VID_SET_FORMAT:
515 priv->format = (int)*(void **)arg; 497 priv->format = (int)*(void **)arg;
516 return(TVI_CONTROL_TRUE); 498 return(TVI_CONTROL_TRUE);
517 case TVI_CONTROL_VID_GET_PLANES: 499 case TVI_CONTROL_VID_GET_PLANES:
518 (int)*(void **)arg = 1; 500 (int)*(void **)arg = 1; /* FIXME, also not needed at this time */
519 return(TVI_CONTROL_TRUE); 501 return(TVI_CONTROL_TRUE);
520 case TVI_CONTROL_VID_GET_BITS: 502 case TVI_CONTROL_VID_GET_BITS:
521 (int)*(void **)arg = palette2depth(format2palette(priv->format)); 503 (int)*(void **)arg = palette2depth(format2palette(priv->format));
522 return(TVI_CONTROL_TRUE); 504 return(TVI_CONTROL_TRUE);
523 case TVI_CONTROL_VID_GET_WIDTH: 505 case TVI_CONTROL_VID_GET_WIDTH: