Mercurial > mplayer.hg
comparison libmpdemux/tv.c @ 2817:cc93d9786954
added support for -tv outfmt
author | alex |
---|---|
date | Sun, 11 Nov 2001 02:54:50 +0000 |
parents | d6d88771f5ef |
children | 9f68d309f8cb |
comparison
equal
deleted
inserted
replaced
2816:190e713d8e07 | 2817:cc93d9786954 |
---|---|
29 char *tv_param_device = NULL; | 29 char *tv_param_device = NULL; |
30 char *tv_param_driver = "dummy"; | 30 char *tv_param_driver = "dummy"; |
31 int tv_param_width = -1; | 31 int tv_param_width = -1; |
32 int tv_param_height = -1; | 32 int tv_param_height = -1; |
33 int tv_param_input = 0; /* used in v4l and bttv */ | 33 int tv_param_input = 0; /* used in v4l and bttv */ |
34 char *tv_param_outfmt = "yv12"; | |
34 | 35 |
35 | 36 |
36 /* ================== DEMUX_TV ===================== */ | 37 /* ================== DEMUX_TV ===================== */ |
37 /* | 38 /* |
38 Return value: | 39 Return value: |
93 return; | 94 return; |
94 } | 95 } |
95 | 96 |
96 sh_video = new_sh_video(demuxer, 0); | 97 sh_video = new_sh_video(demuxer, 0); |
97 | 98 |
98 /* hack to use YUV 4:2:0 format ;) */ | 99 if (!strcasecmp(tv_param_outfmt, "yv12")) |
99 sh_video->format = IMGFMT_UYVY; | 100 sh_video->format = IMGFMT_YV12; |
101 else if (!strcasecmp(tv_param_outfmt, "uyvy")) | |
102 sh_video->format = IMGFMT_UYVY; | |
103 else if (!strcasecmp(tv_param_outfmt, "rgb32")) | |
104 sh_video->format = IMGFMT_RGB32; | |
105 else if (!strcasecmp(tv_param_outfmt, "rgb24")) | |
106 sh_video->format = IMGFMT_RGB24; | |
107 else if (!strcasecmp(tv_param_outfmt, "rgb16")) | |
108 sh_video->format = IMGFMT_RGB16; | |
109 else if (!strcasecmp(tv_param_outfmt, "rgb15")) | |
110 sh_video->format = IMGFMT_RGB15; | |
111 else | |
112 { | |
113 printf("Unknown format given: %s\n", tv_param_outfmt); | |
114 printf("Using default: Planar YV12\n"); | |
115 sh_video->format = IMGFMT_YV12; | |
116 } | |
100 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &sh_video->format); | 117 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &sh_video->format); |
101 | 118 |
102 /* get IMGFMT_ */ | 119 /* get IMGFMT_ */ |
103 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FORMAT, &sh_video->format); | 120 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FORMAT, &sh_video->format); |
104 // if (IMGFMT_IS_RGB(sh_video->format) || IMGFMT_IS_BGR(sh_video->format)) | 121 // if (IMGFMT_IS_RGB(sh_video->format) || IMGFMT_IS_BGR(sh_video->format)) |
183 case AFMT_MU_LAW: | 200 case AFMT_MU_LAW: |
184 case AFMT_A_LAW: | 201 case AFMT_A_LAW: |
185 case AFMT_MPEG: | 202 case AFMT_MPEG: |
186 case AFMT_AC3: | 203 case AFMT_AC3: |
187 default: | 204 default: |
188 printf("%s unsupported!\n", audio_out_format_name(audio_format)); | 205 // printf("%s unsupported!\n", audio_out_format_name(audio_format)); |
189 goto no_audio; | 206 goto no_audio; |
190 } | 207 } |
191 | 208 |
192 funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_CHANNELS, &sh_audio->wf->nChannels); | 209 funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_CHANNELS, &sh_audio->wf->nChannels); |
193 funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLERATE, &sh_audio->wf->nSamplesPerSec); | 210 funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLERATE, &sh_audio->wf->nSamplesPerSec); |