Need clarification on gstcolorbalance

Yogesh Marwaha yogeshm.007 at gmail.com
Sun May 20 00:47:01 PDT 2012


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


More information about the gstreamer-devel mailing list