camerabin: Use new tags from -base

Replace private tags from metadata plugin with the new generic tags
from -base.
This commit is contained in:
Thiago Santos 2010-08-30 21:21:49 -03:00
parent a40270a054
commit bcc59439bc
2 changed files with 16 additions and 11 deletions

View file

@ -31,7 +31,7 @@ libgstcamerabin_la_CFLAGS = \
libgstcamerabin_la_LIBADD = \ libgstcamerabin_la_LIBADD = \
$(top_builddir)/gst-libs/gst/interfaces/libgstphotography-$(GST_MAJORMINOR).la \ $(top_builddir)/gst-libs/gst/interfaces/libgstphotography-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \ $(GST_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
-lgstinterfaces-$(GST_MAJORMINOR) -lgstinterfaces-$(GST_MAJORMINOR) -lgsttag-$(GST_MAJORMINOR)
libgstcamerabin_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstcamerabin_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstcamerabin_la_LIBTOOLFLAGS = --tag=disable-static libgstcamerabin_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -157,6 +157,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/tag/tag.h>
/* FIXME: include #include <gst/gst-i18n-plugin.h> and use _(" ") */ /* FIXME: include #include <gst/gst-i18n-plugin.h> and use _(" ") */
#include "gstcamerabin.h" #include "gstcamerabin.h"
@ -1338,7 +1339,7 @@ gst_camerabin_get_internal_tags (GstCameraBin * camera)
"image-width", camera->width, "image-height", camera->height, NULL); "image-width", camera->width, "image-height", camera->height, NULL);
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
"capture-digital-zoom", camera->zoom, 100, NULL); GST_TAG_CAPTURING_DIGITAL_ZOOM_RATIO, camera->zoom / 100.0, NULL);
if (gst_element_implements_interface (GST_ELEMENT (camera), if (gst_element_implements_interface (GST_ELEMENT (camera),
GST_TYPE_COLOR_BALANCE)) { GST_TYPE_COLOR_BALANCE)) {
@ -1367,27 +1368,29 @@ gst_camerabin_get_internal_tags (GstCameraBin * camera)
* http://johnlind.tripod.com/science/scienceexposure.html * http://johnlind.tripod.com/science/scienceexposure.html
* *
*/ */
/*
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
"capture-brightness", cur_value, 1, NULL); "capture-brightness", cur_value, 1, NULL);
*/
} else if (!g_ascii_strcasecmp (channel->label, "contrast")) { } else if (!g_ascii_strcasecmp (channel->label, "contrast")) {
/* 0 = Normal, 1 = Soft, 2 = Hard */ /* 0 = Normal, 1 = Soft, 2 = Hard */
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
"capture-contrast", GST_TAG_CAPTURING_CONTRAST,
(cur_value == mid_value) ? 0 : ((cur_value < mid_value) ? 1 : 2), (cur_value == mid_value) ? "normal" : ((cur_value < mid_value)
NULL); ? "soft" : "hard"), NULL);
} else if (!g_ascii_strcasecmp (channel->label, "gain")) { } else if (!g_ascii_strcasecmp (channel->label, "gain")) {
/* 0 = Normal, 1 = Low Up, 2 = High Up, 3 = Low Down, 4 = Hight Down */ /* 0 = Normal, 1 = Low Up, 2 = High Up, 3 = Low Down, 4 = Hight Down */
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
"capture-gain", GST_TAG_CAPTURING_GAIN_ADJUSTMENT,
(guint) (cur_value == mid_value) ? 0 : ((cur_value < (cur_value == mid_value) ? "normal" : ((cur_value <
mid_value) ? 1 : 3), NULL); mid_value) ? "low-gain-up" : "low-gain-down"), NULL);
} else if (!g_ascii_strcasecmp (channel->label, "saturation")) { } else if (!g_ascii_strcasecmp (channel->label, "saturation")) {
/* 0 = Normal, 1 = Low, 2 = High */ /* 0 = Normal, 1 = Low, 2 = High */
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
"capture-saturation", GST_TAG_CAPTURING_SATURATION,
(cur_value == mid_value) ? 0 : ((cur_value < mid_value) ? 1 : 2), (cur_value == mid_value) ? "normal" : ((cur_value < mid_value)
NULL); ? "low-saturation" : "high-saturation"), NULL);
} }
} }
@ -2567,6 +2570,8 @@ gst_camerabin_base_init (gpointer gclass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
gst_tag_register_musicbrainz_tags ();
gst_element_class_set_details_simple (element_class, "Camera Bin", gst_element_class_set_details_simple (element_class, "Camera Bin",
"Generic/Bin/Camera", "Generic/Bin/Camera",
"Handle lot of features present in DSC", "Handle lot of features present in DSC",