[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:gst-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfishos/gst-droid.git</param>
<param name="branch">master</param>
- <param name="revision">81cfa81e70a7c873a8fa5ac3593b10a79c42944f</param>
+ <param name="revision">HEAD</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/gst/droidcodec/gstdroidcodec.c
^
|
@@ -1,1082 +0,0 @@
-/*
- * gst-droid
- *
- * Copyright (C) 2014-2015 Mohammed Sameer <msameer@foolab.org>
- * Copyright (C) 2015 Jolla LTD.
- *
- * This library 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.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "gstdroidcodec.h"
-#include "plugin.h"
-#include <glib.h>
-#include <gst/base/gstbytewriter.h>
-#ifndef GST_USE_UNSTABLE_API
-#define GST_USE_UNSTABLE_API
-#endif /* GST_USE_UNSTABLE_API */
-#include <gst/codecparsers/gsth264parser.h>
-
-GST_DEBUG_CATEGORY_EXTERN (gst_droid_codec_debug);
-#define GST_CAT_DEFAULT gst_droid_codec_debug
-
-static GstBuffer *create_mpeg4venc_codec_data (DroidMediaData * data);
-static GstBuffer *create_h264enc_codec_data (DroidMediaData * data);
-static gboolean create_mpeg4vdec_codec_data_from_codec_data (GstDroidCodec *
- codec, GstBuffer * data, DroidMediaData * out);
-static gboolean create_h264dec_codec_data_from_codec_data (GstDroidCodec *
- codec, GstBuffer * data, DroidMediaData * out);
-static gboolean create_aacdec_codec_data_from_codec_data (GstDroidCodec * codec,
- GstBuffer * data, DroidMediaData * out);
-static gboolean create_aacdec_codec_data_from_frame_data (GstDroidCodec * codec,
- GstBuffer * frame_data, DroidMediaData * out);
-static gboolean process_h264dec_data (GstDroidCodec * codec, GstBuffer * buffer,
- DroidMediaData * out);
-static gboolean process_aacdec_data (GstDroidCodec * codec, GstBuffer * buffer,
- DroidMediaData * out);
-static gboolean is_mpeg4v (GstDroidCodec * codec, const GstStructure * s);
-static gboolean is_mpega (GstDroidCodec * codec, const GstStructure * s);
-static gboolean is_mp3 (GstDroidCodec * codec, const GstStructure * s);
-static gboolean is_h264_dec (GstDroidCodec * codec, const GstStructure * s);
-static gboolean is_h264_enc (GstDroidCodec * codec, const GstStructure * s);
-static void h264enc_complement (GstCaps * caps);
-static gboolean process_h264enc_data (DroidMediaData * in,
- DroidMediaData * out);
-static void gst_droid_codec_release_input_frame (void *data);
-static void gst_droid_codec_free (GstDroidCodec * codec);
-static void gst_droid_codec_type_fill_quirks (GstDroidCodec * codec);
-
-GST_DEFINE_MINI_OBJECT_TYPE (GstDroidCodec, gst_droid_codec);
-
-typedef struct
-{
- gpointer data;
- GstVideoCodecFrame *frame;
-} GstDroidCodecFrameReleaseData;
-
-struct _GstDroidCodecPrivate
-{
- guint h264_nal;
- gboolean aac_adts;
-};
-
-struct _GstDroidCodecInfo
-{
- GstDroidCodecType type;
- const gchar *mime;
- const gchar *droid;
- const gchar *caps;
-
- gboolean (*validate_structure) (GstDroidCodec * codec,
- const GstStructure * s);
- void (*complement_caps) (GstCaps * caps);
- GstBuffer *(*create_encoder_codec_data) (DroidMediaData * data);
- gboolean (*process_encoder_data) (DroidMediaData * in,
- DroidMediaData * out);
- gboolean (*create_decoder_codec_data_from_codec_data) (GstDroidCodec *
- codec, GstBuffer * codec_data, DroidMediaData * out);
- gboolean (*create_decoder_codec_data_from_frame_data) (GstDroidCodec *
- codec, GstBuffer * frame_data, DroidMediaData * out);
- gboolean (*process_decoder_data) (GstDroidCodec * codec, GstBuffer * buffer,
- DroidMediaData * out);
-};
-
-/* codecs */
-#define CAPS_FRAGMENT_AUDIO_ENCODER \
- " , channels = (int) [1, 2]"
-
-static GstDroidCodecInfo codecs[] = {
- /* audio decoders */
- {GST_DROID_CODEC_DECODER_AUDIO, "audio/mpeg", "audio/mp4a-latm",
- "audio/mpeg, mpegversion=(int){2, 4}, stream-format=(string){raw, adts}",
- is_mpega, NULL, NULL, NULL, create_aacdec_codec_data_from_codec_data,
- create_aacdec_codec_data_from_frame_data, process_aacdec_data},
-
- {GST_DROID_CODEC_DECODER_AUDIO, "audio/mpeg", "audio/mpeg",
- "audio/mpeg, mpegversion=(int)1, layer=[1, 3]",
- is_mp3, NULL, NULL, NULL, NULL, NULL, NULL},
-
- /* video decoders */
- {GST_DROID_CODEC_DECODER_VIDEO, "video/mpeg", "video/mp4v-es",
- "video/mpeg, mpegversion=4",
- is_mpeg4v, NULL, NULL, NULL,
- create_mpeg4vdec_codec_data_from_codec_data, NULL, NULL},
-
- {GST_DROID_CODEC_DECODER_VIDEO, "video/x-h264", "video/avc",
- "video/x-h264, stream-format=avc,alignment=au",
- is_h264_dec, NULL, NULL, NULL,
- create_h264dec_codec_data_from_codec_data, NULL, process_h264dec_data},
-
- {GST_DROID_CODEC_DECODER_VIDEO, "video/x-h263", "video/3gpp",
- "video/x-h263", NULL,
- NULL, NULL, NULL, NULL, NULL, NULL},
-
- /* audio encoders */
- {GST_DROID_CODEC_ENCODER_AUDIO, "audio/mpeg", "audio/mp4a-latm",
- "audio/mpeg, mpegversion=(int)4, stream-format=(string){raw}"
- CAPS_FRAGMENT_AUDIO_ENCODER,
- is_mpeg4v, NULL, create_mpeg4venc_codec_data, NULL, NULL, NULL, NULL},
-
- /* video encoders */
- {GST_DROID_CODEC_ENCODER_VIDEO, "video/mpeg", "video/mp4v-es",
- "video/mpeg, mpegversion=4, systemstream=false",
- is_mpeg4v, NULL, create_mpeg4venc_codec_data, NULL, NULL, NULL, NULL},
-
- {GST_DROID_CODEC_ENCODER_VIDEO, "video/x-h264", "video/avc",
- "video/x-h264, stream-format=avc,alignment=au",
- is_h264_enc, h264enc_complement, create_h264enc_codec_data,
- process_h264enc_data, NULL, NULL, NULL},
-};
-
-GstDroidCodec *
-gst_droid_codec_new_from_caps (GstCaps * caps, GstDroidCodecType type)
-{
- int x = 0;
- int len = G_N_ELEMENTS (codecs);
- GstStructure *s = gst_caps_get_structure (caps, 0);
- const gchar *name = gst_structure_get_name (s);
- GstDroidCodec *codec = g_slice_new (GstDroidCodec);
- codec->data = g_slice_new0 (GstDroidCodecPrivate);
-
- for (x = 0; x < len; x++) {
- if (codecs[x].type != type) {
- continue;
- }
-
- gboolean is_equal = g_strcmp0 (codecs[x].mime, name) == 0;
- if (!is_equal) {
- continue;
- }
-
- if (!codecs[x].validate_structure
- || codecs[x].validate_structure (codec, s)) {
- gst_mini_object_init (GST_MINI_OBJECT_CAST (codec), 0,
- gst_droid_codec_get_type (), NULL, NULL,
- (GstMiniObjectFreeFunction) gst_droid_codec_free);
-
- codec->info = &codecs[x];
-
- /* Fill codec quirks */
- gst_droid_codec_type_fill_quirks (codec);
-
- return codec;
- }
- }
-
- gst_droid_codec_free (codec);
-
- return NULL;
-}
-
-GstCaps *
-gst_droid_codec_get_all_caps (GstDroidCodecType type)
-{
- GstCaps *caps = gst_caps_new_empty ();
- int x = 0;
- int len = G_N_ELEMENTS (codecs);
- GKeyFile *file = g_key_file_new ();
- gchar *path = g_strdup_printf ("%s/gst-droid/gstdroidcodec.conf", SYSCONFDIR);
- gchar *group = type == GST_DROID_CODEC_DECODER_AUDIO
- || type == GST_DROID_CODEC_DECODER_VIDEO ? "decoders" : "encoders";
-
- g_key_file_load_from_file (file, path, G_KEY_FILE_NONE, NULL);
- g_free (path);
-
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/gst/droidcodec/gstdroidcodec.h
^
|
@@ -1,106 +0,0 @@
-/*
- * gst-droid
- *
- * Copyright (C) 2014-2015 Mohammed Sameer <msameer@foolab.org>
- * Copyright (C) 2015 Jolla LTD.
- *
- * This library 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.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __GST_DROID_CODEC_H__
-#define __GST_DROID_CODEC_H__
-
-#include <gst/gst.h>
-#include <gst/video/video.h>
-#include "droidmediacodec.h"
-
-G_BEGIN_DECLS
-
-/* quirks */
-#define USE_CODEC_SUPPLIED_HEIGHT_NAME "use-codec-supplied-height"
-#define USE_CODEC_SUPPLIED_HEIGHT_VALUE 0x1
-
-#define USE_CODEC_SUPPLIED_WIDTH_NAME "use-codec-supplied-width"
-#define USE_CODEC_SUPPLIED_WIDTH_VALUE 0x2
-
-typedef struct _GstDroidCodec GstDroidCodec;
-typedef struct _GstDroidCodecInfo GstDroidCodecInfo;
-typedef struct _GstDroidCodecPrivate GstDroidCodecPrivate;
-typedef enum _GstDroidCodecType GstDroidCodecType;
-typedef enum _GstDroidCodecCodecDataResult GstDroidCodecCodecDataResult;
-
-enum _GstDroidCodecType
-{
- GST_DROID_CODEC_DECODER_AUDIO,
- GST_DROID_CODEC_ENCODER_AUDIO,
- GST_DROID_CODEC_DECODER_VIDEO,
- GST_DROID_CODEC_ENCODER_VIDEO,
-};
-
-enum _GstDroidCodecCodecDataResult
-{
- GST_DROID_CODEC_CODEC_DATA_OK,
- GST_DROID_CODEC_CODEC_DATA_NOT_NEEDED,
- GST_DROID_CODEC_CODEC_DATA_ERROR,
-};
-
-struct _GstDroidCodec {
- GstMiniObject parent;
-
- GstDroidCodecInfo *info;
-
- GstDroidCodecPrivate *data;
-
- gint quirks;
-};
-
-GType gst_droid_codec_get_type (void);
-
-static inline GstDroidCodec *gst_droid_codec_ref (GstDroidCodec * codec)
-{
- return (GstDroidCodec *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (codec));
-}
-
-static inline void gst_droid_codec_unref (GstDroidCodec * codec)
-{
- gst_mini_object_unref (GST_MINI_OBJECT_CAST (codec));
-}
-
-GstDroidCodec *gst_droid_codec_new_from_caps (GstCaps * caps, GstDroidCodecType type);
-
-GstCaps *gst_droid_codec_get_all_caps (GstDroidCodecType type);
-const gchar *gst_droid_codec_get_droid_type (GstDroidCodec * codec);
-
-void gst_droid_codec_complement_caps (GstDroidCodec *codec, GstCaps * caps);
-GstBuffer *gst_droid_codec_create_encoder_codec_data (GstDroidCodec *codec, DroidMediaData *data);
-
-GstDroidCodecCodecDataResult gst_droid_codec_create_decoder_codec_data (GstDroidCodec *codec,
- GstBuffer *data,
- DroidMediaData *out,
- GstBuffer *frame_data);
-
-gboolean gst_droid_codec_prepare_decoder_frame (GstDroidCodec * codec, GstVideoCodecFrame * frame,
- DroidMediaData * data,
- DroidMediaBufferCallbacks *cb);
-
-GstBuffer *gst_droid_codec_prepare_encoded_data (GstDroidCodec * codec, DroidMediaData * in);
-
-gboolean gst_droid_codec_process_decoder_data (GstDroidCodec * codec, GstBuffer * buffer,
- DroidMediaData * out);
-gint gst_droid_codec_get_samples_per_frane (GstCaps * caps);
-
-G_END_DECLS
-
-#endif /* __GST_DROID_CODEC_H__ */
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/m4/libtool.m4
^
|
@@ -1,7983 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/m4/ltoptions.m4
^
|
@@ -1,384 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/m4/ltsugar.m4
^
|
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/m4/ltversion.m4
^
|
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20160303.0.tar.gz/m4/lt~obsolete.m4
^
|
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/.gitmodules
^
|
@@ -1,3 +1,3 @@
[submodule "common"]
path = common
- url = git://anongit.freedesktop.org/gstreamer/common
+ url = https://git.merproject.org/mirror/gstreamer-common.git
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/Makefile.am
^
|
@@ -1,3 +1,8 @@
SUBDIRS = common gst-libs gst tools
-EXTRA_DIST = autogen.sh
+EXTRA_DIST = autogen.sh \
+ gstreamer-droid-1.0.pc.in \
+ gstreamer-droid-1.0.pc
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gstreamer-droid-1.0.pc
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/configure.ac
^
|
@@ -167,6 +167,7 @@
[GStreamer API Version])
AC_CONFIG_FILES([Makefile
+ gstreamer-droid-1.0.pc
common/Makefile
common/m4/Makefile
gst-libs/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst-libs/gst/droid/Makefile.am
^
|
@@ -1,3 +1,4 @@
+AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\"
lib_LTLIBRARIES = libgstdroid-@GST_API_VERSION@.la
libgstdroid_@GST_API_VERSION@_ladir = $(libdir)
@@ -15,10 +16,12 @@
gstdroidmediabuffer.c \
gstdroidbufferpool.c \
gstdroidquery.c \
+ gstdroidcodec.c \
/usr/share/droidmedia/hybris.c
libgstdroid_@GST_API_VERSION@_la_include_HEADERS = \
gstwrappedmemory.h \
gstdroidmediabuffer.h \
gstdroidbufferpool.h \
- gstdroidquery.h
+ gstdroidquery.h \
+ gstdroidcodec.h
\ No newline at end of file
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.c
^
|
@@ -0,0 +1,1126 @@
+/*
+ * gst-droid
+ *
+ * Copyright (C) 2014-2015 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2015 Jolla LTD.
+ *
+ * This library 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.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "gstdroidcodec.h"
+#include <glib.h>
+#include <gst/base/gstbytewriter.h>
+#ifndef GST_USE_UNSTABLE_API
+#define GST_USE_UNSTABLE_API
+#endif /* GST_USE_UNSTABLE_API */
+#include <gst/codecparsers/gsth264parser.h>
+
+GST_DEBUG_CATEGORY (gst_droid_codec_debug);
+#define GST_CAT_DEFAULT gst_droid_codec_debug
+
+static GstBuffer *create_mpeg4venc_codec_data (DroidMediaData * data);
+static GstBuffer *create_h264enc_codec_data (DroidMediaData * data);
+static gboolean create_mpeg4vdec_codec_data_from_codec_data (GstDroidCodec *
+ codec, GstBuffer * data, DroidMediaData * out);
+static gboolean create_h264dec_codec_data_from_codec_data (GstDroidCodec *
+ codec, GstBuffer * data, DroidMediaData * out);
+static gboolean create_vp8vdec_codec_data_from_codec_data (GstDroidCodec *
+ codec, GstBuffer * data, DroidMediaData * out);
+static gboolean create_aacdec_codec_data_from_codec_data (GstDroidCodec * codec,
+ GstBuffer * data, DroidMediaData * out);
+static gboolean create_aacdec_codec_data_from_frame_data (GstDroidCodec * codec,
+ GstBuffer * frame_data, DroidMediaData * out);
+static gboolean process_h264dec_data (GstDroidCodec * codec, GstBuffer * buffer,
+ DroidMediaData * out);
+static gboolean process_aacdec_data (GstDroidCodec * codec, GstBuffer * buffer,
+ DroidMediaData * out);
+static gboolean is_mpeg4v (GstDroidCodec * codec, const GstStructure * s);
+static gboolean is_mpega (GstDroidCodec * codec, const GstStructure * s);
+static gboolean is_mp3 (GstDroidCodec * codec, const GstStructure * s);
+static gboolean is_h264_dec (GstDroidCodec * codec, const GstStructure * s);
+static gboolean is_h264_enc (GstDroidCodec * codec, const GstStructure * s);
+static void h264enc_complement (GstCaps * caps);
+static gboolean process_h264enc_data (DroidMediaData * in,
+ DroidMediaData * out);
+static void gst_droid_codec_release_input_frame (void *data);
+static void gst_droid_codec_free (GstDroidCodec * codec);
+static void gst_droid_codec_type_fill_quirks (GstDroidCodec * codec);
+
+GST_DEFINE_MINI_OBJECT_TYPE (GstDroidCodec, gst_droid_codec);
+
+typedef struct
+{
+ gpointer data;
+} GstDroidCodecFrameReleaseData;
+
+struct _GstDroidCodecPrivate
+{
+ guint h264_nal;
+ gboolean aac_adts;
+};
+
+struct _GstDroidCodecInfo
+{
+ GstDroidCodecType type;
+ const gchar *mime;
+ const gchar *droid;
+ const gchar *caps;
+ gboolean enabled;
+
+ gboolean (*validate_structure) (GstDroidCodec * codec,
+ const GstStructure * s);
+ void (*complement_caps) (GstCaps * caps);
+ GstBuffer *(*create_encoder_codec_data) (DroidMediaData * data);
+ gboolean (*process_encoder_data) (DroidMediaData * in,
+ DroidMediaData * out);
+ gboolean (*create_decoder_codec_data_from_codec_data) (GstDroidCodec *
+ codec, GstBuffer * codec_data, DroidMediaData * out);
+ gboolean (*create_decoder_codec_data_from_frame_data) (GstDroidCodec *
+ codec, GstBuffer * frame_data, DroidMediaData * out);
+ gboolean (*process_decoder_data) (GstDroidCodec * codec, GstBuffer * buffer,
+ DroidMediaData * out);
+};
+
+/* codecs */
+#define CAPS_FRAGMENT_AUDIO_ENCODER \
+ " , channels = (int) [1, 2]"
+
+static GstDroidCodecInfo codecs[] = {
+ /* audio decoders */
+ {GST_DROID_CODEC_DECODER_AUDIO, "audio/mpeg", "audio/mp4a-latm",
+ "audio/mpeg, mpegversion=(int){2, 4}, stream-format=(string){raw, adts}",
+ TRUE,
+ is_mpega, NULL, NULL, NULL, create_aacdec_codec_data_from_codec_data,
+ create_aacdec_codec_data_from_frame_data, process_aacdec_data},
+
+ {GST_DROID_CODEC_DECODER_AUDIO, "audio/mpeg", "audio/mpeg",
+ "audio/mpeg, mpegversion=(int)1, layer=[1, 3]", TRUE,
+ is_mp3, NULL, NULL, NULL, NULL, NULL, NULL},
+
+ /* video decoders */
+ {GST_DROID_CODEC_DECODER_VIDEO, "video/mpeg", "video/mp4v-es",
+ "video/mpeg, mpegversion=4", TRUE,
+ is_mpeg4v, NULL, NULL, NULL,
+ create_mpeg4vdec_codec_data_from_codec_data, NULL, NULL},
+
+ {GST_DROID_CODEC_DECODER_VIDEO, "video/x-h264", "video/avc",
+ "video/x-h264, stream-format=avc,alignment=au", TRUE,
+ is_h264_dec, NULL, NULL, NULL,
+ create_h264dec_codec_data_from_codec_data, NULL, process_h264dec_data},
+
+ {GST_DROID_CODEC_DECODER_VIDEO, "video/x-h263", "video/3gpp",
+ "video/x-h263", TRUE, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL},
+
+ {GST_DROID_CODEC_DECODER_VIDEO, "video/x-vp8", "video/x-vnd.on2.vp8",
+ "video/x-vp8", TRUE, NULL, NULL, NULL, NULL,
+ create_vp8vdec_codec_data_from_codec_data, NULL, NULL},
+
+ /* audio encoders */
+ {GST_DROID_CODEC_ENCODER_AUDIO, "audio/mpeg", "audio/mp4a-latm",
+ "audio/mpeg, mpegversion=(int)4, stream-format=(string){raw}"
+ CAPS_FRAGMENT_AUDIO_ENCODER, TRUE,
+ is_mpeg4v, NULL, create_mpeg4venc_codec_data, NULL, NULL, NULL, NULL},
+
+ /* video encoders */
+ {GST_DROID_CODEC_ENCODER_VIDEO, "video/mpeg", "video/mp4v-es",
+ "video/mpeg, mpegversion=4, systemstream=false", TRUE,
+ is_mpeg4v, NULL, create_mpeg4venc_codec_data, NULL, NULL, NULL, NULL},
+
+ {GST_DROID_CODEC_ENCODER_VIDEO, "video/x-h264", "video/avc",
+ "video/x-h264, stream-format=avc,alignment=au", TRUE,
+ is_h264_enc, h264enc_complement, create_h264enc_codec_data,
+ process_h264enc_data, NULL, NULL, NULL},
+};
+
+GstDroidCodec *
+gst_droid_codec_new_from_caps (GstCaps * caps, GstDroidCodecType type)
+{
+ int x = 0;
+ int len = G_N_ELEMENTS (codecs);
+ GstStructure *s = gst_caps_get_structure (caps, 0);
+ const gchar *name = gst_structure_get_name (s);
+ GstDroidCodec *codec = g_slice_new (GstDroidCodec);
+ codec->data = g_slice_new0 (GstDroidCodecPrivate);
+
+ for (x = 0; x < len; x++) {
+ if (codecs[x].type != type) {
+ continue;
+ }
+
+ gboolean is_equal = g_strcmp0 (codecs[x].mime, name) == 0;
+ if (!is_equal) {
+ continue;
+ }
+
+ if (!codecs[x].validate_structure
+ || codecs[x].validate_structure (codec, s)) {
+ gst_mini_object_init (GST_MINI_OBJECT_CAST (codec), 0,
+ gst_droid_codec_get_type (), NULL, NULL,
+ (GstMiniObjectFreeFunction) gst_droid_codec_free);
+
+ codec->info = &codecs[x];
+
+ /* Fill codec quirks */
+ gst_droid_codec_type_fill_quirks (codec);
+
+ return codec;
+ }
+ }
+
+ gst_droid_codec_free (codec);
+
+ return NULL;
+}
+
+GstCaps *
+gst_droid_codec_get_all_caps (GstDroidCodecType type)
+{
+ GstCaps *caps = gst_caps_new_empty ();
+ int x = 0;
+ int len = G_N_ELEMENTS (codecs);
+ GKeyFile *file = g_key_file_new ();
+ gchar *path = g_strdup_printf ("%s/gst-droid/gstdroidcodec.conf", SYSCONFDIR);
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.h
^
|
@@ -0,0 +1,109 @@
+/*
+ * gst-droid
+ *
+ * Copyright (C) 2014-2015 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2015 Jolla LTD.
+ *
+ * This library 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.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __GST_DROID_CODEC_H__
+#define __GST_DROID_CODEC_H__
+
+#include <gst/gst.h>
+#include <gst/video/video.h>
+#include "droidmediacodec.h"
+
+G_BEGIN_DECLS
+
+/* quirks */
+#define USE_CODEC_SUPPLIED_HEIGHT_NAME "use-codec-supplied-height"
+#define USE_CODEC_SUPPLIED_HEIGHT_VALUE 0x1
+
+#define USE_CODEC_SUPPLIED_WIDTH_NAME "use-codec-supplied-width"
+#define USE_CODEC_SUPPLIED_WIDTH_VALUE 0x2
+
+#define DONT_USE_DROID_CONVERT_NAME "dont-use-droid-convert"
+#define DONT_USE_DROID_CONVERT_VALUE 0x4
+
+typedef struct _GstDroidCodec GstDroidCodec;
+typedef struct _GstDroidCodecInfo GstDroidCodecInfo;
+typedef struct _GstDroidCodecPrivate GstDroidCodecPrivate;
+typedef enum _GstDroidCodecType GstDroidCodecType;
+typedef enum _GstDroidCodecCodecDataResult GstDroidCodecCodecDataResult;
+
+enum _GstDroidCodecType
+{
+ GST_DROID_CODEC_DECODER_AUDIO,
+ GST_DROID_CODEC_ENCODER_AUDIO,
+ GST_DROID_CODEC_DECODER_VIDEO,
+ GST_DROID_CODEC_ENCODER_VIDEO,
+};
+
+enum _GstDroidCodecCodecDataResult
+{
+ GST_DROID_CODEC_CODEC_DATA_OK,
+ GST_DROID_CODEC_CODEC_DATA_NOT_NEEDED,
+ GST_DROID_CODEC_CODEC_DATA_ERROR,
+};
+
+struct _GstDroidCodec {
+ GstMiniObject parent;
+
+ GstDroidCodecInfo *info;
+
+ GstDroidCodecPrivate *data;
+
+ gint quirks;
+};
+
+GType gst_droid_codec_get_type (void);
+
+static inline GstDroidCodec *gst_droid_codec_ref (GstDroidCodec * codec)
+{
+ return (GstDroidCodec *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (codec));
+}
+
+static inline void gst_droid_codec_unref (GstDroidCodec * codec)
+{
+ gst_mini_object_unref (GST_MINI_OBJECT_CAST (codec));
+}
+
+GstDroidCodec *gst_droid_codec_new_from_caps (GstCaps * caps, GstDroidCodecType type);
+
+GstCaps *gst_droid_codec_get_all_caps (GstDroidCodecType type);
+const gchar *gst_droid_codec_get_droid_type (GstDroidCodec * codec);
+
+void gst_droid_codec_complement_caps (GstDroidCodec *codec, GstCaps * caps);
+GstBuffer *gst_droid_codec_create_encoder_codec_data (GstDroidCodec *codec, DroidMediaData *data);
+
+GstDroidCodecCodecDataResult gst_droid_codec_create_decoder_codec_data (GstDroidCodec *codec,
+ GstBuffer *data,
+ DroidMediaData *out,
+ GstBuffer *frame_data);
+
+gboolean gst_droid_codec_prepare_decoder_frame (GstDroidCodec * codec, GstVideoCodecFrame * frame,
+ DroidMediaData * data,
+ DroidMediaBufferCallbacks *cb);
+
+GstBuffer *gst_droid_codec_prepare_encoded_data (GstDroidCodec * codec, DroidMediaData * in);
+
+gboolean gst_droid_codec_process_decoder_data (GstDroidCodec * codec, GstBuffer * buffer,
+ DroidMediaData * out);
+gint gst_droid_codec_get_samples_per_frane (GstCaps * caps);
+
+G_END_DECLS
+
+#endif /* __GST_DROID_CODEC_H__ */
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst-libs/gst/droid/gstdroidmediabuffer.h
^
|
@@ -23,7 +23,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
-#include "droidmedia.h"
+#include <droidmedia/droidmedia.h>
G_BEGIN_DECLS
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/Makefile.am
^
|
@@ -19,7 +19,8 @@
gstdroidcamsrcphotography.c \
gstdroidcamsrcquirks.c \
gstdroidcamsrcexif.c \
- gstdroidcamsrcmode.c
+ gstdroidcamsrcmode.c \
+ gstdroidcamsrcrecorder.c
noinst_HEADERS = \
gstdroidcamsrc.h \
@@ -29,4 +30,5 @@
gstdroidcamsrcphotography.h \
gstdroidcamsrcquirks.h \
gstdroidcamsrcexif.h \
- gstdroidcamsrcmode.h
+ gstdroidcamsrcmode.h \
+ gstdroidcamsrcrecorder.h
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrc.c
^
|
@@ -2,7 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
- * Copyright (C) 2015 Jolla LTD.
+ * Copyright (C) 2015-2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -30,7 +30,9 @@
#include "gst/droid/gstdroidmediabuffer.h"
#include "gst/droid/gstwrappedmemory.h"
#include "gst/droid/gstdroidquery.h"
+#include "gst/droid/gstdroidcodec.h"
#include "gstdroidcamsrcphotography.h"
+#include "gstdroidcamsrcrecorder.h"
#include "droidmediacamera.h"
#ifndef GST_USE_UNSTABLE_API
#define GST_USE_UNSTABLE_API
@@ -59,12 +61,14 @@
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("image/jpeg"));
+#if 0
static GstStaticPadTemplate vid_src_template_factory =
GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME,
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_DROID_VIDEO_META_DATA, "{YV12}")));
+#endif
static gboolean gst_droidcamsrc_pad_activate_mode (GstPad * pad,
GstObject * parent, GstPadMode mode, gboolean active);
@@ -85,6 +89,8 @@
GstCaps * caps);
static gchar *gst_droidcamsrc_find_picture_resolution (GstDroidCamSrc * src,
const gchar * resolution);
+static gboolean gst_droidcamsrc_is_zsl_and_hdr_supported (GstDroidCamSrc * src);
+static GstCaps *gst_droidcamsrc_get_video_caps_locked (GstDroidCamSrc * src);
enum
{
@@ -106,14 +112,17 @@
#define DEFAULT_FACE_DETECTION FALSE
#define DEFAULT_IMAGE_NOISE_REDUCTION TRUE
#define DEFAULT_SENSOR_ORIENTATION 0
+#define DEFAULT_IMAGE_MODE GST_DROIDCAMSRC_IMAGE_MODE_NORMAL
+#define DEFAULT_TARGET_BITRATE 12000000
static GstDroidCamSrcPad *
-gst_droidcamsrc_create_pad (GstDroidCamSrc * src, GstStaticPadTemplate * tpl,
+gst_droidcamsrc_create_pad (GstDroidCamSrc * src,
const gchar * name, gboolean capture_pad)
{
GstDroidCamSrcPad *pad = g_slice_new0 (GstDroidCamSrcPad);
-
- pad->pad = gst_pad_new_from_static_template (tpl, name);
+ GstPadTemplate *tpl =
+ gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (src), name);
+ pad->pad = gst_pad_new_from_template (tpl, name);
/* TODO: I don't think this is needed */
gst_pad_use_fixed_caps (pad->pad);
@@ -164,6 +173,7 @@
src->video_torch = DEFAULT_VIDEO_TORCH;
src->face_detection = DEFAULT_FACE_DETECTION;
src->image_noise_reduction = DEFAULT_IMAGE_NOISE_REDUCTION;
+ src->image_mode = GST_DROIDCAMSRC_IMAGE_MODE_NORMAL;
src->min_ev_compensation = DEFAULT_MIN_EV_COMPENSATION;
src->max_ev_compensation = DEFAULT_MAX_EV_COMPENSATION;
src->ev_step = 0.0f;
@@ -171,19 +181,20 @@
src->height = 0;
src->fps_n = 0;
src->fps_d = 1;
+ src->target_bitrate = DEFAULT_TARGET_BITRATE;
gst_droidcamsrc_photography_init (src, DEFAULT_CAMERA_DEVICE);
src->vfsrc = gst_droidcamsrc_create_pad (src,
- &vf_src_template_factory, GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME, FALSE);
+ GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME, FALSE);
src->vfsrc->negotiate = gst_droidcamsrc_vfsrc_negotiate;
src->imgsrc = gst_droidcamsrc_create_pad (src,
- &img_src_template_factory, GST_BASE_CAMERA_SRC_IMAGE_PAD_NAME, TRUE);
+ GST_BASE_CAMERA_SRC_IMAGE_PAD_NAME, TRUE);
src->imgsrc->negotiate = gst_droidcamsrc_imgsrc_negotiate;
src->vidsrc = gst_droidcamsrc_create_pad (src,
- &vid_src_template_factory, GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME, TRUE);
+ GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME, TRUE);
src->vidsrc->adjust_segment = TRUE;
src->vidsrc->negotiate = gst_droidcamsrc_vidsrc_negotiate;
@@ -200,6 +211,8 @@
GParamSpec * pspec)
{
GstDroidCamSrc *src = GST_DROIDCAMSRC (object);
+ GArray *supported_image_modes = NULL;
+ int mode = DEFAULT_IMAGE_MODE;
if (gst_droidcamsrc_photography_get_property (src, prop_id, value, pspec)) {
return;
@@ -256,6 +269,37 @@
g_value_set_int (value, src->info[src->camera_device].orientation * 90);
break;
+ case PROP_IMAGE_MODE:
+ g_value_set_flags (value, src->image_mode);
+ break;
+
+ case PROP_SUPPORTED_IMAGE_MODES:
+ supported_image_modes = g_array_new (FALSE, FALSE, sizeof (gint));
+ g_array_append_val (supported_image_modes, mode);
+
+ if (gst_droidcamsrc_quirks_get_quirk (src->quirks, "zsl")) {
+ mode = GST_DROIDCAMSRC_IMAGE_MODE_ZSL;
+ g_array_append_val (supported_image_modes, mode);
+ }
+
+ if (gst_droidcamsrc_quirks_get_quirk (src->quirks, "hdr")) {
+ mode = GST_DROIDCAMSRC_IMAGE_MODE_HDR;
+ g_array_append_val (supported_image_modes, mode);
+ }
+
+ if (gst_droidcamsrc_is_zsl_and_hdr_supported (src)) {
+ mode = GST_DROIDCAMSRC_IMAGE_MODE_ZSL;
+ mode |= GST_DROIDCAMSRC_IMAGE_MODE_HDR;
+ g_array_append_val (supported_image_modes, mode);
+ }
+
+ g_value_set_pointer (value, supported_image_modes);
+ break;
+
+ case PROP_TARGET_BITRATE:
+ g_value_set_int (value, src->target_bitrate);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -347,6 +391,15 @@
gst_droidcamsrc_apply_mode_settings (src, SET_AND_APPLY);
break;
+ case PROP_IMAGE_MODE:
+ src->image_mode = g_value_get_flags (value);
+ gst_droidcamsrc_apply_mode_settings (src, SET_AND_APPLY);
+ break;
+
+ case PROP_TARGET_BITRATE:
+ src->target_bitrate = g_value_get_int (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -388,7 +441,11 @@
int x;
for (x = 0; x < MAX_CAMERAS; x++) {
- droid_media_camera_get_info (&info, x);
+ if (droid_media_camera_get_info (&info, x) == false) {
+ GST_WARNING_OBJECT (src, "Cannot get camera info for %d (facing %d)", x,
+ facing);
+ continue;
+ }
if (info.facing == facing) {
target->num = x;
@@ -416,14 +473,15 @@
GST_DEBUG_OBJECT (src, "get hw");
num = droid_media_camera_get_number_of_cameras ();
+ GST_INFO_OBJECT (src, "Found %d cameras", num);
+
if (num < 0) {
GST_ERROR_OBJECT (src, "no camera hardware found");
return FALSE;
}
if (num > MAX_CAMERAS) {
- GST_ERROR_OBJECT (src, "cannot support %d cameras", num);
- return FALSE;
+ GST_WARNING_OBJECT (src, "cannot support %d cameras", num);
}
src->info[0].num = src->info[1].num = -1;
@@ -539,6 +597,10 @@
/* now that we have camera parameters, we can update min and max ev-compensation */
gst_droidcamsrc_update_ev_compensation_bounds (src);
+ /* And we can also detect the supported image modes. In reality the only thing
+ we are unable to detect until this moment is _ZSL_AND_HDR */
+ g_object_notify (G_OBJECT (src), "supported-image-modes");
+
/* Now add the needed orientation tag */
gst_droidcamsrc_add_vfsrc_orientation_tag (src);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrc.h
^
|
@@ -2,6 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -111,6 +112,7 @@
gboolean video_torch;
gboolean face_detection;
gboolean image_noise_reduction;
+ GstDroidCamSrcImageMode image_mode;
GstDroidCamSrcPhotography * photo;
gfloat max_zoom;
@@ -118,6 +120,8 @@
gfloat max_ev_compensation;
gfloat ev_step;
+ gint32 target_bitrate;
+
/* protected with OBJECT_LOCK */
gint width;
gint height;
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcdev.c
^
|
@@ -2,7 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
- * Copyright (C) 2015 Jolla LTD.
+ * Copyright (C) 2015-2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@
#include "gstdroidcamsrcdev.h"
#include <stdlib.h>
#include "gstdroidcamsrc.h"
+#include "gstdroidcamsrcrecorder.h"
#include "gst/droid/gstdroidmediabuffer.h"
#include "gst/droid/gstwrappedmemory.h"
#include "gst/droid/gstdroidbufferpool.h"
@@ -73,6 +74,13 @@
static void
gst_droidcamsrc_dev_prepare_buffer (GstDroidCamSrcDev * dev, GstBuffer * buffer,
DroidMediaRect rect, int width, int height, GstVideoFormat format);
+static gboolean
+gst_droidcamsrc_dev_start_video_recording_recorder_locked (GstDroidCamSrcDev *
+ dev);
+static gboolean
+gst_droidcamsrc_dev_start_video_recording_raw_locked (GstDroidCamSrcDev * dev);
+static void gst_droidcamsrc_dev_queue_video_buffer_locked (GstDroidCamSrcDev *
+ dev, GstBuffer * buffer);
static void
gst_droidcamsrc_dev_shutter_callback (void *user)
@@ -218,14 +226,15 @@
g_cond_signal (&dev->imgsrc->cond);
g_mutex_unlock (&dev->imgsrc->lock);
- /* we need to start restart the preview
+ /* we need to restart the preview but only if we are not in ZSL mode.
* android demands this but GStreamer does not know about it.
*/
- g_rec_mutex_lock (dev->lock);
- dev->running = FALSE;
- g_rec_mutex_unlock (dev->lock);
-
- gst_droidcamsrc_dev_start (dev, TRUE);
+ if (!(src->image_mode & GST_DROIDCAMSRC_IMAGE_MODE_ZSL)) {
+ g_rec_mutex_lock (dev->lock);
+ dev->running = FALSE;
+ g_rec_mutex_unlock (dev->lock);
+ gst_droidcamsrc_dev_start (dev, TRUE);
+ }
g_mutex_lock (&src->capture_lock);
--src->captures;
@@ -308,7 +317,6 @@
GstBuffer *buffer;
GstMemory *mem;
GstDroidCamSrcDevVideoData *mem_data;
- gboolean drop_buffer;
GST_DEBUG_OBJECT (src, "dev video frame callback");
@@ -334,26 +342,12 @@
(GFunc) gst_droidcamsrc_dev_release_recording_frame, mem_data);
gst_buffer_insert_memory (buffer, 0, mem);
- GST_BUFFER_OFFSET (buffer) = dev->vid->video_frames;
- GST_BUFFER_OFFSET_END (buffer) = ++dev->vid->video_frames;
gst_droidcamsrc_timestamp (src, buffer);
- g_rec_mutex_lock (dev->lock);
- ++dev->vid->queued_frames;
- g_rec_mutex_unlock (dev->lock);
-
- drop_buffer = !dev->vid->running;
+ gst_droidcamsrc_dev_queue_video_buffer_locked (dev, buffer);
- if (drop_buffer) {
- GST_INFO_OBJECT (src,
- "dropping buffer because video recording is not running");
- gst_buffer_unref (buffer);
- } else {
- g_mutex_lock (&dev->vidsrc->lock);
- g_queue_push_tail (dev->vidsrc->queue, buffer);
- g_cond_signal (&dev->vidsrc->cond);
- g_mutex_unlock (&dev->vidsrc->lock);
- }
+ g_mutex_unlock (&dev->vid->lock);
+ return;
unlock_and_out:
/* in case stop_video_recording() is waiting for us */
@@ -542,6 +536,9 @@
dev->pool = gst_droid_buffer_pool_new ();
+ dev->use_recorder = FALSE;
+ dev->recorder = gst_droidcamsrc_recorder_create (vidsrc);
+
droid_media_camera_constants_init (&dev->c);
return dev;
@@ -623,6 +620,8 @@
gst_object_unref (dev->pool);
+ gst_droidcamsrc_recorder_destroy (dev->recorder);
+
g_slice_free (GstDroidCamSrcImageCaptureState, dev->img);
g_slice_free (GstDroidCamSrcVideoCaptureState, dev->vid);
g_slice_free (GstDroidCamSrcDev, dev);
@@ -872,18 +871,14 @@
dev->vid->video_frames = 0;
dev->vid->queued_frames = 0;
- /* TODO: get that from caps */
- if (!droid_media_camera_store_meta_data_in_buffers (dev->cam, true)) {
- GST_ELEMENT_ERROR (src, LIBRARY, SETTINGS,
- ("error storing meta data in buffers for video recording"), (NULL));
- goto out;
+ if (dev->use_recorder) {
+ ret = gst_droidcamsrc_dev_start_video_recording_recorder_locked (dev);
+ } else {
+ ret = gst_droidcamsrc_dev_start_video_recording_raw_locked (dev);
}
- if (!droid_media_camera_start_recording (dev->cam)) {
- GST_ELEMENT_ERROR (src, LIBRARY, FAILED, ("error starting video recording"),
- (NULL));
+ if (!ret)
goto out;
- }
ret = TRUE;
@@ -930,21 +925,28 @@
GST_ERROR ("failed to push EOS event");
}
- g_rec_mutex_lock (dev->lock);
+ if (!dev->use_recorder) {
+ g_rec_mutex_lock (dev->lock);
- GST_INFO ("waiting for queued frames %i", dev->vid->queued_frames);
+ GST_INFO ("waiting for queued frames %i", dev->vid->queued_frames);
- while (dev->vid->queued_frames > 0) {
- GST_INFO ("waiting for queued frames to reach 0 from %i",
- dev->vid->queued_frames);
+ while (dev->vid->queued_frames > 0) {
+ GST_INFO ("waiting for queued frames to reach 0 from %i",
+ dev->vid->queued_frames);
+ g_rec_mutex_unlock (dev->lock);
+ usleep (VIDEO_RECORDING_STOP_TIMEOUT);
+ g_rec_mutex_lock (dev->lock);
+ }
+
+ /* TODO: move this unlock() call after we stop recording? */
g_rec_mutex_unlock (dev->lock);
- usleep (VIDEO_RECORDING_STOP_TIMEOUT);
- g_rec_mutex_lock (dev->lock);
}
- g_rec_mutex_unlock (dev->lock);
-
- droid_media_camera_stop_recording (dev->cam);
+ if (dev->use_recorder) {
+ gst_droidcamsrc_recorder_stop (dev->recorder);
+ } else {
+ droid_media_camera_stop_recording (dev->cam);
+ }
gst_buffer_pool_set_flushing (dev->pool, FALSE);
@@ -973,10 +975,17 @@
void
gst_droidcamsrc_dev_update_params_locked (GstDroidCamSrcDev * dev)
{
+ GstDroidCamSrc *src = GST_DROIDCAMSRC (GST_PAD_PARENT (dev->imgsrc->pad));
gchar *params;
params = droid_media_camera_get_parameters (dev->cam);
+ if (!params) {
+ GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
+ ("Failed to read camera parameters"));
+ return;
+ }
+
if (dev->params) {
/* TODO: is this really needed? We might lose some unset params if we do that. */
gst_droidcamsrc_params_reload (dev->params, params);
@@ -1130,3 +1139,86 @@
GST_LOG_OBJECT (src, "preview info: w=%d, h=%d, crop: x=%d, y=%d, w=%d, h=%d",
width, height, crop->x, crop->y, crop->width, crop->height);
}
+
+static gboolean
+gst_droidcamsrc_dev_start_video_recording_recorder_locked (GstDroidCamSrcDev *
+ dev)
+{
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcdev.h
^
|
@@ -2,7 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
- * Copyright (C) 2015 Jolla LTD.
+ * Copyright (C) 2015-2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -34,6 +34,7 @@
typedef struct _GstDroidCamSrcVideoCaptureState GstDroidCamSrcVideoCaptureState;
typedef struct _GstDroidCamSrcCamInfo GstDroidCamSrcCamInfo;
typedef struct _GstDroidCamSrcPad GstDroidCamSrcPad;
+typedef struct _GstDroidCamSrcRecorder GstDroidCamSrcRecorder;
struct _GstDroidCamSrcDev
{
@@ -53,6 +54,9 @@
GstDroidCamSrcVideoCaptureState *vid;
GstBufferPool *pool;
DroidMediaCameraConstants c;
+
+ gboolean use_recorder;
+ GstDroidCamSrcRecorder *recorder;
};
GstDroidCamSrcDev *gst_droidcamsrc_dev_new (GstDroidCamSrcPad *vfsrc,
@@ -88,6 +92,8 @@
gboolean gst_droidcamsrc_dev_is_running (GstDroidCamSrcDev * dev);
+void gst_droidcamsrc_dev_queue_video_buffer (GstDroidCamSrcDev * dev, GstBuffer * buffer);
+
G_END_DECLS
#endif /* __GST_DROIDCAMSRC_DEV_H__ */
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcenums.c
^
|
@@ -2,6 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -41,3 +42,22 @@
}
return gst_droidcamsrc_camera_device_type;
}
+
+GType
+gst_droidcamsrc_image_mode_get_type (void)
+{
+ static GType gst_droidcamsrc_image_mode_type = 0;
+ static GFlagsValue gst_droidcamsrc_image_modes[] = {
+ {GST_DROIDCAMSRC_IMAGE_MODE_NORMAL, "Normal image mode", "normal"},
+ {GST_DROIDCAMSRC_IMAGE_MODE_ZSL, "ZSL image mode", "zsl"},
+ {GST_DROIDCAMSRC_IMAGE_MODE_HDR, "HDR image mode", "hdr"},
+ {0, NULL, NULL},
+ };
+
+ if (G_UNLIKELY (!gst_droidcamsrc_image_mode_type)) {
+ gst_droidcamsrc_image_mode_type =
+ g_flags_register_static ("GstDroidCamSrcImageMode",
+ gst_droidcamsrc_image_modes);
+ }
+ return gst_droidcamsrc_image_mode_type;
+}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcenums.h
^
|
@@ -2,7 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
- * Copyright (C) 2015 Jolla LTD.
+ * Copyright (C) 2015-2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -27,6 +27,7 @@
G_BEGIN_DECLS
#define GST_TYPE_DROIDCAMSRC_CAMERA_DEVICE (gst_droidcamsrc_camera_device_get_type())
+#define GST_TYPE_DROIDCAMSRC_IMAGE_MODE (gst_droidcamsrc_image_mode_get_type())
typedef enum {
GST_DROIDCAMSRC_CAMERA_DEVICE_PRIMARY = 0,
@@ -36,6 +37,15 @@
GType gst_droidcamsrc_camera_device_get_type (void);
typedef enum {
+ GST_DROIDCAMSRC_IMAGE_MODE_NORMAL = 0x0,
+ GST_DROIDCAMSRC_IMAGE_MODE_ZSL = 0x1,
+ GST_DROIDCAMSRC_IMAGE_MODE_HDR = 0x2,
+} GstDroidCamSrcImageMode;
+
+GType gst_droidcamsrc_image_mode_get_type (void);
+GType gst_droidcamsrc_supported_image_modes_get_type (void);
+
+typedef enum {
GST_DROIDCAMSRC_ROI_FOCUS_AREA = 0x1,
GST_DROIDCAMSRC_ROI_METERING_AREA = 0x2,
GST_DROIDCAMSRC_ROI_FACE_AREA = 0x4,
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcparams.c
^
|
@@ -51,6 +51,12 @@
g_strfreev (parts);
}
+gboolean
+gst_droidcamsrc_has_param (GstDroidCamSrcParams * params, const char *key)
+{
+ return g_hash_table_contains (params->params, key);
+}
+
static int
gst_droidcamsrc_params_get_int_locked (GstDroidCamSrcParams * params,
const char *key)
@@ -195,6 +201,8 @@
gst_droidcamsrc_params_fill_fps_range_arrays_locked (params);
params->is_dirty = FALSE;
+ params->has_separate_video_size_values =
+ g_hash_table_lookup (params->params, "video-size-values") != NULL;
}
GstDroidCamSrcParams *
@@ -389,8 +397,14 @@
GstCaps *caps;
g_mutex_lock (¶ms->lock);
- caps = gst_droidcamsrc_params_get_caps_locked (params, "video-size-values",
+
+ gchar *key =
+ params->has_separate_video_size_values ? "video-size-values" :
+ "preview-size-values";
+
+ caps = gst_droidcamsrc_params_get_caps_locked (params, key,
"video/x-raw", GST_CAPS_FEATURE_MEMORY_DROID_VIDEO_META_DATA, "YV12");
+
g_mutex_unlock (¶ms->lock);
return caps;
@@ -477,17 +491,8 @@
gst_caps_unref (c);
- /* the fps we have is valid. We are trying to pick the widest range */
- if (target_min == -1) {
- target_min = min;
- }
-
- if (target_max == -1) {
- target_max = max;
- }
-
- if (min <= target_min && max >= target_max) {
- /* we need to pick the widest range */
+ /* the fps we have is valid. Select it if higher than our current target, or wider */
+ if (max > target_max || max == target_max && min < target_min) {
target_min = min;
target_max = max;
}
@@ -537,17 +542,8 @@
gst_caps_unref (c);
- /* the fps we have is valid. We are trying to pick the widest range */
- if (target_min == -1) {
- target_min = min;
- }
-
- if (target_max == -1) {
- target_max = max;
- }
-
- if (min >= target_min && max <= target_max) {
- /* we need to pick the narrowest range */
+ /* the fps we have is valid. Select it if higher than our current target, or narrower */
+ if (max > target_max || max == target_max && min > target_min) {
target_min = min;
target_max = max;
}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcparams.h
^
|
@@ -32,11 +32,13 @@
GHashTable *params;
gboolean is_dirty;
GArray *min_fps_range, *max_fps_range;
+ gboolean has_separate_video_size_values;
GMutex lock;
};
GstDroidCamSrcParams * gst_droidcamsrc_params_new (const gchar * params);
void gst_droidcamsrc_params_destroy (GstDroidCamSrcParams *params);
+gboolean gst_droidcamsrc_has_param (GstDroidCamSrcParams * params, const char *key);
void gst_droidcamsrc_params_reload (GstDroidCamSrcParams *params, const gchar * str);
gchar *gst_droidcamsrc_params_to_string (GstDroidCamSrcParams *params);
@@ -46,8 +48,7 @@
GstCaps *gst_droidcamsrc_params_get_video_caps (GstDroidCamSrcParams *params);
GstCaps *gst_droidcamsrc_params_get_image_caps (GstDroidCamSrcParams *params);
-void gst_droidcamsrc_params_set_string (GstDroidCamSrcParams *params, const gchar *key,
- const gchar *value);
+void gst_droidcamsrc_params_set_string (GstDroidCamSrcParams *params, const gchar *key, const gchar *value);
const gchar *gst_droidcamsrc_params_get_string (GstDroidCamSrcParams * params, const char *key);
int gst_droidcamsrc_params_get_int (GstDroidCamSrcParams * params, const char *key);
float gst_droidcamsrc_params_get_float (GstDroidCamSrcParams * params, const char *key);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcphotography.c
^
|
@@ -76,6 +76,7 @@
GList *scene;
GList *wb;
GList *iso;
+ gchar *iso_key;
GList *flicker;
};
@@ -807,6 +808,8 @@
}
}
+ g_strfreev(keys);
+
return list;
}
@@ -1040,12 +1043,25 @@
GST_WARNING_OBJECT (src, "setting iso to %d is not supported", iso_speed);
return FALSE;
}
-
+ // find iso param key if not set
+ if (src->photo->iso_key == NULL) {
+ if (src->dev == NULL || src->dev->params == NULL) {
+ GST_WARNING_OBJECT (src, "Params are NULL! Cannot find iso param key.");
+ return FALSE;
+ }
+ if (gst_droidcamsrc_has_param (src->dev->params, "iso")) {
+ src->photo->iso_key = "iso";
+ } else if (gst_droidcamsrc_has_param (src->dev->params, "iso-speed")) {
+ src->photo->iso_key = "iso-speed";
+ } else {
+ GST_WARNING_OBJECT (src, "ISO setting param key not found. Cannot set");
+ return FALSE;
+ }
+ }
GST_OBJECT_LOCK (src);
src->photo->settings.iso_speed = iso_speed;
GST_OBJECT_UNLOCK (src);
-
- return gst_droidcamsrc_set_and_apply (src, "iso", value);
+ return gst_droidcamsrc_set_and_apply (src, src->photo->iso_key, value);
}
static gboolean
@@ -1406,8 +1422,23 @@
src->photo->settings.iso_speed);
return;
}
-
- gst_droidcamsrc_params_set_string (src->dev->params, "iso", value);
+ // find iso param key if not set
+ if (src->photo->iso_key == NULL) {
+ if (src->dev == NULL || src->dev->params == NULL) {
+ GST_WARNING_OBJECT (src, "Params are NULL! Cannot find iso param key.");
+ return FALSE;
+ }
+ if (gst_droidcamsrc_has_param (src->dev->params, "iso")) {
+ src->photo->iso_key = "iso";
+ } else if (gst_droidcamsrc_has_param (src->dev->params, "iso-speed")) {
+ src->photo->iso_key = "iso-speed";
+ } else {
+ GST_WARNING_OBJECT (src, "ISO setting param key not found. Cannot set");
+ return FALSE;
+ }
+ }
+ gst_droidcamsrc_params_set_string (src->dev->params, src->photo->iso_key,
+ value);
}
static void
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcphotography.h
^
|
@@ -2,6 +2,7 @@
* gst-droid
*
* Copyright (C) 2014 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2016 Jolla LTD.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -34,6 +35,8 @@
PROP_DEVICE_PARAMETERS,
PROP_CAMERA_DEVICE,
PROP_MODE,
+ PROP_IMAGE_MODE,
+ PROP_SUPPORTED_IMAGE_MODES,
PROP_READY_FOR_CAPTURE,
PROP_MAX_ZOOM,
PROP_VIDEO_TORCH,
@@ -43,6 +46,7 @@
PROP_IMAGE_NOISE_REDUCTION,
PROP_SENSOR_ORIENTATION,
PROP_SENSOR_MOUNT_ANGLE,
+ PROP_TARGET_BITRATE,
/* photography interface */
PROP_WB_MODE,
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcquirks.c
^
|
@@ -278,7 +278,7 @@
quirk = gst_droidcamsrc_quirks_get_quirk (quirks, quirk_id);
if (!quirk) {
- GST_DEBUG_OBJECT (src, "quirk %s not known", quirk_id);
+ GST_INFO_OBJECT (src, "quirk %s not known", quirk_id);
return;
}
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcrecorder.c
^
|
@@ -0,0 +1,177 @@
+/*
+ * gst-droid
+ *
+ * Copyright (C) 2016 Jolla LTD.
+ *
+ * This library 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.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "gstdroidcamsrcrecorder.h"
+#include "gstdroidcamsrc.h"
+#include <gst/droid/gstdroidcodec.h>
+
+#define GST_DROIDCAMSRC_RECORDER_TARGET_BITRATE_DEFAULT 192000
+
+static void gst_droidcamsrc_recorder_data_available (void *data,
+ DroidMediaCodecData * encoded);
+
+GstDroidCamSrcRecorder *
+gst_droidcamsrc_recorder_create (GstDroidCamSrcPad * vidsrc)
+{
+ GstDroidCamSrcRecorder *recorder = g_new0 (GstDroidCamSrcRecorder, 1);
+
+ recorder->vidsrc = vidsrc;
+ recorder->md.bitrate = GST_DROIDCAMSRC_RECORDER_TARGET_BITRATE_DEFAULT;
+ recorder->md.meta_data = true;
+ recorder->md.parent.flags = DROID_MEDIA_CODEC_HW_ONLY;
+
+ return recorder;
+}
+
+void
+gst_droidcamsrc_recorder_destroy (GstDroidCamSrcRecorder * recorder)
+{
+ if (recorder->codec) {
+ gst_droid_codec_unref (recorder->codec);
+ }
+
+ g_free (recorder);
+}
+
+gboolean
+gst_droidcamsrc_recorder_init (GstDroidCamSrcRecorder * recorder,
+ DroidMediaCamera * cam, gint32 target_bitrate)
+{
+ if (!recorder->codec) {
+ return FALSE;
+ }
+
+ if (recorder->recorder) {
+ droid_media_recorder_destroy (recorder->recorder);
+ }
+
+ recorder->md.bitrate = target_bitrate;
+
+ recorder->recorder = droid_media_recorder_create (cam, &recorder->md);
+
+ if (!recorder->recorder) {
+ return FALSE;
+ }
+
+ DroidMediaCodecDataCallbacks cb;
+ cb.data_available = gst_droidcamsrc_recorder_data_available;
+
+ droid_media_recorder_set_data_callbacks (recorder->recorder, &cb, recorder);
+
+ return TRUE;
+}
+
+void
+gst_droidcamsrc_recorder_update_vid (GstDroidCamSrcRecorder * recorder,
+ GstVideoInfo * info, GstCaps * caps)
+{
+ if (recorder->codec) {
+ gst_droid_codec_unref (recorder->codec);
+ }
+
+ recorder->codec =
+ gst_droid_codec_new_from_caps (caps, GST_DROID_CODEC_ENCODER_VIDEO);
+ recorder->md.parent.width = info->width;
+ recorder->md.parent.height = info->height;
+ recorder->md.stride = recorder->md.parent.width;
+ recorder->md.slice_height = recorder->md.parent.height;
+ recorder->md.parent.fps = info->fps_n / info->fps_d;
+
+ if (recorder->codec) {
+ recorder->md.parent.type = gst_droid_codec_get_droid_type (recorder->codec);
+ }
+}
+
+gboolean
+gst_droidcamsrc_recorder_start (GstDroidCamSrcRecorder * recorder)
+{
+ return droid_media_recorder_start (recorder->recorder);
+}
+
+void
+gst_droidcamsrc_recorder_stop (GstDroidCamSrcRecorder * recorder)
+{
+ droid_media_recorder_stop (recorder->recorder);
+}
+
+static void
+gst_droidcamsrc_recorder_data_available (void *data,
+ DroidMediaCodecData * encoded)
+{
+ GstDroidCamSrcRecorder *recorder = (GstDroidCamSrcRecorder *) data;
+ GstDroidCamSrc *src =
+ GST_DROIDCAMSRC (GST_PAD_PARENT (recorder->vidsrc->pad));
+ GstBuffer *buffer = NULL;
+
+ if (encoded->codec_config) {
+ GstBuffer *codec_data = NULL;
+ GstCaps *caps = NULL;
+ GstCaps *current;
+ gboolean ret;
+
+ codec_data =
+ gst_droid_codec_create_encoder_codec_data (recorder->codec,
+ &encoded->data);
+
+ if (!codec_data) {
+ GST_ELEMENT_ERROR (src, STREAM, FORMAT, (NULL),
+ ("Failed to construct codec_data. Expect corrupted stream"));
+ return;
+ }
+
+ current = gst_pad_get_current_caps (recorder->vidsrc->pad);
+ caps = gst_caps_copy (current);
+ gst_caps_unref (current);
+ current = NULL;
+
+ gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, codec_data, NULL);
+ ret = gst_pad_set_caps (recorder->vidsrc->pad, caps);
+ gst_caps_unref (caps);
+
+ if (!ret) {
+ GST_ELEMENT_ERROR (src, STREAM, FORMAT, (NULL),
+ ("Failed to set video caps"));
+ }
+
+ return;
+ }
+
+ buffer =
+ gst_droid_codec_prepare_encoded_data (recorder->codec, &encoded->data);
+ if (!buffer) {
+ GST_ELEMENT_ERROR (src, LIBRARY, ENCODE, (NULL),
+ ("failed to process encoded data"));
+ return;
+ }
+
+ GST_BUFFER_PTS (buffer) = encoded->ts;
+ GST_BUFFER_DTS (buffer) = encoded->decoding_ts;
+
+ if (encoded->sync) {
+ GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
+ } else {
+ GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
+ }
+
+ gst_droidcamsrc_dev_queue_video_buffer (src->dev, buffer);
+}
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcrecorder.h
^
|
@@ -0,0 +1,56 @@
+/*
+ * gst-droid
+ *
+ * Copyright (C) 2016 Jolla LTD.
+ *
+ * This library 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.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __GST_DROIDCAMSRC_RECORDER_H__
+#define __GST_DROIDCAMSRC_RECORDER_H__
+
+#include <gst/gst.h>
+#include <gst/video/video.h>
+#include <droidmediarecorder.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GstDroidCamSrcRecorder GstDroidCamSrcRecorder;
+typedef struct _GstDroidCodec GstDroidCodec;
+typedef struct _GstDroidCamSrcPad GstDroidCamSrcPad;
+
+struct _GstDroidCamSrcRecorder
+{
+ /* opaque */
+
+ GstDroidCamSrcPad *vidsrc;
+ GstDroidCodec *codec;
+ DroidMediaRecorder *recorder;
+ DroidMediaCodecEncoderMetaData md;
+};
+
+GstDroidCamSrcRecorder *gst_droidcamsrc_recorder_create (GstDroidCamSrcPad *vidsrc);
+void gst_droidcamsrc_recorder_destroy (GstDroidCamSrcRecorder *recorder);
+
+gboolean gst_droidcamsrc_recorder_init (GstDroidCamSrcRecorder *recorder, DroidMediaCamera *cam, gint32 target_bitrate);
+
+void gst_droidcamsrc_recorder_update_vid (GstDroidCamSrcRecorder *recorder, GstVideoInfo *info, GstCaps *caps);
+
+gboolean gst_droidcamsrc_recorder_start (GstDroidCamSrcRecorder *recorder);
+void gst_droidcamsrc_recorder_stop (GstDroidCamSrcRecorder *recorder);
+
+G_END_DECLS
+
+#endif /* __GST_DROIDCAMSRC_RECORDER_H__ */
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/Makefile.am
^
|
@@ -10,13 +10,11 @@
libgstdroidcodec_la_SOURCES = \
gstdroidvdec.c \
gstdroidvenc.c \
- gstdroidcodec.c \
gstdroidadec.c \
gstdroidaenc.c
noinst_HEADERS = \
gstdroidvdec.h \
gstdroidvenc.h \
- gstdroidcodec.h \
gstdroidadec.h \
gstdroidaenc.h
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidadec.c
^
|
@@ -411,6 +411,7 @@
static GstFlowReturn
gst_droidadec_finish (GstAudioDecoder * decoder)
{
+ gboolean locked = FALSE; /* TODO: This is a hack */
GstDroidADec *dec = GST_DROIDADEC (decoder);
gint available;
@@ -422,6 +423,7 @@
}
g_mutex_lock (&dec->eos_lock);
+ locked = TRUE;
dec->eos = TRUE;
if (dec->codec) {
@@ -479,7 +481,9 @@
out:
dec->eos = FALSE;
- g_mutex_unlock (&dec->eos_lock);
+ if (locked) {
+ g_mutex_unlock (&dec->eos_lock);
+ }
return GST_FLOW_OK;
}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidadec.h
^
|
@@ -25,7 +25,7 @@
#include <gst/gst.h>
#include <gst/audio/gstaudiodecoder.h>
#include <gst/base/gstadapter.h>
-#include "gstdroidcodec.h"
+#include "gst/droid/gstdroidcodec.h"
G_BEGIN_DECLS
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidaenc.c
^
|
@@ -115,6 +115,14 @@
md.max_input_size = info.bpf * enc->rate;
enc->codec = droid_media_codec_create_encoder (&md);
+ // Reset timestamp clock
+ GstClock *clock = GST_ELEMENT_CLOCK (enc);
+ if (clock) {
+ gst_object_ref (clock);
+ GST_ELEMENT_CAST (enc)->base_time = gst_clock_get_time (clock);
+ gst_object_unref (clock);
+ }
+
if (!enc->codec) {
GST_ELEMENT_ERROR (enc, LIBRARY, SETTINGS, NULL,
("Failed to create encoder"));
@@ -507,8 +515,23 @@
data.data.size = info.size;
data.data.data = g_malloc (info.size);
data.sync = false;
- data.ts = GST_TIME_AS_USECONDS (buffer->pts);
+/* Check if the buffer has a valid timestamp, and if not then set it from the
+ * encoder's clock, as some versions of libstagefright throw away frames if
+ * it doesn't increase
+ */
+ GstClockTime ts = GST_BUFFER_TIMESTAMP (buffer);
+ if (!GST_CLOCK_TIME_IS_VALID (ts)) {
+ GST_DEBUG_OBJECT (enc, "Replacing invalid timestamp: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (ts));
+ GstClock *clock = gst_element_get_clock (enc);
+ if (clock) {
+ ts = gst_clock_get_time (clock) - GST_ELEMENT_CAST (enc)->base_time;
+ GST_DEBUG_OBJECT (enc, "New timestamp: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (ts));
+ }
+ }
+ data.ts = GST_TIME_AS_USECONDS (ts);
memcpy (data.data.data, info.data, info.size);
gst_buffer_unmap (buffer, &info);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidaenc.h
^
|
@@ -23,7 +23,7 @@
#include <gst/gst.h>
#include <gst/audio/gstaudioencoder.h>
-#include "gstdroidcodec.h"
+#include "gst/droid/gstdroidcodec.h"
G_BEGIN_DECLS
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidvdec.c
^
|
@@ -27,6 +27,7 @@
#include "gst/droid/gstdroidmediabuffer.h"
#include "gst/droid/gstdroidbufferpool.h"
#include "plugin.h"
+#include "droidmediaconstants.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <string.h> /* memset() */
@@ -215,6 +216,39 @@
GST_FIXME ("Not sure what to do here really");
}
+static void
+gst_droidvec_copy_plane (guint8 * out, gint stride_out, guint8 * in,
+ gint stride_in, gint width, gint height)
+{
+ int i;
+ for (i = 0; i < height; i++) {
+ orc_memcpy (out, in, width);
+ out += stride_out;
+ in += stride_in;
+ }
+}
+
+static void
+gst_droidvec_copy_packed_planes (guint8 * out0, guint8 * out1, gint stride_out,
+ guint8 * in, gint stride_in, gint width, gint height)
+{
+ int x, y;
+ for (y = 0; y < height; y++) {
+ guint8 *row = in;
+ for (x = 0; x < width; x++) {
+ out0[x] = row[0];
+ out1[x] = row[1];
+ row += 2;
+ }
+
+ out0 += stride_out;
+ out1 += stride_out;
+ in += stride_in;
+ }
+}
+
+#define ALIGN_SIZE(size, to) (((size) + to - 1) & ~(to - 1))
+
static gboolean
gst_droidvdec_convert_buffer (GstDroidVDec * dec,
GstBuffer * out, DroidMediaData * in, GstVideoInfo * info)
@@ -222,6 +256,7 @@
gsize height = info->height;
gsize width = info->width;
gsize size;
+ gboolean use_droid_convert;
gboolean use_external_buffer;
guint8 *data = NULL;
gboolean ret;
@@ -231,7 +266,7 @@
if (dec->codec_type->quirks & USE_CODEC_SUPPLIED_WIDTH_VALUE) {
width = dec->codec_reported_width;
- GST_INFO_OBJECT (dec, "using codec supplied width %d", height);
+ GST_INFO_OBJECT (dec, "using codec supplied width %d", width);
}
if (dec->codec_type->quirks & USE_CODEC_SUPPLIED_HEIGHT_VALUE) {
@@ -240,60 +275,137 @@
}
size = width * height * 3 / 2;
- use_external_buffer = gst_buffer_get_size (out) != size;
+ use_droid_convert = dec->convert;
+ use_external_buffer = use_droid_convert && gst_buffer_get_size (out) != size;
map_info.data = NULL;
+ if (dec->codec_type->quirks & DONT_USE_DROID_CONVERT_VALUE) {
+ use_droid_convert = false;
+ GST_INFO_OBJECT (dec, "not using droid convert binary");
+ }
+
if (!gst_buffer_map (out, &map_info, GST_MAP_WRITE)) {
GST_ERROR_OBJECT (dec, "failed to map buffer");
ret = FALSE;
goto out;
}
- if (use_external_buffer) {
- GST_DEBUG_OBJECT (dec, "using an external buffer for I420 conversion.");
- data = g_malloc (size);
- } else {
- data = map_info.data;
- }
-
- if (droid_media_convert_to_i420 (dec->convert, in, data) != true) {
- GST_ELEMENT_ERROR (dec, LIBRARY, FAILED, (NULL),
- ("failed to convert frame"));
+ if (use_droid_convert) {
+ if (use_external_buffer) {
+ GST_DEBUG_OBJECT (dec, "using an external buffer for I420 conversion.");
+ data = g_malloc (size);
+ } else {
+ data = map_info.data;
+ }
- ret = FALSE;
- goto out;
- }
+ if (droid_media_convert_to_i420 (dec->convert, in, data) != true) {
+ GST_ELEMENT_ERROR (dec, LIBRARY, FAILED, (NULL),
+ ("failed to convert frame"));
- if (use_external_buffer) {
- /* fix up the buffer */
- /* Code is based on gst-colorconv qcom backend */
-
- gint stride = GST_VIDEO_INFO_COMP_STRIDE (info, 0);
- gint strideUV = GST_VIDEO_INFO_COMP_STRIDE (info, 1);
- guint8 *p = data;
- guint8 *dst = map_info.data;
- int i;
- int x;
-
- /* Y */
- for (i = 0; i < info->height; i++) {
- orc_memcpy (dst, p, info->width);
- dst += stride;
- p += width;
+ ret = FALSE;
+ goto out;
}
- /* NOP if height == info->height */
- p += (height - info->height) * width;
- /* U and V */
- for (x = 0; x < 2; x++) {
- for (i = 0; i < info->height / 2; i++) {
- orc_memcpy (dst, p, info->width / 2);
- dst += strideUV;
- p += width / 2;
+ if (use_external_buffer) {
+ /* fix up the buffer */
+ /* Code is based on gst-colorconv qcom backend */
+
+ gint stride = GST_VIDEO_INFO_COMP_STRIDE (info, 0);
+ gint strideUV = GST_VIDEO_INFO_COMP_STRIDE (info, 1);
+ guint8 *p = data;
+ guint8 *dst = map_info.data;
+ int i;
+ int x;
+
+ /* Y */
+ for (i = 0; i < info->height; i++) {
+ orc_memcpy (dst, p, info->width);
+ dst += stride;
+ p += width;
}
/* NOP if height == info->height */
- p += (height - info->height) / 2 * width / 2;
+ p += (height - info->height) * width;
+ /* U and V */
+ for (x = 0; x < 2; x++) {
+ for (i = 0; i < info->height / 2; i++) {
+ orc_memcpy (dst, p, info->width / 2);
+ dst += strideUV;
+ p += width / 2;
+ }
+
+ /* NOP if height == info->height */
+ p += (height - info->height) / 2 * width / 2;
+ }
+ }
+ } else {
+ DroidMediaColourFormatConstants c;
+ droid_media_colour_format_constants_init (&c);
+ if (dec->hal_format == c.OMX_COLOR_FormatYUV420Planar) {
+ /* Buffer is already I420, so we can copy it straight over */
+ /* though we need to handle the cropping */
+
+ GST_DEBUG_OBJECT (dec, "Copying I420 buffer");
+ gint top = dec->crop_rect.top;
+ gint left = dec->crop_rect.left;
+ gint crop_width = dec->crop_rect.right - left;
+ gint crop_height = dec->crop_rect.bottom - top;
+
+ guint8 *y = in->data + (top * width) + left;
+ guint8 *u = in->data + (width * height) + (top * width / 2) + (left / 2);
+ guint8 *v =
+ in->data + (width * height) + (width * height / 4) +
+ (top * width / 2) + (left / 2);
+
+ gst_droidvec_copy_plane (map_info.data + info->offset[0],
+ info->stride[0], y, width, crop_width, crop_height);
+ gst_droidvec_copy_plane (map_info.data + info->offset[1],
+ info->stride[1], u, width / 2, crop_width / 2, crop_height / 2);
+ gst_droidvec_copy_plane (map_info.data + info->offset[2],
+ info->stride[2], v, width / 2, crop_width / 2, crop_height / 2);
+
+ } else if (dec->hal_format == c.QOMX_COLOR_FormatYUV420PackedSemiPlanar32m) {
+ /* copy to the output buffer swapping the u and v planes and cropping if necessary */
+ /* NV12 format with 128 byte alignment */
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidvdec.h
^
|
@@ -24,7 +24,7 @@
#include <gst/gst.h>
#include <gst/video/gstvideodecoder.h>
-#include "gstdroidcodec.h"
+#include "gst/droid/gstdroidcodec.h"
#include "droidmediaconvert.h"
G_BEGIN_DECLS
@@ -81,6 +81,7 @@
GstVideoCodecState *in_state;
GstVideoCodecState *out_state;
DroidMediaConvert *convert;
+ gint32 hal_format;
};
struct _GstDroidVDecClass
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gst/droidcodec/gstdroidvenc.h
^
|
@@ -23,7 +23,7 @@
#include <gst/gst.h>
#include <gst/video/gstvideoencoder.h>
-#include "gstdroidcodec.h"
+#include "gst/droid/gstdroidcodec.h"
G_BEGIN_DECLS
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/gstreamer-droid-1.0.pc.in
^
|
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@/gstreamer-1.0
+
+Name: GstDroid library
+Description: GstDroid library
+Requires: gstreamer-1.0 gstreamer-base-1.0 android-headers
+Version: @VERSION@
+Libs: -L${libdir} -lgstdroid-1.0
+Cflags: -I${includedir}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/tools/Makefile.am
^
|
@@ -8,10 +8,14 @@
bin_PROGRAMS = \
mk-cam-conf \
- record-video
+ record-video \
+ dump-resolutions
mk_cam_conf_SOURCES = gstdroidcamsrcconf.c
mk_cam_conf_LDADD = libcommon.la
record_video_SOURCES = record.c
record_video_LDADD = libcommon.la
+
+dump_resolutions_SOURCES = resolutions.c
+dump_resolutions_LDADD = libcommon.la
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/tools/common.c
^
|
@@ -166,7 +166,7 @@
goto out;
error:
- common_destroy (common);
+ common_destroy (common, TRUE);
common = NULL;
out:
@@ -174,7 +174,7 @@
}
int
-common_destroy (Common * common)
+common_destroy (Common * common, gboolean deinit)
{
int ret = common->ret;
@@ -200,7 +200,9 @@
g_free (common);
- gst_deinit ();
+ if (deinit) {
+ gst_deinit ();
+ }
return ret;
}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/tools/common.h
^
|
@@ -52,7 +52,7 @@
} Mode;
Common *common_init (int *argc, char ***argv, char *bin);
-int common_destroy (Common *common);
+int common_destroy (Common *common, gboolean deinit);
gboolean common_run (Common *c);
void common_set_device_mode(Common *c, Device dev, Mode m);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/tools/gstdroidcamsrcconf.c
^
|
@@ -56,6 +56,7 @@
ADD_ENTRY (GST_PHOTOGRAPHY_FLASH_MODE_AUTO, "auto"),
ADD_ENTRY (GST_PHOTOGRAPHY_FLASH_MODE_OFF, "off"),
ADD_ENTRY (GST_PHOTOGRAPHY_FLASH_MODE_ON, "on"),
+ ADD_ENTRY (GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE, "red-eye"),
{NULL, -1}
}},
{"focus-mode-values", "focus-mode", {
@@ -67,19 +68,19 @@
ADD_ENTRY (GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED, "edof"),
ADD_ENTRY (GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL, "continuous"),
ADD_ENTRY (GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED, "continuous"),
- ADD_ENTRY (GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL, NULL),
+ ADD_ENTRY (GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL, "manual"),
{NULL, -1}
}},
{"whitebalance-values", "white-balance-mode", {
ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_AUTO, "auto"),
ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT, "daylight"),
ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_CLOUDY, "cloudy-daylight"),
- ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_SUNSET, NULL),
+ ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_SUNSET, "twilight"),
ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN, "incandescent"),
ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT, "fluorescent"),
ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_MANUAL, NULL),
- ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT, NULL),
- ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_SHADE, NULL),
+ ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT, "warm-fluorescent"),
+ ADD_ENTRY (GST_PHOTOGRAPHY_WB_MODE_SHADE, "shade"),
{NULL, -1}
}},
{"scene-mode-values", "scene-mode", {
@@ -122,6 +123,7 @@
ADD_ENTRY (GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA, "aqua"),
{NULL, -1}
}},
+ // Qualcomm ISO values (e.g. ISO100) and Intel (iso-100)
{"iso-values", "iso-speed", {
ADD_ENTRY (0, "auto"),
ADD_ENTRY (0, "iso-auto"),
@@ -133,8 +135,20 @@
ADD_ENTRY (400, "iso-400"),
ADD_ENTRY (800, "ISO800"),
ADD_ENTRY (800, "iso-800"),
+ ADD_ENTRY (1600, "ISO1600"),
+ ADD_ENTRY (3200, "ISO3200"),
{NULL, -1}
}},
+ // Mediatek ISO values
+ {"iso-speed-values", "iso-speed", {
+ ADD_ENTRY (0, "auto"),
+ ADD_ENTRY (100, "100"),
+ ADD_ENTRY (200, "200"),
+ ADD_ENTRY (400, "400"),
+ ADD_ENTRY (800, "800"),
+ ADD_ENTRY (1600, "1600"),
+ {NULL, -1}
+ }},
{"antibanding-values", "flicker-mode", {
ADD_ENTRY (GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF, "off"),
ADD_ENTRY (GST_PHOTOGRAPHY_FLICKER_REDUCTION_50HZ, "50hz"),
@@ -315,5 +329,5 @@
return 1;
}
- return common_destroy (common);
+ return common_destroy (common, TRUE);
}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/tools/record.c
^
|
@@ -64,5 +64,5 @@
return 1;
}
- return common_destroy (common);
+ return common_destroy (common, TRUE);
}
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180924.0.tar.gz/tools/resolutions.c
^
|
@@ -0,0 +1,180 @@
+/*
+ * gst-droid
+ *
+ * Copyright (C) 2016 Jolla LTD.
+ *
+ * This library 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.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "common.h"
+#include <math.h>
+#include <float.h>
+
+struct Ratio
+{
+ gfloat value;
+ const char *name;
+} Ratios[] = {
+ {
+ 1.3333333333f, "4:3"}, {
+ 1.7777777778f, "16:9"}, {
+ 1.5, "3:2"}, {
+ 1.6666666667f, "16:10"},
+ /* What are those? */
+ /* {1.8, "9:5"}, */
+};
+
+void
+print (int w, int h)
+{
+ char *name = NULL;
+ int x;
+ for (x = 0; x < sizeof (Ratios) / sizeof (struct Ratio); x++) {
+ if (fabsf ((float) w / h - Ratios[x].value) < FLT_EPSILON) {
+ name = g_strdup (Ratios[x].name);
+ break;
+ }
+ }
+
+ if (!name) {
+ name = g_strdup_printf ("UNK (%.6f)", (float) w / h);
+ }
+
+ float mp = w * h / 1000000.0;
+ g_print ("%.2f %ix%i %s\n", mp, w, h, name);
+ g_free (name);
+}
+
+gboolean
+dump_resolution (GstStructure * s)
+{
+ const GValue *w = gst_structure_get_value (s, "width");
+ const GValue *h = gst_structure_get_value (s, "height");
+ gboolean w_list = GST_VALUE_HOLDS_LIST (w);
+ gboolean h_list = GST_VALUE_HOLDS_LIST (h);
+
+ if (!w_list && !h_list) {
+ print (g_value_get_int (w), g_value_get_int (h));
+ } else if (w_list && !h_list) {
+ int height = g_value_get_int (h);
+ int x;
+ for (x = 0; x < gst_value_list_get_size (w); x++) {
+ print (g_value_get_int (gst_value_list_get_value (w, x)), height);
+ }
+ } else if (h_list && !w_list) {
+ int width = g_value_get_int (w);
+ int x;
+ for (x = 0; x < gst_value_list_get_size (h); x++) {
+ print (width, g_value_get_int (gst_value_list_get_value (h, x)));
+ }
+ } else {
+ /* Both are lists :/ */
+ int x, i;
+ for (x = 0; x < gst_value_list_get_size (w); x++) {
+ const GValue *width = gst_value_list_get_value (w, x);
+
+ for (i = 0; i < gst_value_list_get_size (h); i++) {
+ const GValue *height = gst_value_list_get_value (h, i);
+ print (g_value_get_int (width), g_value_get_int (height));
+ }
+ }
+ }
+
+
+ return TRUE;
+
+ /*
+ gint w = 0, h = 0;
+ if (!gst_structure_get_int(s, "width", &w) ||
+ !gst_structure_get_int(s, "height", &h)) {
+ ret = FALSE;
+ goto out;
+ }
+
+ g_print("%ix%i\n", w, h);
+ */
+}
+
+gboolean
+dump_pad (GstElement * src, const gchar * pad_name, const gchar * name)
+{
+ gboolean ret = TRUE;
+ GstPad *pad = gst_element_get_static_pad (src, pad_name);
+ if (!pad) {
+ return FALSE;
+ }
+
+ GstCaps *caps = gst_pad_query_caps (pad, NULL);
+ if (!caps) {
+ ret = FALSE;
+ goto out;
+ }
+
+ g_print (name, pad_name);
+
+ int x;
+ for (x = 0; x < gst_caps_get_size (caps); x++) {
+ GstStructure *s = gst_caps_get_structure (caps, x);
+ if (!dump_resolution (s)) {
+ ret = FALSE;
+ goto out;
+ }
+ }
+
+ g_print ("== Done\n");
+
+out:
+ if (caps) {
+ gst_caps_unref (caps);
+ }
+
+ gst_object_unref (pad);
+ return ret;
+}
+
+gboolean
+dump (Device dev, const char *name, gboolean deinit)
+{
+ Common *common = common_init (0, NULL, "camerabin");
+ if (!common) {
+ return FALSE;
+ }
+
+ gboolean ret = TRUE;
+
+ common_set_device_mode (common, dev, IMAGE);
+ gst_element_set_state (GST_ELEMENT (common->bin), GST_STATE_PAUSED);
+
+ ret = dump_pad (common->cam_src, "vfsrc", name) &&
+ dump_pad (common->cam_src, "imgsrc", name) &&
+ dump_pad (common->cam_src, "vidsrc", name);
+
+ gst_element_set_state (GST_ELEMENT (common->bin), GST_STATE_NULL);
+
+ common_destroy (common, deinit);
+
+ return ret;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (!dump (PRIMARY, "primary %s:\n", FALSE) ||
+ !dump (SECONDARY, "secondary %s:\n", TRUE)) {
+ return 1;
+ }
+
+ return 0;
+}
|