]> git.sesse.net Git - vlc/blobdiff - modules/gui/qnx/vout.c
Used VLC_CODEC_* and vlc_fourcc_GetCodec when suitable.
[vlc] / modules / gui / qnx / vout.c
index 4b30fe0ccf0968a3c865b3924f139c5bf998d990..ef775d1c285a8c9792beb78672a3365804994b0c 100644 (file)
@@ -316,9 +316,16 @@ static int QNXManage( vout_thread_t *p_vout )
 
         if( i_ev == Ph_RESIZE_MSG )
         {
+            PhEvent_t *buf;
+
             i_buflen = PhGetMsgSize( p_event );
-            if( ( p_event = realloc( p_event, i_buflen ) ) == NULL )
+            buf = realloc( p_event, i_buflen );
+            if( buf == NULL )
+            {
+                free( p_event );
                 return( 1 );
+            }
+            p_event = buf;
         }
         else if( i_ev == Ph_EVENT_MSG )
         {
@@ -585,13 +592,13 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
     switch( p_vout->p_sys->i_screen_depth )
     {
         case 8:
-            p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+            p_vout->output.i_chroma = VLC_CODEC_RGB8;
             p_vout->p_sys->i_bytes_per_pixel = 1;
             p_vout->output.pf_setpalette = SetPalette;
             break;
 
         case 15:
-            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+            p_vout->output.i_chroma = VLC_CODEC_RGB15;
             p_vout->p_sys->i_bytes_per_pixel = 2;
             p_vout->output.i_rmask = 0x7c00;
             p_vout->output.i_gmask = 0x03e0;
@@ -599,7 +606,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
             break;
 
         case 16:
-            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+            p_vout->output.i_chroma = VLC_CODEC_RGB16;
             p_vout->p_sys->i_bytes_per_pixel = 2;
             p_vout->output.i_rmask = 0xf800;
             p_vout->output.i_gmask = 0x07e0;
@@ -607,7 +614,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
             break;
 
         case 24:
-            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+            p_vout->output.i_chroma = VLC_CODEC_RGB24;
             p_vout->p_sys->i_bytes_per_pixel = 3;
             p_vout->output.i_rmask = 0xff0000;
             p_vout->output.i_gmask = 0x00ff00;
@@ -616,7 +623,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
 
         case 32:
         default:
-            p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+            p_vout->output.i_chroma = VLC_CODEC_RGB32;
             p_vout->p_sys->i_bytes_per_pixel = 4;
             p_vout->output.i_rmask = 0xff0000;
             p_vout->output.i_gmask = 0x00ff00;
@@ -812,7 +819,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
         switch (p_vout->p_sys->i_vc_format)
         {
             case Pg_VIDEO_FORMAT_YUV420:
-                p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
+                p_vout->output.i_chroma = VLC_CODEC_I420;
 
                 p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
                 p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
@@ -849,7 +856,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 break;
 
             case Pg_VIDEO_FORMAT_YV12:
-                p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+                p_vout->output.i_chroma = VLC_CODEC_YV12;
 
                 p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
                 p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
@@ -889,11 +896,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
             case Pg_VIDEO_FORMAT_YUY2:
                 if (p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_UYVY)
                 {
-                    p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+                    p_vout->output.i_chroma = VLC_CODEC_UYVY;
                 }
                 else
                 {
-                    p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+                    p_vout->output.i_chroma = VLC_CODEC_YUYV;
                 }
 
                 p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
@@ -907,7 +914,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 break;
 
             case Pg_VIDEO_FORMAT_RGB555:
-                p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+                p_vout->output.i_chroma = VLC_CODEC_RGB15;
                 p_vout->output.i_rmask = 0x001f;
                 p_vout->output.i_gmask = 0x03e0;
                 p_vout->output.i_bmask = 0x7c00;
@@ -923,7 +930,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 break;
 
             case Pg_VIDEO_FORMAT_RGB565:
-                p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+                p_vout->output.i_chroma = VLC_CODEC_RGB16;
                 p_vout->output.i_rmask = 0x001f;
                 p_vout->output.i_gmask = 0x07e0;
                 p_vout->output.i_bmask = 0xf800;
@@ -939,7 +946,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 break;
 
             case Pg_VIDEO_FORMAT_RGB8888:
-                p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+                p_vout->output.i_chroma = VLC_CODEC_RGB32;
                 p_vout->output.i_rmask = 0x000000ff;
                 p_vout->output.i_gmask = 0x0000ff00;
                 p_vout->output.i_bmask = 0x00ff0000;
@@ -959,7 +966,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
     switch( p_vout->output.i_chroma )
     {
 #ifdef MODULE_NAME_IS_xvideo
-        case VLC_FOURCC('Y','2','1','1'):
+        case VLC_CODEC_Y211:
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->offsets[0];