Hue/saturation controls, qtmultimedia viewfinder works
This commit is contained in:
38
pinesrcbin.c
38
pinesrcbin.c
@@ -36,6 +36,8 @@ enum
|
||||
PROP_CAPS,
|
||||
PROP_SYNC,
|
||||
PROP_NUM_BUFFERS,
|
||||
PROP_TEST_PATTERN,
|
||||
PROP_HUE,
|
||||
};
|
||||
|
||||
|
||||
@@ -187,6 +189,14 @@ gst_pinesrcbin_set_property (GObject * object, guint prop_id,
|
||||
if (self->kid)
|
||||
g_object_set_property (G_OBJECT (self->kid), pspec->name, value);
|
||||
break;
|
||||
case PROP_TEST_PATTERN:
|
||||
self->test_pattern = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_HUE:
|
||||
self->hue = g_value_get_int (value);
|
||||
g_print("setting prop hue: %d\n", self->hue);
|
||||
set_camera_control("rear", CONTROL_HUE, self->hue);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -209,6 +219,13 @@ gst_pinesrcbin_get_property (GObject * object, guint prop_id,
|
||||
case PROP_NUM_BUFFERS:
|
||||
g_value_set_int (value, self->num_buffers);
|
||||
break;
|
||||
case PROP_TEST_PATTERN:
|
||||
g_value_set_int (value, self->test_pattern);
|
||||
break;
|
||||
case PROP_HUE:
|
||||
g_print("getting prop hue: %d\n", self->hue);
|
||||
g_value_set_int (value, self->hue);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -221,6 +238,8 @@ gst_pinesrcbin_detect (GstPineSrcBin * self)
|
||||
GstElement *kid, *filter;
|
||||
GstPad *target;
|
||||
GstPineSrcBinClass *klass = GST_PINESRCBIN_GET_CLASS (self);
|
||||
g_print ("gst_pinesrcbin_detect\n");
|
||||
GST_DEBUG_OBJECT (self, "gst_pinesrcbin_detect: setting up element");
|
||||
|
||||
gst_pinesrcbin_clear_kid (self);
|
||||
|
||||
@@ -333,6 +352,7 @@ gst_pinesrcbin_class_init (GstPineSrcBinClass * klass)
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *eklass;
|
||||
|
||||
g_print ("Class init\n");
|
||||
gobject_class = G_OBJECT_CLASS (klass);
|
||||
eklass = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
@@ -349,7 +369,15 @@ gst_pinesrcbin_class_init (GstPineSrcBinClass * klass)
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_NUM_BUFFERS,
|
||||
g_param_spec_int ("num-buffers", "Num-buffers",
|
||||
"Number of buffers until EOS, -1 = unlimited", -1, INT_MAX, 1000,
|
||||
"Number of buffers until EOS, -1 = unlimited", -1, INT_MAX, -1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_TEST_PATTERN,
|
||||
g_param_spec_int ("test-pattern", "Test-pattern",
|
||||
"Test pattern for camera to display", 0, INT_MAX, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_HUE,
|
||||
g_param_spec_int ("hue", "Hue",
|
||||
"Set image hue", 0, 65535, 128,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
@@ -358,10 +386,14 @@ GST_DEBUG_CATEGORY (pinesrcbin_debug);
|
||||
static void
|
||||
gst_pinesrcbin_init (GstPineSrcBin * self)
|
||||
{
|
||||
g_print ("Plugin init\n");
|
||||
self->sync = DEFAULT_SYNC;
|
||||
self->num_buffers = -1;
|
||||
self->test_pattern = 0;
|
||||
self->hue = 128;
|
||||
g_print("initial hue: %d\n", self->hue);
|
||||
GST_DEBUG_OBJECT (self, "Starting device configuration");
|
||||
gst_pinesrcbin_configure_device(self, "rear");
|
||||
self->sync = DEFAULT_SYNC;
|
||||
self->num_buffers = 1000;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
Reference in New Issue
Block a user