[FFmpeg-devel] [PATCH 3/4] avdevice/fbdev: move common code to separate file

Michael Niedermayer michaelni at gmx.at
Sat Oct 19 22:35:53 CEST 2013


On Sat, Oct 19, 2013 at 09:38:39PM +0200, Lukasz Marek wrote:
> Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>
> ---
>  libavdevice/Makefile       |    6 +++--
>  libavdevice/fbdev_common.c |   57 ++++++++++++++++++++++++++++++++++++++++++++
>  libavdevice/fbdev_common.h |   31 ++++++++++++++++++++++++
>  libavdevice/fbdev_dec.c    |   36 ++--------------------------
>  libavdevice/fbdev_enc.c    |   34 +-------------------------
>  5 files changed, 95 insertions(+), 69 deletions(-)
>  create mode 100644 libavdevice/fbdev_common.c
>  create mode 100644 libavdevice/fbdev_common.h
> 
> diff --git a/libavdevice/Makefile b/libavdevice/Makefile
> index cf6cac2..21ca954 100644
> --- a/libavdevice/Makefile
> +++ b/libavdevice/Makefile
> @@ -23,8 +23,10 @@ OBJS-$(CONFIG_DSHOW_INDEV)               += dshow.o dshow_enummediatypes.o \
>                                              dshow_enumpins.o dshow_filter.o \
>                                              dshow_pin.o dshow_common.o
>  OBJS-$(CONFIG_DV1394_INDEV)              += dv1394.o
> -OBJS-$(CONFIG_FBDEV_INDEV)               += fbdev_dec.o
> -OBJS-$(CONFIG_FBDEV_OUTDEV)              += fbdev_enc.o
> +OBJS-$(CONFIG_FBDEV_INDEV)               += fbdev_dec.o \
> +                                            fbdev_common.o
> +OBJS-$(CONFIG_FBDEV_OUTDEV)              += fbdev_enc.o \
> +                                            fbdev_common.o
>  OBJS-$(CONFIG_IEC61883_INDEV)            += iec61883.o
>  OBJS-$(CONFIG_JACK_INDEV)                += jack_audio.o timefilter.o
>  OBJS-$(CONFIG_LAVFI_INDEV)               += lavfi.o
> diff --git a/libavdevice/fbdev_common.c b/libavdevice/fbdev_common.c
> new file mode 100644
> index 0000000..34603a9
> --- /dev/null
> +++ b/libavdevice/fbdev_common.c
> @@ -0,0 +1,57 @@
> +/*
> + * Copyright (c) 2011 Stefano Sabatini
> + * Copyright (c) 2009 Giliard B. de Freitas <giliarde at gmail.com>
> + * Copyright (C) 2002 Gunnar Monell <gmo at linux.nu>
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg 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.
> + *
> + * FFmpeg 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
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include "fbdev_common.h"
> +#include "libavutil/common.h"
> +
> +struct rgb_pixfmt_map_entry {
> +    int bits_per_pixel;
> +    int red_offset, green_offset, blue_offset, alpha_offset;
> +    enum AVPixelFormat pixfmt;
> +};
> +
> +static const struct rgb_pixfmt_map_entry rgb_pixfmt_map[] = {
> +    // bpp, red_offset,  green_offset, blue_offset, alpha_offset, pixfmt
> +    {  32,       0,           8,          16,           24,   AV_PIX_FMT_RGBA  },
> +    {  32,      16,           8,           0,           24,   AV_PIX_FMT_BGRA  },
> +    {  32,       8,          16,          24,            0,   AV_PIX_FMT_ARGB  },
> +    {  32,       3,           2,           8,            0,   AV_PIX_FMT_ABGR  },
> +    {  24,       0,           8,          16,            0,   AV_PIX_FMT_RGB24 },
> +    {  24,      16,           8,           0,            0,   AV_PIX_FMT_BGR24 },
> +    {  16,      11,           5,           0,           16,   AV_PIX_FMT_RGB565 },
> +};
> +
> +enum AVPixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)

needs ff_ prefix

otherwise LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131019/6ba0fff8/attachment.asc>


More information about the ffmpeg-devel mailing list