[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:gst-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -1,13 +1,9 @@
<services>
- <service name="webhook">
- <param name="repourl">https://github.com/mlehtima/gst-droid.git</param>
- <param name="branch">xperia</param>
- </service>
<service name="tar_git">
- <param name="url">https://github.com/mlehtima/gst-droid.git</param>
- <param name="branch">xperia</param>
- <param name="revision">HEAD</param>
+ <param name="url">https://github.com/sailfishos/gst-droid.git</param>
+ <param name="branch">master</param>
+ <param name="revision">9ec999c5eace3bf936d385e3f4bd6a7bb0b5fa19</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
-</service></services>
\ No newline at end of file
+</service></services>
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20150819.0+xperia.20160625123941.26.gb967b93.tar.gz/gst/droidcodec/gstdroidcodec.c
^
|
@@ -1,1127 +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_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;
- 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 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", FALSE, 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);
|
[-]
[+]
|
Deleted |
_service:tar_git:gstreamer1.0-droid-0.20150819.0+xperia.20160625123941.26.gb967b93.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.20150819.0+xperia.20160625123941.26.gb967b93.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.20150819.0+xperia.20160625123941.26.gb967b93.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.20150819.0+xperia.20160625123941.26.gb967b93.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.20150819.0+xperia.20160625123941.26.gb967b93.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.20170918.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.20170918.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.20170918.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.c
^
|
@@ -0,0 +1,1123 @@
+/*
+ * 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_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_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);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.h
^
|
(renamed from gst/droidcodec/gstdroidcodec.h)
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.0.tar.gz/gst-libs/gst/droid/gstwrappedmemory.h
^
|
@@ -29,14 +29,6 @@
#define GST_ALLOCATOR_WRAPPED_MEMORY "WrappedMemory"
#define GST_CAPS_FEATURE_MEMORY_DROID_VIDEO_META_DATA "memory:DroidVideoMetaData"
-#define GST_VIDEO_CAPS_MAKE_WITH_FEATURES_METADATA(features,format) \
-"video/x-raw(" features "), " \
-"format = (string) " format ", " \
-"width = " GST_VIDEO_SIZE_RANGE ", " \
-"height = " GST_VIDEO_SIZE_RANGE ", " \
-"framerate = " GST_VIDEO_FPS_RANGE ", " \
-"metadata = (boolean) { FALSE, TRUE }"
-
GstAllocator * gst_wrapped_memory_allocator_new (void);
gboolean gst_is_wrapped_memory_memory (GstMemory * mem);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.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.20170918.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
@@ -49,7 +51,7 @@
GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME,
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES_METADATA
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_DROID_MEDIA_BUFFER, "{YV12}") ";"
GST_VIDEO_CAPS_MAKE ("{NV21}")));
@@ -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_METADATA
+ 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,16 +112,17 @@
#define DEFAULT_FACE_DETECTION FALSE
#define DEFAULT_IMAGE_NOISE_REDUCTION TRUE
#define DEFAULT_SENSOR_ORIENTATION 0
-#define DEFAULT_FAST_CAPTURE FALSE
-#define DEFAULT_FAST_CAPTURE_SUPPORTED FALSE
+#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);
@@ -166,7 +173,7 @@
src->video_torch = DEFAULT_VIDEO_TORCH;
src->face_detection = DEFAULT_FACE_DETECTION;
src->image_noise_reduction = DEFAULT_IMAGE_NOISE_REDUCTION;
- src->fast_capture_enabled = DEFAULT_FAST_CAPTURE;
+ 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;
@@ -174,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;
@@ -203,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;
@@ -259,13 +269,35 @@
g_value_set_int (value, src->info[src->camera_device].orientation * 90);
break;
- case PROP_FAST_CAPTURE:
- g_value_set_boolean (value, src->fast_capture_enabled);
+ 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_FAST_CAPTURE_SUPPORTED:
- g_value_set_boolean (value, gst_droidcamsrc_quirks_get_quirk (src->quirks,
- "fast-capture") != NULL);
+ case PROP_TARGET_BITRATE:
+ g_value_set_int (value, src->target_bitrate);
break;
default:
@@ -359,11 +391,15 @@
gst_droidcamsrc_apply_mode_settings (src, SET_AND_APPLY);
break;
- case PROP_FAST_CAPTURE:
- src->fast_capture_enabled = g_value_get_boolean (value);
+ 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;
@@ -405,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;
@@ -433,6 +473,8 @@
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;
@@ -556,6 +598,10 @@
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.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,7 +112,7 @@
gboolean video_torch;
gboolean face_detection;
gboolean image_noise_reduction;
- gboolean fast_capture_enabled;
+ GstDroidCamSrcImageMode image_mode;
GstDroidCamSrcPhotography * photo;
gfloat max_zoom;
@@ -119,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.20170918.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,10 +226,10 @@
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.
*/
- if (!src->fast_capture_enabled) {
+ if (!(src->image_mode & GST_DROIDCAMSRC_IMAGE_MODE_ZSL)) {
g_rec_mutex_lock (dev->lock);
dev->running = FALSE;
g_rec_mutex_unlock (dev->lock);
@@ -309,7 +317,6 @@
GstBuffer *buffer;
GstMemory *mem;
GstDroidCamSrcDevVideoData *mem_data;
- gboolean drop_buffer;
GST_DEBUG_OBJECT (src, "dev video frame callback");
@@ -335,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);
+ gst_droidcamsrc_dev_queue_video_buffer_locked (dev, buffer);
- drop_buffer = !dev->vid->running;
-
- 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 */
@@ -543,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;
@@ -624,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);
@@ -873,12 +871,15 @@
dev->vid->video_frames = 0;
dev->vid->queued_frames = 0;
- if (!droid_media_camera_start_recording (dev->cam)) {
- GST_ELEMENT_ERROR (src, LIBRARY, FAILED, ("error starting 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 (!ret)
+ goto out;
+
ret = TRUE;
out:
@@ -924,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);
+ g_rec_mutex_unlock (dev->lock);
+ usleep (VIDEO_RECORDING_STOP_TIMEOUT);
+ g_rec_mutex_lock (dev->lock);
+ }
- while (dev->vid->queued_frames > 0) {
- GST_INFO ("waiting for queued frames to reach 0 from %i",
- dev->vid->queued_frames);
+ /* 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);
@@ -967,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);
@@ -1124,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)
+{
+ GstDroidCamSrc *src = GST_DROIDCAMSRC (GST_PAD_PARENT (dev->imgsrc->pad));
+
+ if (!gst_droidcamsrc_recorder_init (dev->recorder, dev->cam,
+ src->target_bitrate)) {
+ GST_ELEMENT_ERROR (src, LIBRARY, FAILED,
+ ("error initializing video recorder"), (NULL));
+ return FALSE;
+ }
+
+ if (!gst_droidcamsrc_recorder_start (dev->recorder)) {
+ GST_ELEMENT_ERROR (src, LIBRARY, FAILED, ("error starting video recorder"),
+ (NULL));
+ return FALSE;
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.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.20170918.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.20170918.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.20170918.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,8 +46,7 @@
PROP_IMAGE_NOISE_REDUCTION,
PROP_SENSOR_ORIENTATION,
PROP_SENSOR_MOUNT_ANGLE,
- PROP_FAST_CAPTURE,
- PROP_FAST_CAPTURE_SUPPORTED,
+ PROP_TARGET_BITRATE,
/* photography interface */
PROP_WB_MODE,
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20170918.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcrecorder.c
^
|
@@ -0,0 +1,173 @@
+/*
+ * 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)
+{
+ 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.20170918.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.20170918.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.20170918.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.20170918.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.20170918.0.tar.gz/gst/droidcodec/gstdroidvdec.c
^
|
@@ -215,6 +215,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,8 +255,7 @@
gsize height = info->height;
gsize width = info->width;
gsize size;
- gboolean use_external_buffer;
- guint8 *data = NULL;
+ gboolean use_droid_convert;
gboolean ret;
GstMapInfo map_info;
@@ -240,7 +272,7 @@
}
size = width * height * 3 / 2;
- use_external_buffer = gst_buffer_get_size (out) != size;
+ use_droid_convert = dec->convert && gst_buffer_get_size (out) == size;
map_info.data = NULL;
if (!gst_buffer_map (out, &map_info, GST_MAP_WRITE)) {
@@ -249,61 +281,35 @@
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"));
-
- ret = FALSE;
- goto out;
- }
-
- 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;
- }
+ if (use_droid_convert) {
+ if (droid_media_convert_to_i420 (dec->convert, in, map_info.data) != true) {
+ GST_ELEMENT_ERROR (dec, LIBRARY, FAILED, (NULL),
+ ("failed to convert frame"));
- /* 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;
- }
-
- /* NOP if height == info->height */
- p += (height - info->height) / 2 * width / 2;
+ ret = FALSE;
+ goto out;
}
+ } else {
+ /* copy to the output buffer swapping the u and v planes and cropping if necessary */
+ /* this assumes a NV12 format with 128 byte alignment */
+ gint stride = ALIGN_SIZE (width, 128);
+ gint slice_height = ALIGN_SIZE (height, 32);
+ gint top = ALIGN_SIZE (dec->crop_rect.top, 2);
+ gint left = ALIGN_SIZE (dec->crop_rect.left, 2);
+
+ guint8 *y = in->data + (top * stride) + left;
+ guint8 *uv = in->data + (stride * slice_height) + (top * stride / 2) + left;
+
+ gst_droidvec_copy_plane (map_info.data + info->offset[0], info->stride[0],
+ y, stride, info->width, info->height);
+ gst_droidvec_copy_packed_planes (map_info.data + info->offset[1],
+ map_info.data + info->offset[2], info->stride[1], uv, stride,
+ info->width / 2, info->height / 2);
}
ret = TRUE;
out:
- if (use_external_buffer && data) {
- g_free (data);
- }
-
if (map_info.data) {
gst_buffer_unmap (out, &map_info);
}
@@ -413,9 +419,12 @@
/* We get the timestamp in ns already */
frame->pts = ts;
- /* we have a ref so drop it */
- gst_video_codec_frame_unref (frame);
-
+ /* we have a ref acquired by _get_oldest_frame()
+ * but we don't drop it because _finish_frame() assumes 2 refs.
+ * A ref that we obtained via _handle_frame() which we dropped already
+ * so we need to compensate it and the 2nd ref which is already owned by
+ * the base class GstVideoDecoder
+ */
dec->downstream_flow_ret = gst_droidvdec_finish_frame (decoder, frame);
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
@@ -488,9 +497,12 @@
frame->pts = encoded->ts;
frame->output_buffer = buff;
- /* we have a ref so drop it */
- gst_video_codec_frame_unref (frame);
-
+ /* we have a ref acquired by _get_oldest_frame()
+ * but we don't drop it because _finish_frame() assumes 2 refs.
+ * A ref that we obtained via _handle_frame() which we dropped already
+ * so we need to compensate it and the 2nd ref which is already owned by
+ * the base class GstVideoDecoder
+ */
flow_ret = gst_droidvdec_finish_frame (decoder, frame);
out:
@@ -647,14 +659,11 @@
dec->convert = droid_media_convert_create ();
}
- if (!dec->convert) {
- GST_ELEMENT_ERROR (dec, LIBRARY, INIT, (NULL),
- ("Failed to create I420 converter"));
- goto error;
+ if (dec->convert) {
+ droid_media_convert_set_crop_rect (dec->convert, rect, md.width,
+ md.height);
+ GST_INFO_OBJECT (dec, "using I420 conversion for output buffers");
}
-
- droid_media_convert_set_crop_rect (dec->convert, rect, md.width, md.height);
- GST_INFO_OBJECT (dec, "using I420 conversion for output buffers");
}
if (!gst_video_decoder_negotiate (decoder)) {
@@ -1012,9 +1021,8 @@
* which breaks timestamping.
*/
data.ts =
- GST_CLOCK_TIME_IS_VALID (frame->
- pts) ? GST_TIME_AS_USECONDS (frame->pts) : GST_TIME_AS_USECONDS (frame->
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.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
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.0.tar.gz/gst/droidcodec/gstdroidvenc.c
^
|
@@ -41,7 +41,7 @@
GST_STATIC_PAD_TEMPLATE (GST_VIDEO_ENCODER_SINK_NAME,
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES_METADATA
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_DROID_VIDEO_META_DATA, "{YV12}")));
enum
@@ -141,8 +141,8 @@
md.stride = enc->in_state->info.width;
md.slice_height = enc->in_state->info.height;
- gst_structure_get_boolean (gst_caps_get_structure (enc->in_state->caps, 0),
- "metadata", &md.meta_data);
+ /* TODO: get this from caps */
+ md.meta_data = true;
query = gst_droid_query_new_video_color_format ();
if (!gst_pad_peer_query (GST_VIDEO_ENCODER_SINK_PAD (GST_VIDEO_ENCODER (enc)),
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20170918.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
|