[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:gst-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -4,8 +4,8 @@
<param name="branch">master</param>
</service>
<service name="tar_git">
- <param name="url">https://github.com/kimmoli/gst-droid.git</param>
- <param name="branch">test1</param>
+ <param name="url">https://github.com/rinigus/gst-droid.git</param>
+ <param name="branch">master</param>
<param name="revision">HEAD</param>
<param name="token"/>
<param name="debian">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.c
^
|
@@ -1104,14 +1104,11 @@
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;
} else if (!g_strcmp0 (quirks_string[x], USE_CODEC_SUPPLIED_WIDTH_NAME)) {
codec->quirks |= USE_CODEC_SUPPLIED_WIDTH_VALUE;
- } else if (!g_strcmp0 (quirks_string[x], DONT_USE_DROID_CONVERT_NAME)) {
- codec->quirks |= DONT_USE_DROID_CONVERT_VALUE;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.h
^
|
@@ -35,9 +35,6 @@
#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;
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcamsrc/gstdroidcamsrc.c
^
|
@@ -183,7 +183,7 @@
src->fps_d = 1;
src->target_bitrate = DEFAULT_TARGET_BITRATE;
- gst_droidcamsrc_photography_init (src);
+ gst_droidcamsrc_photography_init (src, DEFAULT_CAMERA_DEVICE);
src->vfsrc = gst_droidcamsrc_create_pad (src,
GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME, FALSE);
@@ -325,8 +325,8 @@
} else {
src->camera_device = g_value_get_enum (value);
GST_INFO_OBJECT (src, "camera device set to %d", src->camera_device);
- /* initialize empty photo properties */
- gst_droidcamsrc_photography_init (src);
+ /* load our configuration file */
+ gst_droidcamsrc_photography_init (src, src->camera_device);
}
g_rec_mutex_unlock (&src->dev_lock);
break;
@@ -481,7 +481,8 @@
}
if (num > MAX_CAMERAS) {
- GST_WARNING_OBJECT (src, "cannot support %d cameras", num);
+ GST_ERROR_OBJECT (src, "cannot support %d cameras", num);
+ return FALSE;
}
src->info[0].num = src->info[1].num = -1;
@@ -597,9 +598,6 @@
/* now that we have camera parameters, we can update min and max ev-compensation */
gst_droidcamsrc_update_ev_compensation_bounds (src);
- /* and the photography parameters */
- gst_droidcamsrc_photography_update_params (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");
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcparams.c
^
|
@@ -51,12 +51,6 @@
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)
@@ -468,9 +462,6 @@
{
int x;
int target_min = -1, target_max = -1;
- int fps;
-
- fps = gst_droidcamsrc_params_get_int_locked (params, "preview-frame-rate");
g_mutex_lock (¶ms->lock);
@@ -504,20 +495,9 @@
if (target_min != -1 && target_max != -1) {
gchar *var;
- /* use the requested fps or clip to min/max */
- if (fps > (target_max / 1000) || fps == -1) {
- gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
- target_max / 1000, 1, NULL);
- GST_DEBUG ("using frame rate by target_max %d", target_max / 1000 );
- } else if (fps < (target_min / 1000)) {
- gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
- target_min / 1000, 1, NULL);
- GST_DEBUG ("using frame rate by target_min %d", target_min / 1000 );
- } else {
- gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
- fps, 1, NULL);
- GST_DEBUG ("using frame rate by requested fps %d", fps );
- }
+ /* use the max */
+ gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
+ target_max / 1000, 1, NULL);
var = g_strdup_printf ("%d,%d", target_min, target_max);
gst_droidcamsrc_params_set_string_locked (params, "preview-fps-range", var);
@@ -533,9 +513,6 @@
{
int x;
int target_min = -1, target_max = -1;
- int fps;
-
- fps = gst_droidcamsrc_params_get_int_locked (params, "preview-frame-rate");
g_mutex_lock (¶ms->lock);
@@ -569,20 +546,9 @@
if (target_min != -1 && target_max != -1) {
gchar *var;
- /* use the requested fps or clip to min/max */
- if (fps > (target_max / 1000) || fps == -1) {
- gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
- target_max / 1000, 1, NULL);
- GST_DEBUG ("using frame rate by target_max %d", target_max / 1000 );
- } else if (fps < (target_min / 1000)) {
- gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
- target_min / 1000, 1, NULL);
- GST_DEBUG ("using frame rate by target_min %d", target_min / 1000 );
- } else {
- gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
- fps, 1, NULL);
- GST_DEBUG ("using frame rate by requested fps %d", fps );
- }
+ /* use the max */
+ gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
+ target_max / 1000, 1, NULL);
var = g_strdup_printf ("%d,%d", target_min, target_max);
gst_droidcamsrc_params_set_string_locked (params, "preview-fps-range", var);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcparams.h
^
|
@@ -38,7 +38,6 @@
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);
@@ -48,7 +47,8 @@
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.20180115.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcphotography.c
^
|
@@ -76,7 +76,6 @@
GList *scene;
GList *wb;
GList *iso;
- gchar *iso_key;
GList *flicker;
};
@@ -86,116 +85,8 @@
gchar *value;
};
-struct DataEntry FlashValues[] = {
- {GST_PHOTOGRAPHY_FLASH_MODE_AUTO, "auto"},
- {GST_PHOTOGRAPHY_FLASH_MODE_OFF, "off"},
- {GST_PHOTOGRAPHY_FLASH_MODE_ON, "on"},
- {GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE, "red-eye"}
-};
-
-struct DataEntry FocusValues[] = {
- {GST_PHOTOGRAPHY_FOCUS_MODE_AUTO, "auto"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_MACRO, "macro"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY, "infinity"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL, "fixed"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED, "edof"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL, "continuous"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED, "continuous"},
- {GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL, "manual"}
-};
-
-struct DataEntry ISOValues[] = {
- {0, "auto"},
- {0, "iso-auto"},
- {1, "ISO_HJR"},
- {100, "ISO100"},
- {100, "iso-100"},
- {100, "100"},
- {200, "ISO200"},
- {200, "iso-200"},
- {200, "200"},
- {400, "ISO400"},
- {400, "iso-400"},
- {400, "400"},
- {800, "ISO800"},
- {800, "iso-800"},
- {800, "800"},
- {1600, "ISO1600"},
- {1600, "1600"},
- {3200, "ISO3200"},
- {3200, "3200"},
- {6400, "ISO6400"},
- {6400, "6400"},
- {12800, "ISO12800"},
- {12800, "12800"}
-};
-
-struct DataEntry WhiteBalanceValues[] = {
- {GST_PHOTOGRAPHY_WB_MODE_AUTO, "auto"},
- {GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT, "daylight"},
- {GST_PHOTOGRAPHY_WB_MODE_CLOUDY, "cloudy-daylight"},
- {GST_PHOTOGRAPHY_WB_MODE_SUNSET, "twilight"},
- {GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN, "incandescent"},
- {GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT, "fluorescent"},
- {GST_PHOTOGRAPHY_WB_MODE_MANUAL, "manual"},
- {GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT, "warm-fluorescent"},
- {GST_PHOTOGRAPHY_WB_MODE_SHADE, "shade"}
-};
-
-struct DataEntry SceneValues[] = {
- {GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT, "portrait"},
- {GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE, "landscape"},
- {GST_PHOTOGRAPHY_SCENE_MODE_SPORT, "sports"},
- {GST_PHOTOGRAPHY_SCENE_MODE_NIGHT, "night"},
- {GST_PHOTOGRAPHY_SCENE_MODE_AUTO, "auto"},
- {GST_PHOTOGRAPHY_SCENE_MODE_ACTION, "action"},
- {GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT, "night-portrait"},
- {GST_PHOTOGRAPHY_SCENE_MODE_THEATRE, "theatre"},
- {GST_PHOTOGRAPHY_SCENE_MODE_BEACH, "beach"},
- {GST_PHOTOGRAPHY_SCENE_MODE_SNOW, "snow"},
- {GST_PHOTOGRAPHY_SCENE_MODE_SUNSET, "sunset"},
- {GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO, "steadyphoto"},
- {GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS, "fireworks"},
- {GST_PHOTOGRAPHY_SCENE_MODE_PARTY, "party"},
- {GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT, "candlelight"},
- {GST_PHOTOGRAPHY_SCENE_MODE_BARCODE, "barcode"},
- {GST_PHOTOGRAPHY_SCENE_MODE_ASD, "asd"},
- {GST_PHOTOGRAPHY_SCENE_MODE_BACKLIGHT, "backlight"},
- {GST_PHOTOGRAPHY_SCENE_MODE_FLOWERS, "flowers"},
- {GST_PHOTOGRAPHY_SCENE_MODE_AR, "AR"},
- {GST_PHOTOGRAPHY_SCENE_MODE_HDR, "hdr"}
-};
-
-struct DataEntry ColourToneValues[] = {
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL, "none"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_SEPIA, "sepia"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEGATIVE, "negative"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRAYSCALE, "mono"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_VIVID, "vivid"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_SOLARIZE, "solarize"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKY_BLUE, "still-sky-blue"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRASS_GREEN, "still-grass-green"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKIN_WHITEN, "still-skin-whiten-medium"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_POSTERIZE, "posterize"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD, "whiteboard"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD, "blackboard"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA, "aqua"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_EMBOSS, "emboss"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKETCH, "sketch"},
- {GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEON, "neon"}
-};
-
-struct DataEntry FlickerValues[] = {
- {GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF, "off"},
- {GST_PHOTOGRAPHY_FLICKER_REDUCTION_50HZ, "50hz"},
- {GST_PHOTOGRAPHY_FLICKER_REDUCTION_60HZ, "60hz"},
- {GST_PHOTOGRAPHY_FLICKER_REDUCTION_AUTO, "auto"}
-};
-
-static GList *gst_droidcamsrc_photography_append_list (GList * list,
- const int key, const gchar * value);
-static GList *gst_droidcamsrc_photography_create_list (const gchar * params,
- struct DataEntry entries[], gsize len);
+static GList *gst_droidcamsrc_photography_load (GKeyFile * file,
+ const gchar * property);
#define PHOTO_IFACE_FUNC(name, tset, tget) \
static gboolean gst_droidcamsrc_get_##name (GstDroidCamSrc * src, tget val); \
@@ -233,14 +124,6 @@
#define SET_ENUM(table,val,droid,memb) \
int x; \
int len = g_list_length (table); \
- if (len == 0) { \
- GST_WARNING_OBJECT (src, "params for %s not yet available. not applying value %d yet", droid, val); \
- GST_OBJECT_LOCK (src); \
- src->photo->settings.memb = val; \
- GST_OBJECT_UNLOCK (src); \
- return FALSE; \
- } \
- \
const gchar *value = NULL; \
for (x = 0; x < len; x++) { \
struct DataEntry *entry = (struct DataEntry *) g_list_nth_data (table, x); \
@@ -607,28 +490,6 @@
{
/* not supported */
}
-
- return TRUE;
-
- case PROP_SUPPORTED_EXPOSURE_MODES:
- {
- int len = g_list_length (src->photo->scene);
- if (len == 0) {
- GST_WARNING_OBJECT (src, "params for scene not yet available.");
- return TRUE;
- }
-
- struct DataEntry *entry;
-
- GList *l;
- gchar *modes = "";
- for (l = src->photo->scene; l != NULL; l = l->next) {
- entry = l->data;
- modes = g_strconcat (modes, ",", entry->value, NULL);
- }
-
- g_value_set_string (value, modes);
- }
return TRUE;
}
@@ -738,9 +599,15 @@
}
void
-gst_droidcamsrc_photography_init (GstDroidCamSrc * src)
+gst_droidcamsrc_photography_init (GstDroidCamSrc * src, gint dev)
{
int x;
+ GKeyFile *file = g_key_file_new ();
+ gchar *file_path =
+ g_strdup_printf ("/%s/gst-droid/gstdroidcamsrc-%d.conf", SYSCONFDIR, dev);
+ GError *err = NULL;
+
+ GST_INFO_OBJECT (src, "using configuration file %s", file_path);
if (!src->photo) {
src->photo = g_slice_new0 (GstDroidCamSrcPhotography);
@@ -769,87 +636,59 @@
src->photo->settings.white_point[x] = 0;
}
}
-}
-void
-gst_droidcamsrc_photography_update_params (GstDroidCamSrc * src)
-{
- /* Set photography parameters from Android HAL */
+ if (!g_key_file_load_from_file (file, file_path, G_KEY_FILE_NONE, &err)) {
+ GST_WARNING ("failed to load configuration file %s: %s", file_path,
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcphotography.h
^
|
@@ -71,13 +71,11 @@
PROP_MAX_EXPOSURE_TIME,
PROP_NOISE_REDUCTION,
PROP_EXPOSURE_MODE,
- PROP_SUPPORTED_EXPOSURE_MODES
} GstDroidCamSrcProperties;
void gst_droidcamsrc_photography_register (gpointer g_iface, gpointer iface_data);
void gst_droidcamsrc_photography_add_overrides (GObjectClass * klass);
-void gst_droidcamsrc_photography_init (GstDroidCamSrc * src);
-void gst_droidcamsrc_photography_update_params (GstDroidCamSrc * src);
+void gst_droidcamsrc_photography_init (GstDroidCamSrc * src, gint dev);
void gst_droidcamsrc_photography_destroy (GstDroidCamSrc * src);
gboolean gst_droidcamsrc_photography_get_property (GstDroidCamSrc * src, guint prop_id,
GValue * value, GParamSpec * pspec);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcamsrc/gstdroidcamsrcrecorder.c
^
|
@@ -85,10 +85,6 @@
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;
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcodec/gstdroidaenc.c
^
|
@@ -115,14 +115,6 @@
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"));
@@ -515,23 +507,8 @@
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.20180115.0.tar.gz/gst/droidcodec/gstdroidvdec.c
^
|
@@ -27,7 +27,6 @@
#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() */
@@ -257,8 +256,6 @@
gsize width = info->width;
gsize size;
gboolean use_droid_convert;
- gboolean use_external_buffer;
- guint8 *data = NULL;
gboolean ret;
GstMapInfo map_info;
@@ -266,7 +263,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", width);
+ GST_INFO_OBJECT (dec, "using codec supplied width %d", height);
}
if (dec->codec_type->quirks & USE_CODEC_SUPPLIED_HEIGHT_VALUE) {
@@ -275,15 +272,9 @@
}
size = width * height * 3 / 2;
- use_droid_convert = dec->convert;
- use_external_buffer = use_droid_convert && gst_buffer_get_size (out) != size;
+ use_droid_convert = dec->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;
@@ -291,131 +282,34 @@
}
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) {
+ if (droid_media_convert_to_i420 (dec->convert, in, map_info.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;
- }
-
- /* 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;
- }
- }
} 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);
-
- 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);
-
- } else if (dec->hal_format == c.OMX_COLOR_FormatYUV420SemiPlanar) {
- GST_DEBUG_OBJECT (dec,
- "Converting from OMX_COLOR_FormatYUV420SemiPlanar");
- gint stride = width;
- gint slice_height = ALIGN_SIZE (height, 16);
- gint top = dec->crop_rect.top;
- gint left = dec->crop_rect.left;
-
- 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);
-
- } else {
- GST_ELEMENT_ERROR (dec, LIBRARY, FAILED, (NULL),
- ("Unknown codec colour format: %d", dec->hal_format));
- ret = FALSE;
- goto out;
- }
+ /* 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);
}
@@ -733,13 +627,11 @@
droid_media_codec_get_output_info (dec->codec, &md, &rect);
GST_INFO_OBJECT (dec,
- "codec reported state: colour: %d, width: %d, height: %d, crop: %d,%d %d,%d",
- md.hal_format, md.width, md.height, rect.left, rect.top, rect.right,
- rect.bottom);
+ "codec reported state: width: %d, height: %d, crop: %d,%d %d,%d",
+ md.width, md.height, rect.left, rect.top, rect.right, rect.bottom);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/gst/droidcodec/gstdroidvdec.h
^
|
@@ -81,7 +81,6 @@
GstVideoCodecState *in_state;
GstVideoCodecState *out_state;
DroidMediaConvert *convert;
- gint32 hal_format;
};
struct _GstDroidVDecClass
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20180115.0.tar.gz/tools/gstdroidcamsrcconf.c
^
|
@@ -123,11 +123,9 @@
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"),
- ADD_ENTRY (1, "ISO_HJR"),
ADD_ENTRY (100, "ISO100"),
ADD_ENTRY (100, "iso-100"),
ADD_ENTRY (200, "ISO200"),
@@ -138,23 +136,8 @@
ADD_ENTRY (800, "iso-800"),
ADD_ENTRY (1600, "ISO1600"),
ADD_ENTRY (3200, "ISO3200"),
- ADD_ENTRY (6400, "ISO6400"),
- ADD_ENTRY (12800, "ISO12800"),
{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"),
- ADD_ENTRY (3200, "3200"),
- ADD_ENTRY (6400, "6400"),
- ADD_ENTRY (12800, "12800"),
- {NULL, -1}
- }},
{"antibanding-values", "flicker-mode", {
ADD_ENTRY (GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF, "off"),
ADD_ENTRY (GST_PHOTOGRAPHY_FLICKER_REDUCTION_50HZ, "50hz"),
|