Commit 90643c69 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

mfc: Remove mfc plugin, it is obsoleted by the v4l2videodec element from gst-plugins-good

parent 24224f86
......@@ -117,7 +117,8 @@ CRUFT_DIRS = \
$(top_srcdir)/ext/swfdec \
$(top_srcdir)/ext/tarkin \
$(top_srcdir)/ext/theora \
$(top_srcdir)/ext/vp8
$(top_srcdir)/ext/vp8 \
$(top_srcdir)/sys/mfc
include $(top_srcdir)/common/cruft.mak
......
......@@ -1691,55 +1691,6 @@ AG_GST_CHECK_FEATURE(SHM, [POSIX shared memory source and sink], shm, [
fi
])
dnl *** Video 4 Linux 2 ***
dnl for information about the header/define, see sys/v4l2/gstv4l2element.h
dnl renamed to GST_V4L2 because of some conflict with kernel headers
translit(dnm, m, l) AM_CONDITIONAL(USE_MFC, true)
AG_GST_CHECK_FEATURE(MFC, [Multi Format Codec], mfc, [
AC_MSG_CHECKING([Checking for up to date v4l2 installation])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#ifdef __sun /* Solaris */
#include <sys/types.h>
#include <sys/videodev2.h>
#elif __FreeBSD__
#include <linux/videodev2.h>
#else /* Linux */
#include <linux/types.h>
#define _LINUX_TIME_H
#define __user
#include <linux/videodev2.h>
#endif
#if defined(V4L2_MAJOR_VERSION) || defined(V4L2_MINOR_VERSION)
#error too early v4l2 version or no v4l2 at all
#endif
#if !defined(V4L2_PIX_FMT_H264)
#error v4l2 version too old
#endif
]], [[
return 0;
]])],[
HAVE_MFC="yes"
AC_MSG_RESULT(yes)
],[
HAVE_MFC="no"
AC_MSG_RESULT(no)
HAVE_VIDEODEV=no
AC_CHECK_HEADER(linux/videodev2.h, [ HAVE_VIDEODEV=yes ],
[
AC_CHECK_HEADER(sys/videodev2.h, [ HAVE_VIDEODEV=yes ])
])
if test "x$HAVE_VIDEODEV" = "xyes"; then
AC_MSG_WARN([video4linux2 headers were found, but they're old.])
AC_MSG_WARN([Please update v4l2 to compile the MFC plugins])
else
AC_MSG_WARN([v4l2 was not found])
fi
])
])
dnl check for Video CD
translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
AG_GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
......@@ -3222,7 +3173,6 @@ sys/linsys/Makefile
sys/opensles/Makefile
sys/osxvideo/Makefile
sys/qtwrapper/Makefile
sys/mfc/Makefile
sys/shm/Makefile
sys/uvch264/Makefile
sys/vcd/Makefile
......
......@@ -160,15 +160,9 @@ else
UVCH264_DIR=
endif
if USE_MFC
MFC_DIR=mfc
else
MFC_DIR=
endif
SUBDIRS = $(ACM_DIR) $(ANDROID_MEDIA_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(BLUEZ_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR) $(WINKS_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OPENSLES_DIR) $(OSX_VIDEO_DIR) $(PVR_DIR) $(QT_DIR) $(SHM_DIR) $(UVCH264_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR) $(WINSCREENCAP_DIR) $(WASAPI_DIR) $(MFC_DIR)
SUBDIRS = $(ACM_DIR) $(ANDROID_MEDIA_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(BLUEZ_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR) $(WINKS_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OPENSLES_DIR) $(OSX_VIDEO_DIR) $(PVR_DIR) $(QT_DIR) $(SHM_DIR) $(UVCH264_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR) $(WINSCREENCAP_DIR) $(WASAPI_DIR)
DIST_SUBDIRS = acmenc acmmp3dec androidmedia applemedia applemedia-nonpublic avc bluez d3dvideosink decklink directdraw directsound dvb linsys fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \
opensles osxvideo pvr2d qtwrapper shm uvch264 vcd vdpau wasapi wininet winks winscreencap mfc
opensles osxvideo pvr2d qtwrapper shm uvch264 vcd vdpau wasapi wininet winks winscreencap
include $(top_srcdir)/common/parallel-subdirs.mak
plugin_LTLIBRARIES = libgstmfc.la
libgstmfc_la_SOURCES = \
mfc_decoder/mfc_decoder.c \
fimc/fimc.c \
gstmfc.c \
gstmfcdec.c
noinst_HEADERS = \
mfc_decoder/mfc_decoder.h \
fimc/fimc.h \
gstmfcdec.h
libgstmfc_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
-I$(srcdir)
libgstmfc_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstvideo-@GST_API_VERSION@ \
$(GST_BASE_LIBS) \
$(GST_LIBS)
libgstmfc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstmfc_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
This diff is collapsed.
/*
* Copyright (c) 2012 Collabora Ltd.
* Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* This library is licensed under 2 different licenses and you
* can choose to use it under the terms of any one of them. The
* two licenses are the Apache License 2.0 and the LGPL.
*
* Apache License 2.0:
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* LGPL:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef __FIMC_H__
#define __FIMC_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _Fimc Fimc;
typedef enum {
FIMC_COLOR_FORMAT_YUV420SPT,
FIMC_COLOR_FORMAT_YUV420SP,
FIMC_COLOR_FORMAT_YUV420P,
FIMC_COLOR_FORMAT_RGB32
} FimcColorFormat;
void fimc_init_debug (void);
Fimc * fimc_new (void);
void fimc_free (Fimc * fimc);
int fimc_set_src_format (Fimc *fimc, FimcColorFormat format, int width, int height, int stride[3], int crop_left, int crop_top, int crop_width, int crop_height);
int fimc_request_src_buffers (Fimc *fimc);
int fimc_release_src_buffers (Fimc *fimc);
int fimc_set_dst_format (Fimc *fimc, FimcColorFormat format, int width, int height, int stride[3], int crop_left, int crop_top, int crop_width, int crop_height);
int fimc_request_dst_buffers (Fimc *fimc);
int fimc_request_dst_buffers_mmap (Fimc *fimc, void *dst[3], int stride[3]);
int fimc_release_dst_buffers (Fimc *fimc);
int fimc_convert (Fimc *fimc, void *src[3], void *dst[3]);
#ifdef __cplusplus
}
#endif
#endif /* __FIMC_H__ */
/*
* Copyright (C) 2012 Collabora Ltd.
* Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include "gstmfcdec.h"
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PLUGIN_LOADING);
static gboolean
plugin_init (GstPlugin * plugin)
{
struct mfc_dec_context *context;
/* Just check here once if we can create a MFC context, i.e.
* if the hardware is available */
mfc_dec_init_debug ();
context = mfc_dec_create (CODEC_TYPE_H264);
if (!context) {
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING,
"Failed to initialize MFC decoder context");
return TRUE;
}
mfc_dec_destroy (context);
if (!gst_element_register (plugin, "mfcdec", GST_RANK_PRIMARY,
GST_TYPE_MFC_DEC))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
mfc,
"Samsung Exynos MFC plugin",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
This diff is collapsed.
/*
* Copyright (C) 2012 Collabora Ltd.
* Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef __GST_MFC_DEC_H__
#define __GST_MFC_DEC_H__
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideodecoder.h>
#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h>
#include "mfc_decoder/mfc_decoder.h"
#include "fimc/fimc.h"
G_BEGIN_DECLS
#define GST_TYPE_MFC_DEC \
(gst_mfc_dec_get_type())
#define GST_MFC_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MFC_DEC,GstMFCDec))
#define GST_MFC_DEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MFC_DEC,GstMFCDecClass))
#define GST_IS_MFC_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MFC_DEC))
#define GST_IS_MFC_DEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MFC_DEC))
typedef struct _GstMFCDec GstMFCDec;
typedef struct _GstMFCDecClass GstMFCDecClass;
struct _GstMFCDec
{
GstVideoDecoder parent;
/* < private > */
GstVideoCodecState *input_state;
struct mfc_dec_context* context;
gboolean initialized;
GstBuffer *codec_data;
gboolean has_cropping;
GstVideoFormat format;
FimcColorFormat fimc_format;
Fimc *fimc;
gint width, height;
gint crop_left, crop_top;
gint crop_width, crop_height;
int src_stride[3];
void *dst[3];
int dst_stride[3];
gboolean mmap;
};
struct _GstMFCDecClass
{
GstVideoDecoderClass parent_class;
};
GType gst_mfc_dec_get_type (void);
G_END_DECLS
#endif /* __GST_MFC_DEC_H__ */
This diff is collapsed.
/*
* Copyright (c) 2012 FXI Technologies
*
* This library is licensed under 2 different licenses and you
* can choose to use it under the terms of any one of them. The
* two licenses are the Apache License 2.0 and the LGPL.
*
* Apache License 2.0:
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* LGPL:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Author: Haavard Kvaalen <havardk@fxitech.com>
*/
/*
* Interface for decoding of various video formats using the Samsung
* Multi-Format Video Codec (MFC).
*/
#ifndef VIDEO_EXYNOS4_MFC_V4L2_INCLUDE_MFC_DECODER_H
#define VIDEO_EXYNOS4_MFC_V4L2_INCLUDE_MFC_DECODER_H
#include <sys/time.h>
struct mfc_buffer;
struct mfc_dec_context;
enum mfc_codec_type {
CODEC_TYPE_H264,
CODEC_TYPE_VC1, /* VC1 advanced profile */
CODEC_TYPE_VC1_RCV, /* VC1 simple/main profile */
CODEC_TYPE_MPEG4,
CODEC_TYPE_MPEG1,
CODEC_TYPE_MPEG2,
CODEC_TYPE_H263,
};
#ifdef __cplusplus
extern "C" {
#endif
void mfc_dec_init_debug (void);
/*
* Open the MFC decoding device node, and allocate input buffers.
*
* Returns a mfc_dec_context. Note that the context can only be used
* for decoding one stream, i.e. mfc_dec_init can only be called once.
*
* Args:
* codec: Codec type (this can later be changed with mfc_set_codec()).
* num_input_buffers: Numbers of input buffers. There is never any
* need to enqueue more than one buffer for correct decoding.
*
* Returns: A new mfc_dec_context if successful, NULL on error. This
* context is needed for most other calls below, and should be
* deallocated with mfc_dec_destroy().
*/
struct mfc_dec_context* mfc_dec_create(enum mfc_codec_type codec);
int mfc_dec_init_input(struct mfc_dec_context*, int num_input_buffers);
/*
* Destroy context created with mfc_dec_create().
*/
void mfc_dec_destroy(struct mfc_dec_context*);
/*
* Initialize video decode. Before this function is called, the
* initial input frame (which contains the header) must be enqueued.
*
* This function allocate output buffers. All output buffers will be
* enqueued initially. The actual number of output buffers depend on the
*
* Args:
* extra_buffers: Numbers of output buffers that can be kept
* dequeued at any time.
*
* Returns: Zero for success, negative value on failure.
*/
int mfc_dec_init_output(struct mfc_dec_context*, int extra_buffers);
/*
* This function may be called only before mfc_dec_init(). It is only
* necessary to call if the codec type is different from the one
* supplied to mfc_dec_create().
*
* Args:
* codec: Codec type
*
* Returns: Zero for success, negative value on failure.
*/
int mfc_dec_set_codec(struct mfc_dec_context*, enum mfc_codec_type codec);
/*
* Get size of image output from the MFC. The data might be larger
* than the actual video because of MFC alignment requirements (see
* the crop size below). This function can only be called after
* mfc_dec_init() has been called.
*
* Args:
* w: Width (output).
* h: Height (output).
*
* Returns: Zero for success, negative value on failure.
*/
void mfc_dec_get_output_size(struct mfc_dec_context*, int *w, int *h);
void mfc_dec_get_output_stride(struct mfc_dec_context*, int *ystride, int *uvstride);
void mfc_dec_get_crop_size(struct mfc_dec_context*,
int *left, int *top, int *w, int *h);
/*
* Check if there are output frames that can be dequeued.
*
* Returns: Positive value if a frame is available, zero if not.
*/
int mfc_dec_output_available(struct mfc_dec_context*);
/*
* This module use 'input' and 'output' for input to, and output from
* the MFC. The VFL2 names for these interfaces are OUTPUT (for the
* input) and CAPTURE (for the output).
*
* These functions return zero for success, negative value on failure.
*
* When the end of stream has been reached, an empty input frame
* should be enqueued after the last valid input frame. This signal
* to the MFC that EOS has been reached. After this no more input
* frames can be enqueued.
*/
/* Enqueue frame containing compressed data */
int mfc_dec_enqueue_input(struct mfc_dec_context*, struct mfc_buffer *buffer, struct timeval *timestamp);
/*
* Dequeue a processed input frame. Will block until one is available.
*
* Returns 0 on success, -1 on failure, and -2 on timeout. A timeout
* typically happens if there are no free output buffers available.
*/
int mfc_dec_dequeue_input(struct mfc_dec_context*, struct mfc_buffer **buffer);
/* Enqueue empty output frame */
int mfc_dec_enqueue_output(struct mfc_dec_context*, struct mfc_buffer *buffer);
/*
* Dequeue output frame with image data. This should only be called
* when mfc_dec_output_available() returns true. If this is called
* when mfc_dec_output_available() is not true, subsequent video
* frames may not decode correctly.
*/
int mfc_dec_dequeue_output(struct mfc_dec_context*, struct mfc_buffer **buffer, struct timeval *timestamp);
/*
* Flush (discard) all enqueued output and input frames. This is
* typically used if we want to seek.
*
* Calling flush resets the "end of stream" state that is entered by
* enqueuing an empty input frame. Thus it is safe to seek at the end
* of the stream as long as mfc_dec_flush() is called first.
*/
int mfc_dec_flush(struct mfc_dec_context*);
/*
* Get pointer to the input data in 'buffer'.
*/
void* mfc_buffer_get_input_data(struct mfc_buffer *buffer);
/*
* Get maximum size of input buffer 'buffer' in bytes.
*/
int mfc_buffer_get_input_max_size(struct mfc_buffer *buffer);
/*
* Set size of data that has been put into 'buffer' in bytes.
*/
void mfc_buffer_set_input_size(struct mfc_buffer *buffer, int size);
/*
* Get pointers to data in output buffer 'buffer'.
*/
void mfc_buffer_get_output_data(struct mfc_buffer *buffer,
void **ybuf, void **uvbuf);
#ifdef __cplusplus
}
#endif
#endif /* VIDEO_EXYNOS4_MFC_V4L2_INCLUDE_MFC_DECODER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment