X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_chroma%2Fgrey_yuv.c;h=b236cd7883c057acf402d705fd0b59a2f58b1e1b;hb=fef270581f736d4f6289a77cb115195241ed691d;hp=494cacd6e01f89d5e762819e25bef61067ff2ee1;hpb=218efb93081e39e66b44a78d728847e1a3679db1;p=vlc diff --git a/modules/video_chroma/grey_yuv.c b/modules/video_chroma/grey_yuv.c index 494cacd6e0..b236cd7883 100644 --- a/modules/video_chroma/grey_yuv.c +++ b/modules/video_chroma/grey_yuv.c @@ -1,24 +1,24 @@ /***************************************************************************** * grey_yuv.c : grayscale to others conversion module for vlc ***************************************************************************** - * Copyright (C) 2007, 2008 the VideoLAN team + * Copyright (C) 2007, 2008 VLC authors and VideoLAN * $Id$ * * Authors: Sam Hocevar * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. * - * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** @@ -32,7 +32,6 @@ #include #include #include -#include #define SRC_FOURCC "GREY" #define DEST_FOURCC "I420,YUY2" @@ -51,11 +50,11 @@ static picture_t *GREY_YUY2_Filter( filter_t *, picture_t * ); /***************************************************************************** * Module descriptor. *****************************************************************************/ -vlc_module_begin(); - set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) ); - set_capability( "video filter2", 80 ); - set_callbacks( Activate, NULL ); -vlc_module_end(); +vlc_module_begin () + set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) ) + set_capability( "video filter2", 80 ) + set_callbacks( Activate, NULL ) +vlc_module_end () /***************************************************************************** * Activate: allocate a chroma function @@ -72,17 +71,19 @@ static int Activate( vlc_object_t *p_this ) return -1; } + if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width + || p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height ) + return -1; + switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','8','0','0'): - p_filter->fmt_in.video.i_chroma = VLC_FOURCC('G','R','E','Y'); - case VLC_FOURCC('G','R','E','Y'): + case VLC_CODEC_GREY: switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): + case VLC_CODEC_I420: p_filter->pf_video_filter = GREY_I420_Filter; break; - case VLC_FOURCC('Y','U','Y','2'): + case VLC_CODEC_YUYV: p_filter->pf_video_filter = GREY_YUY2_Filter; break; default: