]> git.sesse.net Git - vlc/blobdiff - modules/codec/ffmpeg/chroma.c
Remove excess whitespace.
[vlc] / modules / codec / ffmpeg / chroma.c
index f7b14e45bb79388d6ee202ca0601cf0ccef01115..a1ff04280ff91533215a65735de62ddcffbfaaf6 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * chroma.c: chroma conversion using ffmpeg library
  *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
+ * Copyright (C) 1999-2001 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.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 <vlc/vlc.h>
-#include <vlc/vout.h>
+#include <vlc_vout.h>
 
 /* ffmpeg header */
 #ifdef HAVE_FFMPEG_AVCODEC_H
@@ -36,6 +36,7 @@
 
 #include "ffmpeg.h"
 
+#if !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
 void E_(InitLibavcodec) ( vlc_object_t *p_object );
 static void ChromaConversion( vout_thread_t *, picture_t *, picture_t * );
 
@@ -88,17 +89,16 @@ int E_(OpenChroma)( vlc_object_t *p_this )
     p_vout->chroma.p_sys->i_dst_vlc_chroma = p_vout->output.i_chroma;
     p_vout->chroma.p_sys->i_src_ffmpeg_chroma = i_ffmpeg_chroma[0];
     p_vout->chroma.p_sys->i_dst_ffmpeg_chroma = i_ffmpeg_chroma[1];
+
     if( ( p_vout->render.i_height != p_vout->output.i_height ||
           p_vout->render.i_width != p_vout->output.i_width ) &&
         ( p_vout->chroma.p_sys->i_dst_vlc_chroma == VLC_FOURCC('I','4','2','0')  ||
           p_vout->chroma.p_sys->i_dst_vlc_chroma == VLC_FOURCC('Y','V','1','2') ))
-        
     {
         msg_Dbg( p_vout, "preparing to resample picture" );
-        p_vout->chroma.p_sys->p_rsc = img_resample_init( p_vout->output.i_width,
-                                                         p_vout->output.i_height,
-                                                         p_vout->render.i_width,
-                                                         p_vout->render.i_height );
+        p_vout->chroma.p_sys->p_rsc =
+            img_resample_init( p_vout->output.i_width, p_vout->output.i_height,
+                               p_vout->render.i_width, p_vout->render.i_height );
         avpicture_alloc( &p_vout->chroma.p_sys->tmp_pic,
                          p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
                          p_vout->render.i_width, p_vout->render.i_height );
@@ -152,6 +152,10 @@ static void ChromaConversion( vout_thread_t *p_vout,
         dest_pic.data[1] = p_dest->p[2].p_pixels;
         dest_pic.data[2] = p_dest->p[1].p_pixels;
     }
+    if( p_vout->chroma.p_sys->i_src_ffmpeg_chroma == PIX_FMT_RGB24 )
+        if( p_vout->render.i_bmask == 0x00ff0000 )
+            p_vout->chroma.p_sys->i_src_ffmpeg_chroma = PIX_FMT_BGR24;
+
     if( p_vout->chroma.p_sys->p_rsc )
     {
         img_convert( &p_vout->chroma.p_sys->tmp_pic,
@@ -184,3 +188,4 @@ void E_(CloseChroma)( vlc_object_t *p_this )
     }
     free( p_vout->chroma.p_sys );
 }
+#endif /* !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) */