summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-11 02:54:50 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-11 02:54:50 +0000
commit7fdf3210dfb7d7ee7e40b7716a07edf7d07d0cd9 (patch)
tree8128d331ea80ce80f079b41e6f7a88d6cd3d31a2 /libmpdemux
parentcdf72d75d2a3b4c90f180bc90d1e8db6afadacad (diff)
downloadmpv-7fdf3210dfb7d7ee7e40b7716a07edf7d07d0cd9.tar.bz2
mpv-7fdf3210dfb7d7ee7e40b7716a07edf7d07d0cd9.tar.xz
added support for -tv outfmt
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2818 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/tv.c23
-rw-r--r--libmpdemux/tv.h2
2 files changed, 22 insertions, 3 deletions
diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c
index 1b7a87c9fe..1a3ac2a2d1 100644
--- a/libmpdemux/tv.c
+++ b/libmpdemux/tv.c
@@ -31,6 +31,7 @@ char *tv_param_driver = "dummy";
int tv_param_width = -1;
int tv_param_height = -1;
int tv_param_input = 0; /* used in v4l and bttv */
+char *tv_param_outfmt = "yv12";
/* ================== DEMUX_TV ===================== */
@@ -95,8 +96,24 @@ int demux_open_tv(demuxer_t *demuxer, tvi_handle_t *tvh)
sh_video = new_sh_video(demuxer, 0);
- /* hack to use YUV 4:2:0 format ;) */
- sh_video->format = IMGFMT_UYVY;
+ if (!strcasecmp(tv_param_outfmt, "yv12"))
+ sh_video->format = IMGFMT_YV12;
+ else if (!strcasecmp(tv_param_outfmt, "uyvy"))
+ sh_video->format = IMGFMT_UYVY;
+ else if (!strcasecmp(tv_param_outfmt, "rgb32"))
+ sh_video->format = IMGFMT_RGB32;
+ else if (!strcasecmp(tv_param_outfmt, "rgb24"))
+ sh_video->format = IMGFMT_RGB24;
+ else if (!strcasecmp(tv_param_outfmt, "rgb16"))
+ sh_video->format = IMGFMT_RGB16;
+ else if (!strcasecmp(tv_param_outfmt, "rgb15"))
+ sh_video->format = IMGFMT_RGB15;
+ else
+ {
+ printf("Unknown format given: %s\n", tv_param_outfmt);
+ printf("Using default: Planar YV12\n");
+ sh_video->format = IMGFMT_YV12;
+ }
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &sh_video->format);
/* get IMGFMT_ */
@@ -185,7 +202,7 @@ int demux_open_tv(demuxer_t *demuxer, tvi_handle_t *tvh)
case AFMT_MPEG:
case AFMT_AC3:
default:
- printf("%s unsupported!\n", audio_out_format_name(audio_format));
+// printf("%s unsupported!\n", audio_out_format_name(audio_format));
goto no_audio;
}
diff --git a/libmpdemux/tv.h b/libmpdemux/tv.h
index 0241eddb03..0d1eb22efb 100644
--- a/libmpdemux/tv.h
+++ b/libmpdemux/tv.h
@@ -3,6 +3,7 @@
#ifdef USE_TV
#include "../libao2/afmt.h"
#include "../libvo/img_format.h"
+#include "../libvo/fastmemcpy.h"
extern unsigned long tv_param_freq;
extern char *tv_param_channel;
@@ -13,6 +14,7 @@ extern char *tv_param_driver;
extern int tv_param_width;
extern int tv_param_height;
extern int tv_param_input;
+extern char *tv_param_outfmt;
typedef struct tvi_info_s
{