[MPlayer-dev-eng] New stereo output mode for OpenGL video driver
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Fri Dec 23 23:25:05 CET 2011
On Sun, Dec 18, 2011 at 11:53:54PM +0100, Wolfgang Draxinger wrote:
> + case GL_3D_ROWINTERLACE_ODD:
Trailing space.
> + mpglEnable(GL_POLYGON_STIPPLE);
> + mpglPixelStorei(GL_UNPACK_ALIGNMENT,1);
> + mpglPixelStorei(GL_UNPACK_ROW_LENGTH,0);
> + mpglPolygonStipple(stipple_row_odd);
> + break;
> + case GL_3D_ROWINTERLACE_EVEN:
> + mpglEnable(GL_POLYGON_STIPPLE);
> + mpglPixelStorei(GL_UNPACK_ALIGNMENT,1);
> + mpglPixelStorei(GL_UNPACK_ROW_LENGTH,0);
> + mpglPolygonStipple(stipple_row_even);
> + break;
> + case GL_3D_COLUMNINTERLACE_ODD:
> + mpglEnable(GL_POLYGON_STIPPLE);
> + mpglPixelStorei(GL_UNPACK_ALIGNMENT,1);
> + mpglPixelStorei(GL_UNPACK_ROW_LENGTH,0);
> + mpglPolygonStipple(stipple_column_odd);
> + break;
> + case GL_3D_COLUMNINTERLACE_EVEN:
> + mpglEnable(GL_POLYGON_STIPPLE);
> + mpglPixelStorei(GL_UNPACK_ALIGNMENT,1);
> + mpglPixelStorei(GL_UNPACK_ROW_LENGTH,0);
> + mpglPolygonStipple(stipple_column_even);
> + break;
You shouldn't be using tabs in this code.
Also using the glAdjustAlignment function instead of GL_UNPACK_ALIGNMENT
directly is more consistent with the rest of the code, even if it
is a bit overkill.
However, by using uint64_t type for the arrays you should save some
typing and you should have no need to set this up at all, since any
value should work.
> + case GL_3D_ROWINTERLACE_ODD:
> + case GL_3D_ROWINTERLACE_EVEN:
> + case GL_3D_COLUMNINTERLACE_ODD:
> + case GL_3D_COLUMNINTERLACE_EVEN:
> + glDisable(GL_POLYGON_STIPPLE);
> + mpglPolygonStipple(NULL);
Passing NULL to glPolygonStipple is not allowed by my understanding.
> diff --git a/libvo/gl_common.h b/libvo/gl_common.h
> index 52b8999..f0fec03 100644
> --- a/libvo/gl_common.h
> +++ b/libvo/gl_common.h
> @@ -389,6 +389,10 @@ void glDisableYUVConversion(GLenum target, int type);
> #define GL_3D_RED_CYAN 1
> #define GL_3D_GREEN_MAGENTA 2
> #define GL_3D_QUADBUFFER 3
> +#define GL_3D_ROWINTERLACE_ODD 4
> +#define GL_3D_ROWINTERLACE_EVEN 5
> +#define GL_3D_COLUMNINTERLACE_ODD 6
> +#define GL_3D_COLUMNINTERLACE_EVEN 7
You should only need 2 and a way to swap left and right, that should
simplify this a good bit.
More information about the MPlayer-dev-eng
mailing list