[MPlayer-dev-eng] Direct3D OSD discussion

Diego Biurrun diego at biurrun.de
Wed Nov 26 09:32:35 CET 2008


On Wed, Nov 26, 2008 at 07:56:18AM +0000, Jim Hauxwell wrote:
> > 
> > This patch is broken and does not apply.  I suspect Windows linebreaks.
> 
> Sorry, my mistake.  Visual Studio had decided to add CR/LF to all the
> lines and svn diff doesn't take this into account.
> 
> New, smaller patch file
> 
> --- libvo/vo_direct3d.c	(revision 28034)
> +++ libvo/vo_direct3d.c	(working copy)
> @@ -71,8 +71,14 @@
>      IDirect3DSurface9 *d3d_surface; /**< Offscreen Direct3D Surface. MPlayer
>                                      renders inside it. Uses colorspace
>                                      priv->movie_src_fmt */
> +	IDirect3DTexture9 *d3d_texture_osd; /**< Direct3D Texture. Uses RGBA */
> +	IDirect3DTexture9 *d3d_texture_system; /**< Direct3D Texture. System memory
> +										     cant lock a normal texture. Uses RGBA */

Do not add tabs to a file without tabs

> @@ -95,6 +101,27 @@
>  #define DISPLAY_FORMAT_TABLE_ENTRIES \
>          (sizeof(fmt_table) / sizeof(fmt_table[0]))
>  
> +#define D3DFVF_MY_VERTEX ( D3DFVF_XYZ | D3DFVF_TEX1 )
> +
> +#define OSD_TEXTURE_SIZE 1024 // as this is a texture, it can be a different size to the movie
> +
> +typedef struct vertex_s
> +{
> +	float x, y, z;	// Position of vertex in 3D space
> +    float tu, tv;	// Texture coordinates
> +} vertex_t;
> +
> +vertex_t osd_quad_vb[] = 

trailing whitespace

> +extern void vo_draw_text(int dxs, int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
> +extern int vo_osd_changed(int new_value);

You need to #include the appropriate header, not add extern declarations
all over the file.

> @@ -180,6 +207,25 @@
> +	/* kill the VB and the texture */
> +	if (priv->d3d_texture_osd != NULL)
> +	{

Respect the coding style of the file, keep braces on the same line as
the if.

> @@ -666,3 +756,140 @@
> +
> +
> +void vo_draw_alpha_l8a8(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride)

Please break long lines.

> +{
> +    int y;
> +    for(y=0;y<h;y++){

Again, respect the surrounding coding style.

Diego



More information about the MPlayer-dev-eng mailing list