]> git.sesse.net Git - vlc/blobdiff - modules/misc/dummy/vout.c
Used vlc_fourcc_GetCodecFromString where applicable.
[vlc] / modules / misc / dummy / vout.c
index 83ee4e16a1a28d76ca08c56896d9528fa8ad3d1a..3311041e03d671edbbf29cd578ef21809d39442f 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vout_dummy.c: Dummy video output display method for testing purposes
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 2000, 2001 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                                /* free() */
-#include <string.h>                                            /* strerror() */
 
-#include <vlc/vlc.h>
-#include <vlc/vout.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_vout.h>
 
 #define DUMMY_WIDTH 16
 #define DUMMY_HEIGHT 16
 #define DUMMY_MAX_DIRECTBUFFERS 10
 
+#include "dummy.h"
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -43,13 +47,14 @@ static int  Manage     ( vout_thread_t * );
 static void Render     ( vout_thread_t *, picture_t * );
 static void Display    ( vout_thread_t *, picture_t * );
 static void SetPalette ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * );
+static int  Control   ( vout_thread_t *, int, va_list );
 
 /*****************************************************************************
  * OpenVideo: activates dummy video thread output method
  *****************************************************************************
  * This function initializes a dummy vout method.
  *****************************************************************************/
-int E_(OpenVideo) ( vlc_object_t *p_this )
+int OpenVideo ( vlc_object_t *p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *)p_this;
 
@@ -58,10 +63,21 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
     p_vout->pf_manage = Manage;
     p_vout->pf_render = Render;
     p_vout->pf_display = Display;
+    p_vout->pf_control = Control;
 
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * Control: control facility for the vout
+ *****************************************************************************/
+static int Control( vout_thread_t *p_vout, int i_query, va_list args )
+{
+    (void) p_vout; (void) i_query; (void) args;
+    return VLC_EGENERIC;
+}
+
+
 /*****************************************************************************
  * Init: initialize dummy video thread output method
  *****************************************************************************/
@@ -70,20 +86,12 @@ static int Init( vout_thread_t *p_vout )
     int i_index, i_chroma;
     char *psz_chroma;
     picture_t *p_pic;
-    vlc_bool_t b_chroma = 0;
+    bool b_chroma = 0;
 
     psz_chroma = config_GetPsz( p_vout, "dummy-chroma" );
-    if( psz_chroma )
-    {
-        if( strlen( psz_chroma ) >= 4 )
-        {
-            i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
-                                   psz_chroma[2], psz_chroma[3] );
-            b_chroma = 1;
-        }
-
-        free( psz_chroma );
-    }
+    i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+    b_chroma = i_chroma != 0;
+    free( psz_chroma );
 
     I_OUTPUTPICTURES = 0;
 
@@ -93,7 +101,7 @@ static int Init( vout_thread_t *p_vout )
         msg_Dbg( p_vout, "forcing chroma 0x%.8x (%4.4s)",
                          i_chroma, (char*)&i_chroma );
         p_vout->output.i_chroma = i_chroma;
-        if ( i_chroma == VLC_FOURCC( 'R', 'G', 'B', '2' ) )
+        if ( i_chroma == VLC_CODEC_RGB8 )
         {
             p_vout->output.pf_setpalette = SetPalette;
         }
@@ -177,6 +185,7 @@ static void End( vout_thread_t *p_vout )
  *****************************************************************************/
 static int Manage( vout_thread_t *p_vout )
 {
+    VLC_UNUSED(p_vout);
     return( 0 );
 }
 
@@ -185,6 +194,7 @@ static int Manage( vout_thread_t *p_vout )
  *****************************************************************************/
 static void Render( vout_thread_t *p_vout, picture_t *p_pic )
 {
+    VLC_UNUSED(p_vout); VLC_UNUSED(p_pic);
     /* No need to do anything, the fake direct buffers stay as they are */
 }
 
@@ -193,6 +203,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 {
+    VLC_UNUSED(p_vout); VLC_UNUSED(p_pic);
     /* No need to do anything, the fake direct buffers stay as they are */
 }
 
@@ -202,5 +213,6 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 static void SetPalette ( vout_thread_t *p_vout,
                          uint16_t *red, uint16_t *green, uint16_t *blue )
 {
+    VLC_UNUSED(p_vout); VLC_UNUSED(red); VLC_UNUSED(green); VLC_UNUSED(blue);
     /* No need to do anything, the fake direct buffers stay as they are */
 }