add osxvideosrc

* configure.ac:
* sys/Makefile.am:
* sys/osxvideo/Makefile.am: Autoconfiscation.

* sys/osxvideo/osxvideoplugin.m:
* sys/osxvideo/osxvideosrc.h:
* sys/osxvideo/osxvideosrc.c: Add osxvideosrc. Should fix #153684.

Patch-by: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
Patch-by: Ali Sabil <ali.sabil@tandberg.com>
Patch-by: Barracuda Networks <justin@affinix.com>
This commit is contained in:
Andy Wingo 2009-04-20 13:09:46 +02:00 committed by Andy Wingo
parent 0ad5dec019
commit 1bd852073d
6 changed files with 1561 additions and 2 deletions

View file

@ -359,6 +359,22 @@ fi
dnl *** sys plug-ins ***
dnl *** OS X videosrc ***
translit(dnm, m, l) AM_CONDITIONAL(USE_OSX_VIDEO, true)
HAVE_OSX_VIDEO="no"
AG_GST_CHECK_FEATURE(OSX_VIDEO, [OSX video], osxvideosrc, [
AC_CHECK_HEADER(Quicktime/Quicktime.h, HAVE_OSX_VIDEO="yes", HAVE_OSX_VIDEO="no")
])
dnl in case header Quicktime/Quicktime.h is found on other platforms
case "$host" in
*-*darwin*)
dnl do nothing
;;
*)
HAVE_OSX_VIDEO="no"
;;
esac
dnl check for QuickTime
translit(dnm, m, l) AM_CONDITIONAL(USE_QUICKTIME, true)
AG_GST_CHECK_FEATURE(QUICKTIME, [QuickTime wrapper], qtwrapper, [
@ -1565,6 +1581,7 @@ sys/dshowvideosink/Makefile
sys/dvb/Makefile
sys/fbdev/Makefile
sys/oss4/Makefile
sys/osxvideo/Makefile
sys/qtwrapper/Makefile
sys/vcd/Makefile
sys/wasapi/Makefile

View file

@ -40,6 +40,12 @@ else
OSS4_DIR=
endif
if USE_OSX_VIDEO
OSX_VIDEO_DIR=osxvideo
else
OSX_VIDEO_DIR=
endif
if USE_QUICKTIME
QT_DIR=qtwrapper
else
@ -58,8 +64,8 @@ else
ACM_DIR=
endif
SUBDIRS = $(ACM_DIR) $(DVB_DIR) $(FBDEV_DIR) $(OSS4_DIR) $(QT_DIR) $(VCD_DIR) $(WININET_DIR)
SUBDIRS = $(ACM_DIR) $(DVB_DIR) $(FBDEV_DIR) $(OSS4_DIR) $(OSX_VIDEO_DIR) $(QT_DIR) $(VCD_DIR) $(WININET_DIR)
DIST_SUBDIRS = acmenc acmmp3dec dvb fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \
oss4 qtwrapper vcd wasapi wininet winks winscreencap
oss4 osxvideo qtwrapper vcd wasapi wininet winks winscreencap

18
sys/osxvideo/Makefile.am Normal file
View file

@ -0,0 +1,18 @@
plugin_LTLIBRARIES = libgstosxvideosrc.la
libgstosxvideosrc_la_SOURCES = osxvideoplugin.m osxvideosrc.c
libgstosxvideosrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) -Wno-deprecated-declarations
libgstosxvideosrc_la_LIBADD = \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR)
libgstosxvideosrc_la_LIBTOOLFLAGS = --tag=disable-static
libgstosxvideosrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) \
-Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,QuickTime
AM_OBJCFLAGS=$(CFLAGS) $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS)
noinst_HEADERS = osxvideosrc.h

View file

@ -0,0 +1,50 @@
/* GStreamer
* OSX video src
* Copyright (C) 2004-6 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* Copyright (C) 2007 Pioneers of the Inevitable <songbird@songbirdnest.com>
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* The development of this code was made possible due to the involvement of
* Pioneers of the Inevitable, the creators of the Songbird Music player.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* Object header */
#include "osxvideosrc.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "osxvideosrc",
GST_RANK_PRIMARY, GST_TYPE_OSX_VIDEO_SRC))
return FALSE;
GST_DEBUG_CATEGORY_INIT (gst_debug_osx_video_src, "osxvideosrc", 0,
"osxvideosrc element");
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"osxvideosrc",
"OSX native video input plugin",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)

1394
sys/osxvideo/osxvideosrc.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,74 @@
/*
* GStreamer
* Copyright 2007 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
* Copyright 2007 Ali Sabil <ali.sabil@tandberg.com>
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_OSX_VIDEO_SRC_H__
#define __GST_OSX_VIDEO_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
#include <Quicktime/Quicktime.h>
GST_DEBUG_CATEGORY_EXTERN (gst_debug_osx_video_src);
G_BEGIN_DECLS
/* #defines don't like whitespacey bits */
#define GST_TYPE_OSX_VIDEO_SRC \
(gst_osx_video_src_get_type())
#define GST_OSX_VIDEO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OSX_VIDEO_SRC,GstOSXVideoSrc))
#define GST_OSX_VIDEO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OSX_VIDEO_SRC,GstOSXVideoSrcClass))
#define GST_IS_OSX_VIDEO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OSX_VIDEO_SRC))
#define GST_IS_OSX_VIDEO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OSX_VIDEO_SRC))
typedef struct _GstOSXVideoSrc GstOSXVideoSrc;
typedef struct _GstOSXVideoSrcClass GstOSXVideoSrcClass;
struct _GstOSXVideoSrc
{
GstPushSrc pushsrc;
gchar * device_id;
gchar * device_name;
SeqGrabComponent seq_grab;
SGChannel video_chan;
GWorldPtr world;
Rect rect;
ImageSequence dec_seq;
GstBuffer * buffer;
guint seq_num;
};
struct _GstOSXVideoSrcClass
{
GstPushSrcClass parent_class;
gboolean movies_enabled;
};
GType gst_osx_video_src_get_type (void);
G_END_DECLS
#endif /* __GST_OSX_VIDEO_SRC_H__ */