[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:gst-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -1,10 +1,10 @@
<services>
- <service name="tar_git">
- <param name="url">https://github.com/sailfishos/gst-droid.git</param>
- <param name="branch">master</param>
- <param name="revision">f3f0d4192863c41f770087bc53e33cbf7f66eb5e</param>
- <param name="token"/>
- <param name="debian">N</param>
- <param name="dumb">N</param>
- </service>
-</services>
\ No newline at end of file
+ <service name="tar_git">
+ <param name="url">https://github.com/sailfishos/gst-droid.git</param>
+ <param name="branch">master</param>
+ <param name="revision">e468c7c37d0e1fcae4a295725044b6612142f10b</param>
+ <param name="token"/>
+ <param name="debian">N</param>
+ <param name="dumb">N</param>
+ </service>
+</services>
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180416.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.20180416.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.20180416.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.c
^
|
@@ -31,7 +31,7 @@
#endif /* GST_USE_UNSTABLE_API */
#include <gst/codecparsers/gsth264parser.h>
-GST_DEBUG_CATEGORY_EXTERN (gst_droid_codec_debug);
+GST_DEBUG_CATEGORY (gst_droid_codec_debug);
#define GST_CAT_DEFAULT gst_droid_codec_debug
static GstBuffer *create_mpeg4venc_codec_data (DroidMediaData * data);
@@ -129,7 +129,7 @@
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,
+ "video/x-vp8", TRUE, NULL, NULL, NULL, NULL,
create_vp8vdec_codec_data_from_codec_data, NULL, NULL},
/* audio encoders */
@@ -1104,6 +1104,7 @@
goto out;
}
+ codec->quirks = 0;
for (x = 0; x < quirks_length; x++) {
if (!g_strcmp0 (quirks_string[x], USE_CODEC_SUPPLIED_HEIGHT_NAME)) {
codec->quirks |= USE_CODEC_SUPPLIED_HEIGHT_VALUE;
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180416.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.20180416.0.tar.gz/gst/droidcamsrc/gstdroidcamsrc.c
^
|
@@ -481,8 +481,7 @@
}
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;
@@ -1615,9 +1614,7 @@
our_caps = gst_caps_make_writable (our_caps);
our_caps = gst_droidcamsrc_pick_largest_resolution (src, our_caps);
-
- /* imgsrc frame rate is not really important so we will just set it to 30 */
- gst_caps_set_simple (our_caps, "framerate", G_TYPE_INT, 30, NULL);
+ gst_droidcamsrc_params_choose_image_framerate (src->dev->params, our_caps);
if (!gst_pad_set_caps (data->pad, our_caps)) {
GST_ERROR_OBJECT (src, "failed to set caps");
@@ -1712,7 +1709,10 @@
}
vid = g_strdup_printf ("%ix%i", info.width, info.height);
- gst_droidcamsrc_params_set_string (src->dev->params, "video-size", vid);
+ gchar *key =
+ src->dev->
+ params->has_separate_video_size_values ? "video-size" : "preview-size";
+ gst_droidcamsrc_params_set_string (src->dev->params, key, vid);
/* Now we need to find a picture size that is equal to our video size.
* Some devices need to have a picture size otherwise the video mode viewfinder
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180416.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcparams.c
^
|
@@ -195,6 +195,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 +391,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 +485,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 +536,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.20180416.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcparams.h
^
|
@@ -32,6 +32,7 @@
GHashTable *params;
gboolean is_dirty;
GArray *min_fps_range, *max_fps_range;
+ gboolean has_separate_video_size_values;
GMutex lock;
};
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180416.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.20180416.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,7 +275,8 @@
}
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 (!gst_buffer_map (out, &map_info, GST_MAP_WRITE)) {
@@ -249,51 +285,103 @@
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 (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;
+ }
- if (droid_media_convert_to_i420 (dec->convert, in, data) != true) {
- GST_ELEMENT_ERROR (dec, LIBRARY, FAILED, (NULL),
- ("failed to convert frame"));
+ 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;
- }
+ 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;
- }
-
- /* 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 */
+ GST_DEBUG_OBJECT (dec, "Converting from qcom NV12 semi planar");
+ 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);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180416.0.tar.gz/gst/droidcodec/gstdroidvdec.h
^
|
@@ -81,6 +81,7 @@
GstVideoCodecState *in_state;
GstVideoCodecState *out_state;
DroidMediaConvert *convert;
+ gint32 hal_format;
};
struct _GstDroidVDecClass
|
[-]
[+]
|
Added |
_service:tar_git:gstreamer1.0-droid-0.20180416.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.20180416.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", {
|