Commit 3a7a2501 authored by Justin Kim's avatar Justin Kim

ahc2src: Add support android camera2ndk

Since Android Nougat, Android NDK provides Camera 2 APIs
so no JNI wrappers are required to implement ahc2src.
parent c2d34d1e
......@@ -1789,6 +1789,13 @@ AG_GST_CHECK_FEATURE(ANDROID_MEDIA, [Android Media], androidmedia, [
esac
])
dnl *** Android Camera2 NDK ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ANDROID_CAMERA2_NDK, true)
HAVE_ANDROID_CAMERA2_NDK="no"
AG_GST_CHECK_FEATURE(ANDROID_CAMERA2_NDK, [Android Camera2 NDK], androidcamera2ndk, [
AC_CHECK_HEADER(camera/NdkCameraDevice.h, HAVE_ANDROID_CAMERA2_NDK="yes", HAVE_ANDROID_CAMERA2_NDK="no")
])
dnl *** AppleMedia (OS X and iOS) ***
translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
HAVE_APPLE_MEDIA="no"
......
plugin_LTLIBRARIES = libgstandroidmedia.la
plugin_LTLIBRARIES = libgstandroidmedia.la \
if USE_ANDROID_CAMERA2_NDK
libgstandroidcamera2ndk.la \
endif
$(NULL)
libgstandroidmedia_la_SOURCES = \
gstahcsrc.c \
......@@ -16,6 +20,7 @@ libgstandroidmedia_la_SOURCES = \
noinst_HEADERS = \
gstahcsrc.h \
gstahc2src.h \
gstahssrc.h \
gstamcaudiodec.h \
gstamc-constants.h \
......@@ -49,8 +54,40 @@ libgstandroidmedia_la_LIBADD = \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(ORC_LIBS)
libgstandroidmedia_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstandroidmediandk_la_SOURCES = \
gstahc2src.c \
$(NULL)
libgstandroidmediandk_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(ORC_CFLAGS) \
-DGST_USE_UNSTABLE_API \
$(NULL)
if USE_ANDROID_CAMERA2_NDK
libgstandroidcamera2ndk_la_LIBADD = \
$(top_builddir)/gst-libs/gst/interfaces/libgstphotography-$(GST_API_VERSION).la \
$(GST_PLUGINS_BASE_LIBS) \
-lgstaudio-@GST_API_VERSION@ \
-lgstpbutils-@GST_API_VERSION@ \
-lgstvideo-@GST_API_VERSION@ \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(ORC_LIBS) \
-lcamera2ndk \
-lmediandk \
$(NULL)
libgstandroidcamera2ndk = $(GST_PLUGIN_LDFLAGS)
endif
androidmedia_java_classesdir = $(datadir)/gst-android/ndk-build/androidmedia/
androidmedia_java_classes_DATA = \
org/freedesktop/gstreamer/androidmedia/GstAhcCallback.java \
......
This diff is collapsed.
/* GStreamer android.hardware.Camera2 Source
* Copyright (C) 2017, Collabora Ltd.
* Author:Justin Kim <justin.kim@collabora.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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_AHC2_SRC_H__
#define __GST_AHC2_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
G_BEGIN_DECLS
#define GST_TYPE_AHC2_SRC (gst_ahc2_src_get_type ())
#define GST_IS_AHC2_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AHC2_SRC))
#define GST_IS_AHC2_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AHC2_SRC))
#define GST_AHC2_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AHC2_SRC, GstAHC2SrcClass))
#define GST_AHC2_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AHC2_SRC, GstAHC2Src))
#define GST_AHC2_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_AHC2_SRC, GstAHC2SrcClass))
#define GST_AHC2_SRC_CAST(obj) ((GstAHC2Src*)(obj))
#define GST_AHC2_SRC_CLASS_CAST(klass) ((GstAHC2SrcClass*)(klass))
typedef struct _GstAHC2Src GstAHC2Src;
typedef struct _GstAHC2SrcClass GstAHC2SrcClass;
typedef struct _GstAHC2SrcPrivate GstAHC2SrcPrivate;
struct _GstAHC2Src {
GstPushSrc parent;
};
struct _GstAHC2SrcClass {
GstPushSrcClass parent_class;
/* actions */
gint (*get_camera_count) (GstAHC2Src *self);
const gchar* (*get_camera_id_by_index) (GstAHC2Src *self, gint idx);
gpointer _gst_reserved[GST_PADDING_LARGE];
};
GST_EXPORT
GType gst_ahc2_src_get_type (void);
G_END_DECLS
#endif /* __GST_AHC2_SRC_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