summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-15 18:19:39 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-15 18:19:39 +0000
commitd81b02cce8d5e3b1d3cf2091f93376eca9e921a4 (patch)
tree5e2e3c33ef95bd4f8a2d8e080f6267b37075db18 /libvo
parent4a9692c2fdae17bdda25c4cc6b2022c35e1cd941 (diff)
downloadmpv-d81b02cce8d5e3b1d3cf2091f93376eca9e921a4.tar.bz2
mpv-d81b02cce8d5e3b1d3cf2091f93376eca9e921a4.tar.xz
fixed suboption parsing, added help for suboptions
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12213 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_gl.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 71f8eb158c..55b32b5dc8 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -324,6 +324,10 @@ draw_frame(uint8_t *src[])
int i;
uint8_t *ImageData=src[0];
+ if (slice_height == 0)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, image_width, image_height,
+ gl_format, gl_type, ImageData);
+ else
for(i=0;i<image_height;i+=slice_height){
glTexSubImage2D( GL_TEXTURE_2D, // target
0, // level
@@ -361,23 +365,43 @@ uninit(void)
static uint32_t preinit(const char *arg)
{
+ int parse_err = 0;
many_fmts = 0;
slice_height = 4;
if(arg)
{
- if (strncmp (arg, "manyfmts", 8) == 0) {
- mp_msg (MSGT_VO, MSGL_WARN, "[gl] make sure you have OpenGL >= 1.2 and used corresponding headers for compiling!");
- many_fmts = 1;
- arg = &arg[8];
- }
- if (arg[0] != 0) {
- slice_height = atoi(arg);
- if (slice_height <= 0)
- slice_height = 65536;
- }
+ char *parse_pos = &arg[0];
+ while (parse_pos[0] && !parse_err) {
+ if (strncmp (parse_pos, "manyfmts", 8) == 0) {
+ parse_pos = &parse_pos[8];
+ many_fmts = 1;
+ } else if (strncmp (parse_pos, "slice-height=", 13) == 0) {
+ parse_pos = &parse_pos[13];
+ slice_height = strtol(parse_pos, &parse_pos, 0);
+ if (slice_height < 0) parse_err = 1;
+ }
+ if (parse_pos[0] == ':') parse_pos = &parse_pos[1];
+ else if (parse_pos[0]) parse_err = 1;
+ }
}
- mp_msg(MSGT_VO, MSGL_INFO, "[vo_gl] Using %d as slice_height (0 means image_height).\n", slice_height);
-
+ if (parse_err) {
+ mp_msg(MSGT_VO, MSGL_ERR,
+ "\n-vo gl command line help:\n"
+ "Example: mplayer -vo gl:slice-height=4\n"
+ "\nOptions:\n"
+ " manyfmts\n"
+ " Enable extended color formats for OpenGL 1.2 and later\n"
+ " slice-height=<0-...>\n"
+ " Slice size for texture transfer, 0 for whole image\n"
+ "\n" );
+ return -1;
+ }
+ if (many_fmts)
+ mp_msg (MSGT_VO, MSGL_WARN, "[gl] using extended formats.\n"
+ "Make sure you have OpenGL >= 1.2 and used corresponding "
+ "headers for compiling!\n");
+ mp_msg (MSGT_VO, MSGL_INFO, "[gl] Using %d as slice height "
+ "(0 means image height).\n", slice_height);
if( !vo_init() ) return -1; // Can't open X11
return 0;