codekiln 0 Newbie Poster

i am trying to get gstreamer to capture frames and have them put into a picture box on a glade form , this is my Code snippet so far , can anyone give me come guidance

         GstCaps *caps = gst_sample_get_caps(sample);
            // Get a string containg the pixel format, width and height of the image        
        str = gst_caps_get_structure (caps, 0);    
        if( strcmp( gst_structure_get_string (str, "format"),"BGRx") == 0)  
    {
        // Now query the width and height of the image
        gst_structure_get_int (str, "width", &width);
        gst_structure_get_int (str, "height", &height);

 // Create a cv::Mat, copy image data into that and save the image.
        d->OpenCVImage.create(height,width,CV_8UC(4));
        memcpy( d->OpenCVImage.data, info.data, width*height*4);
    }
}
// Calling Unref is important!
gst_buffer_unmap (buffer, &info);
gst_sample_unref(sample);

#endif
d->bImageReceived = true; 
d->pImageEvent->set(); // Set the event, so the image will be processed
}
return GST_FLOW_OK;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.