Commit 385bba64 authored by Edward Hervey's avatar Edward Hervey 🤘

configure.ac: Check for an Objective C compiler

Original commit message from CVS:
* configure.ac:
Check for an Objective C compiler
* sys/Makefile.am:
* sys/osxvideo/Makefile.am:
* sys/osxvideo/cocoawindow.h:
* sys/osxvideo/cocoawindow.m:
* sys/osxvideo/osxvideosink.h:
* sys/osxvideo/osxvideosink.m:
Port of osxvideo plugin to 0.10. Do NOT consider 100% stable !
Fixes #402470
parent 3838fe02
2007-01-30 Edward Hervey <edward@fluendo.com>
* configure.ac:
Check for an Objective C compiler
* sys/Makefile.am:
* sys/osxvideo/Makefile.am:
* sys/osxvideo/cocoawindow.h:
* sys/osxvideo/cocoawindow.m:
* sys/osxvideo/osxvideosink.h:
* sys/osxvideo/osxvideosink.m:
Port of osxvideo plugin to 0.10. Do NOT consider 100% stable !
Fixes #402470
2007-01-28 Tim-Philipp Müller <tim at centricular dot net>
* gst/videocrop/gstvideocrop.c:
......
......@@ -131,6 +131,8 @@ AC_PROG_CXX
dnl determine if c++ is available on this system
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
AS_PROG_OBJC
AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
......@@ -360,6 +362,24 @@ int main ()
AC_SUBST(HAVE_DIRECTSOUND)
])
dnl *** OS X video ***
translit(dnm, m, l) AM_CONDITIONAL(USE_OSX_VIDEO, true)
HAVE_OSX_VIDEO="no"
GST_CHECK_FEATURE(OSX_VIDEO, [OSX video], osxvideosink, [
AC_CHECK_HEADER(OpenGL/gl.h, HAVE_OSX_VIDEO="yes", HAVE_OSX_VIDEO="no")
])
dnl in case header OpenGL/gl.h is found on other platforms
case "$host" in
*-*darwin*)
dnl do nothing
;;
*)
HAVE_OSX_VIDEO="no"
;;
esac
dnl *** ext plug-ins ***
dnl keep this list sorted alphabetically !
......@@ -961,6 +981,7 @@ sys/glsink/Makefile
sys/dvb/Makefile
sys/directdraw/Makefile
sys/directsound/Makefile
sys/osxvideo/Makefile
examples/Makefile
examples/directfb/Makefile
ext/amrwb/Makefile
......
......@@ -46,6 +46,12 @@ else
DIRECTSOUND_DIR=
endif
SUBDIRS = $(GL_DIR) $(DVB_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR)
if USE_OSX_VIDEO
OSX_VIDEO_DIR=osxvideo
else
OSX_VIDEO_DIR=
endif
SUBDIRS = $(GL_DIR) $(DVB_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR) $(OSX_VIDEO_DIR)
DIST_SUBDIRS = glsink dvb directdraw directsound
DIST_SUBDIRS = glsink dvb directdraw directsound osxvideo
# FIXME: clean up this crap
OBJC=gcc
plugin_LTLIBRARIES = libgstosxvideosink.la
libgstosxvideosink_la_SOURCES = osxvideosink.m cocoawindow.m
libgstosxvideosink_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS)
libgstosxvideosink_la_LIBADD = \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR)
libgstosxvideosink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,QuickTime -Wl,-framework -Wl,OpenGL
AM_OBJCFLAGS=$(CFLAGS) $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS)
noinst_HEADERS = osxvideosink.h cocoawindow.h
/* GStreamer
* Copyright (C) 2004 Zaheer Abbas Merali <zaheerabbas at merali dot org>
*
* 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.
*/
/* inspiration gained from looking at source of osx video out of xine and vlc
* and is reflected in the code
*/
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <glib.h>
struct _GstOSXImage;
@interface GstGLView : NSOpenGLView
{
int i_effect;
unsigned long pi_texture;
float f_x;
float f_y;
int initDone;
char* data;
int width, height;
BOOL fullscreen;
NSOpenGLContext* fullScreenContext;
}
- (void) drawQuad;
- (void) drawRect: (NSRect) rect;
- (id) initWithFrame: (NSRect) frame;
- (void) initTextures;
- (void) reloadTexture;
- (void) cleanUp;
- (void) displayTexture;
- (char*) getTextureBuffer;
- (void) setFullScreen: (BOOL) flag;
- (void) reshape;
- (void) setVideoSize: (int) w: (int) h;
@end
@interface GstView : NSQuickDrawView {
int width, height;
gboolean isPortSet;
void* port;
/* Quicktime Sequence */
ImageSequence qtseqid;
ImageDescriptionHandle imgdesc;
struct _GstOSXImage* curimg;
}
- (void) drawRect: (NSRect) rect;
- (id) initWithFrame: (NSRect) frame;
- (void) setVideoSize: (int) w: (int) h;
- (void) setVideoImage: (GstBuffer*) img;
@end
@interface GstOSXVideoSinkWindow: NSWindow {
int width, height;
GstGLView *gstview;
}
- (void) setContentSize: (NSSize) size;
- (GstGLView *) gstView;
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)aScreen;
@end
This diff is collapsed.
/* GStreamer
* Copyright (C) 2004-6 Zaheer Abbas Merali <zaheerabbas at merali dot org>
*
* 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_SINK_H__
#define __GST_OSX_VIDEO_SINK_H__
#include <gst/video/gstvideosink.h>
#include <string.h>
#include <math.h>
#include <Cocoa/Cocoa.h>
#include <QuickTime/QuickTime.h>
#import "cocoawindow.h"
GST_DEBUG_CATEGORY_EXTERN (gst_debug_osx_video_sink);
#define GST_CAT_DEFAULT gst_debug_osx_video_sink
G_BEGIN_DECLS
#define GST_TYPE_OSX_VIDEO_SINK \
(gst_osx_video_sink_get_type())
#define GST_OSX_VIDEO_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_OSX_VIDEO_SINK, GstOSXVideoSink))
#define GST_OSX_VIDEO_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_OSX_VIDEO_SINK, GstOSXVideoSinkClass))
#define GST_IS_OSX_VIDEO_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_OSX_VIDEO_SINK))
#define GST_IS_OSX_VIDEO_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_OSX_VIDEO_SINK))
typedef struct _GstOSXWindow GstOSXWindow;
typedef struct _GstOSXVideoSink GstOSXVideoSink;
typedef struct _GstOSXVideoSinkClass GstOSXVideoSinkClass;
#define GST_TYPE_OSXVIDEOBUFFER (gst_osxvideobuffer_get_type())
#define GST_IS_OSXVIDEOBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_OSXVIDEOBUFFER))
#define GST_OSXVIDEOBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_OSXVIDEOBUFFER, GstOSXVideoBuffer))
typedef struct _GstOSXVideoBuffer GstOSXVideoBuffer;
struct _GstOSXVideoBuffer {
GstBuffer buffer; /* We extend GstBuffer */
CVOpenGLTextureRef texture;
gint width;
gint height;
gboolean locked;
GstOSXVideoSink *osxvideosink;
};
/* OSXWindow stuff */
struct _GstOSXWindow {
gint width, height;
gboolean internal;
GstOSXVideoSinkWindow* win;
GstGLView* gstview;
};
struct _GstOSXVideoSink {
/* Our element stuff */
GstVideoSink videosink;
GMutex *pool_lock;
GSList *buffer_pool;
GstOSXWindow *osxwindow;
gint fps_n;
gint fps_d;
/* Unused */
gint pixel_width, pixel_height;
GstClockTime time;
gboolean embed;
gboolean fullscreen;
gboolean sw_scaling_failed;
};
struct _GstOSXVideoSinkClass {
GstVideoSinkClass parent_class;
};
GType gst_osx_video_sink_get_type(void);
G_END_DECLS
#endif /* __GST_OSX_VIDEO_SINK_H__ */
This diff is collapsed.
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