@@ -52,7 +52,6 @@
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);
@@ -109,10 +108,6 @@
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,
@@ -586,15 +581,6 @@
}
static gboolean
-is_mp3 (GstDroidCodec * codec G_GNUC_UNUSED, const GstStructure * s)
-{
- gint val, layer;
-
- return gst_structure_get_int (s, "mpegversion", &val) && val == 1 &&
- gst_structure_get_int (s, "layer", &layer) && (layer == 1 || layer == 3);
-}
-
-static gboolean
is_h264_dec (GstDroidCodec * codec G_GNUC_UNUSED, const GstStructure * s)
{
const char *alignment = gst_structure_get_string (s, "alignment");
|
@@ -86,8 +86,116 @@
gchar *value;
};
-static GList *gst_droidcamsrc_photography_load (GKeyFile * file,
- const gchar * property);
+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);
#define PHOTO_IFACE_FUNC(name, tset, tget) \
static gboolean gst_droidcamsrc_get_##name (GstDroidCamSrc * src, tget val); \
@@ -125,6 +233,14 @@
#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); \
@@ -491,6 +607,28 @@
{
/* 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;
}
@@ -600,15 +738,9 @@
}
void
-gst_droidcamsrc_photography_init (GstDroidCamSrc * src, gint dev)
+gst_droidcamsrc_photography_init (GstDroidCamSrc * src)
{
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);
@@ -637,59 +769,87 @@
src->photo->settings.white_point[x] = 0;
}
}
+}
- 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,
- err->message);
- }
-
- if (err) {
- g_error_free (err);
- err = NULL;
- }
+void
+gst_droidcamsrc_photography_update_params (GstDroidCamSrc * src)
+{
+ /* Set photography parameters from Android HAL */
|