Need clarification on gstcolorbalance

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Need clarification on gstcolorbalance

Yogesh Marwaha
Hi,

I'm trying to add options of contrast, brightness etc. in my app.
GStreamer's videobalance and xvimagesink elements support
GstColorBalance interface. But in case of xvimagesink, I'm unable
to get a list of channels.

Following is the code snippet I'm using: -

    GstElement *a = gst_element_factory_make("xvimagesink",
"gravity-playbin-video-a");
    if(GST_IS_COLOR_BALANCE(a)){
        qDebug() << "Color balance.";
        const GList * channels =
gst_color_balance_list_channels(GST_COLOR_BALANCE(a));
        if(!channels)
            qDebug() << "Channels is null.";
        while ( channels ) {
            qDebug() << "Channel name:" <<
GST_COLOR_BALANCE_CHANNEL(channels->data)->label;;
            channels = g_list_next(channels);
        }
    }else{
        qDebug() << "No color balance.";
    }

    GstElement *b = gst_element_factory_make("videobalance",
"gravity-playbin-video-b");
    if(GST_IS_COLOR_BALANCE(b)){
        qDebug() << "Color balance.";
        const GList * channels =
gst_color_balance_list_channels(GST_COLOR_BALANCE(b));
        if(!channels)
            qDebug() << "Channels is null.";
        while ( channels ) {
            qDebug() << "Channel name:" <<
GST_COLOR_BALANCE_CHANNEL(channels->data)->label;;
            channels = g_list_next(channels);
        }
    }else{
        qDebug() << "No color balance.";
    }


Here is the output: -
Color balance.
Channels is null.
Color balance.
Channel name: "HUE"
Channel name: "SATURATION"
Channel name: "BRIGHTNESS"
Channel name: "CONTRAST"


What could be the cause of problem? How should I do it properly?

Regards,

Yogesh Marwaha
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need clarification on gstcolorbalance

Tim-Philipp Müller-2
On Sun, 2012-05-20 at 13:17 +0530, Yogesh Marwaha wrote:

> Hi,
>
> I'm trying to add options of contrast, brightness etc. in my app.
> GStreamer's videobalance and xvimagesink elements support
> GstColorBalance interface. But in case of xvimagesink, I'm unable
> to get a list of channels.
>
> Following is the code snippet I'm using: -
>
>     GstElement *a = gst_element_factory_make("xvimagesink",
> "gravity-playbin-video-a");
>     if(GST_IS_COLOR_BALANCE(a)){
>  (...)
> What could be the cause of problem? How should I do it properly?

Try adding a

  gst_element_set_state (a, GST_STATE_READY);

right after creating it.

Cheers
 -Tim

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need clarification on gstcolorbalance

Yogesh Marwaha
On 20 May 2012 16:38, Tim-Philipp Müller <[hidden email]> wrote:

> On Sun, 2012-05-20 at 13:17 +0530, Yogesh Marwaha wrote:
>> Hi,
>>
>> I'm trying to add options of contrast, brightness etc. in my app.
>> GStreamer's videobalance and xvimagesink elements support
>> GstColorBalance interface. But in case of xvimagesink, I'm unable
>> to get a list of channels.
>>
>> Following is the code snippet I'm using: -
>>
>>     GstElement *a = gst_element_factory_make("xvimagesink",
>> "gravity-playbin-video-a");
>>     if(GST_IS_COLOR_BALANCE(a)){
>>  (...)
>> What could be the cause of problem? How should I do it properly?
>
> Try adding a
>
>  gst_element_set_state (a, GST_STATE_READY);
>
> right after creating it.

Now I get the following:-
Channel name: XV_BRIGHTNESS
Channel name: XV_CONTRAST

I was also expecting HUE and SATURATION to be listed.

Anyways, my main problem is that values of these properties provided
by xvimagesink & videobalance elements are imcompatiable, so I was
searching for a standard way of setting their values so that I may use
same code, no matter I'm using xvimagesink or videobalance+ximagesink.

What do you recommend? Would I have to/(Should I) use separate code
for both cases? Or do I forget that xvimagesink offers these
properties?

PS: Upto now I had been thinking that standard property names in
gstreamer (e.g. the volume property) imply standard values, and all my
code also assumes that.

Regards,

Yogesh Marwaha
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel