mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
gst-libs/gst/colorbalance/colorbalance.h: Adding a type to the colorbalance interface stating if it is hardware based...
Original commit message from CVS: 2004-01-13 Julien MOUTTE <julien@moutte.net> * gst-libs/gst/colorbalance/colorbalance.h: Adding a type to the colorbalance interface stating if it is hardware based or software based. * gst/videofilter/gstvideobalance.c: (gst_videobalance_planar411): Removing a trailing comma. * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get), (gst_xvimagesink_colorbalance_init): Integrating a patch from Jon Trowbridge <trow@ximian.com> querying Xv adaptor for min/max value as the documentation seems to be wrong on the -1000 to 1000 interval.
This commit is contained in:
parent
69d6c8c7c4
commit
0aef65d54e
5 changed files with 54 additions and 7 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2004-01-13 Julien MOUTTE <julien@moutte.net>
|
||||
|
||||
* gst-libs/gst/colorbalance/colorbalance.h: Adding a type to the
|
||||
colorbalance interface stating if it is hardware based or software
|
||||
based.
|
||||
* gst/videofilter/gstvideobalance.c: (gst_videobalance_planar411):
|
||||
Removing a trailing comma.
|
||||
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
|
||||
(gst_xvimagesink_colorbalance_init): Integrating a patch from Jon
|
||||
Trowbridge <trow@ximian.com> querying Xv adaptor for min/max value as
|
||||
the documentation seems to be wrong on the -1000 to 1000 interval.
|
||||
|
||||
2004-01-12 David Schleef <ds@schleef.org>
|
||||
|
||||
* gst/debug/efence.c: (gst_efence_init), (gst_efence_chain),
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit cd5507ae3df8dc48c07df9e37878846b6b79faa1
|
||||
Subproject commit c81ad072c76522175cbddead96d6f3c448068d67
|
|
@ -43,10 +43,18 @@ G_BEGIN_DECLS
|
|||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceClass))
|
||||
|
||||
typedef struct _GstColorBalance GstColorBalance;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_COLOR_BALANCE_HARDWARE,
|
||||
GST_COLOR_BALANCE_SOFTWARE
|
||||
} GstColorBalanceType;
|
||||
|
||||
typedef struct _GstColorBalanceClass {
|
||||
GTypeInterface klass;
|
||||
|
||||
GstColorBalanceType balance_type;
|
||||
|
||||
/* virtual functions */
|
||||
const GList * (* list_channels) (GstColorBalance *balance);
|
||||
|
||||
|
|
|
@ -43,10 +43,18 @@ G_BEGIN_DECLS
|
|||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceClass))
|
||||
|
||||
typedef struct _GstColorBalance GstColorBalance;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_COLOR_BALANCE_HARDWARE,
|
||||
GST_COLOR_BALANCE_SOFTWARE
|
||||
} GstColorBalanceType;
|
||||
|
||||
typedef struct _GstColorBalanceClass {
|
||||
GTypeInterface klass;
|
||||
|
||||
GstColorBalanceType balance_type;
|
||||
|
||||
/* virtual functions */
|
||||
const GList * (* list_channels) (GstColorBalance *balance);
|
||||
|
||||
|
|
|
@ -529,7 +529,8 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink)
|
|||
{
|
||||
GstXContext *xcontext = NULL;
|
||||
XPixmapFormatValues *px_formats = NULL;
|
||||
gint nb_formats = 0, i;
|
||||
gint nb_formats = 0, i, j, N_attr;
|
||||
XvAttribute *xv_attr;
|
||||
char *channels[4] = { "XV_HUE", "XV_SATURATION",
|
||||
"XV_BRIGHTNESS", "XV_CONTRAST" };
|
||||
|
||||
|
@ -616,21 +617,38 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink)
|
|||
g_free (xcontext);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_mutex_unlock (xvimagesink->x_lock);
|
||||
|
||||
xv_attr = XvQueryPortAttributes (xcontext->disp,
|
||||
xcontext->xv_port_id,
|
||||
&N_attr);
|
||||
|
||||
|
||||
/* Generate the channels list */
|
||||
for (i = 0; i < (sizeof (channels) / sizeof (char *)); i++)
|
||||
{
|
||||
GstColorBalanceChannel *channel;
|
||||
|
||||
XvAttribute *matching_attr = NULL;
|
||||
|
||||
if (xv_attr != NULL)
|
||||
{
|
||||
for (j = 0; j < N_attr && matching_attr == NULL; ++j)
|
||||
if (! g_ascii_strcasecmp (channels[i], xv_attr[j].name))
|
||||
matching_attr = xv_attr + j;
|
||||
}
|
||||
|
||||
channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL);
|
||||
channel->label = g_strdup (channels[i]);
|
||||
channel->min_value = -1000;
|
||||
channel->max_value = 1000;
|
||||
channel->min_value = matching_attr ? matching_attr->min_value : -1000;
|
||||
channel->max_value = matching_attr ? matching_attr->max_value : 1000;
|
||||
|
||||
xcontext->channels_list = g_list_append (xcontext->channels_list,
|
||||
channel);
|
||||
}
|
||||
|
||||
if (xv_attr)
|
||||
XFree (xv_attr);
|
||||
|
||||
g_mutex_unlock (xvimagesink->x_lock);
|
||||
|
||||
return xcontext;
|
||||
}
|
||||
|
@ -1283,6 +1301,7 @@ gst_xvimagesink_colorbalance_get_value (GstColorBalance *balance,
|
|||
static void
|
||||
gst_xvimagesink_colorbalance_init (GstColorBalanceClass *iface)
|
||||
{
|
||||
iface->balance_type = GST_COLOR_BALANCE_HARDWARE;
|
||||
iface->list_channels = gst_xvimagesink_colorbalance_list_channels;
|
||||
iface->set_value = gst_xvimagesink_colorbalance_set_value;
|
||||
iface->get_value = gst_xvimagesink_colorbalance_get_value;
|
||||
|
|
Loading…
Reference in a new issue