This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMDXIDK57X-LCD: Can't add probe to GStreamer

Part Number: TMDXIDK57X-LCD

Tool/software: TI C/C++ Compiler

Hello everyone,

I am trying to add a probe to a pad in GStreamer in  the following code, I can successfully compile and run the code on my vbox Ubuntu, but when I try to run it on my IDK nothing happens and LCD remains black,

#include <gst/gst.h>
#include <iostream>


static GstPadProbeReturn cb_onProbe(GstPad * Ipad , GstPadProbeInfo* Iinfo , gpointer userData ){
    std::cout << "cb\n";
}



int main(int argc , char* argv[]){

    GstElement *myPipeline, *myTextOverlay , *myVideoSrc, *myVideoSink , *myCapsFilters;
    GMainLoop * myLoop;
    GstCaps  *myCaps;
    GstPad * mySrcPad ;

    gst_init(&argc , &argv);

    myVideoSrc = gst_element_factory_make("videotestsrc", "mySrcVid");
    myVideoSink = gst_element_factory_make("autovideosink", "mySinkVid");
    myTextOverlay = gst_element_factory_make("textoverlay", "myTxtOvr");
    myCapsFilters =  gst_element_factory_make("capsfilter", "myCpsFltr");
    myPipeline = gst_pipeline_new("myPipe");

    if( !myPipeline ||  !myTextOverlay ||  !myVideoSrc || !myVideoSink || !myCapsFilters){
        std::cout << "failed to create some elements!!\n";
        return -1;
    }

    myCaps = gst_caps_new_simple("video/x-raw",
                                 "width",G_TYPE_INT, 640,
                                 "height",G_TYPE_INT, 480,
                                 "framerate",GST_TYPE_FRACTION, 1,1,
                                 NULL
                                 );
    g_object_set(G_OBJECT(myCapsFilters) , "caps" , myCaps , NULL);

    gst_bin_add_many(GST_BIN(myPipeline) , myVideoSrc ,myCapsFilters, myTextOverlay ,myVideoSink, NULL  );

    if(gst_element_link_many(myVideoSrc , myCapsFilters , myTextOverlay ,myVideoSink, NULL) != true){
        std::cout << "failed to link some elements!!\n";
        return -1;
    }

    g_object_set(myTextOverlay , "text", "my text", NULL);


    mySrcPad = gst_element_get_static_pad(myVideoSrc , "src");
    gst_pad_add_probe(mySrcPad , GST_PAD_PROBE_TYPE_BUFFER , (GstPadProbeCallback)cb_onProbe, NULL , NULL );

    GstStateChangeReturn retVal =  gst_element_set_state(myPipeline , GST_STATE_PLAYING);
    if(retVal == GST_STATE_CHANGE_FAILURE){
        std::cout << "failed to playing!\n";
        return -1;
    }



    myLoop = g_main_loop_new(NULL, false);

    std::cout << "running...\n";
    g_main_loop_run(myLoop);


    return  0;
}

even if I comment the line with gst_pad_add_probe (line 50), the program works correctly in IDK (without calling the callback function). I'm using processor sdk linux rt 4.9.

any help would be appriciated,

B.R,

Alex.