appsink with new-sample gstreamer 1.6

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

appsink with new-sample gstreamer 1.6

This post was updated on .
I have written the following to get the appsink from the pipeline to then get the buffer from the appsink. I was able to successfully make a grab seems like since no errors. I put the cout in the beginning to see if I got a signal but the cout in the first line of the function doesn't event show. It's like there is nothing that i coming in or what. Any Ideas? If need more code, I can provide.

_videoD.srcPipeline =
"rtspsrc location=videoURI name=rtspsrc "\
                        "! rtph264depay ! h264parse "\
                        "! mpegpsmux name=mux ! appsink blocksize=100 sync=false max-buffers=1 name=EOfSinkName rtspsrc. "\
                        "! rtpmp4gdepay ! decodebin ! mux.

_videoD.sink = gst_bin_get_by_name(GST_BIN(_videoD.srcPipeline),_videoD._EOSsink.c_str());
        g_signal_connect (_videoD.sink, "new-sample",  G_CALLBACK (appsink_ToFile),&_videoD);

GstFlowReturn PipelineClass::appsink_ToFile (GstElement* object,VideoData user_data)
        std::cout << "Entered----------------------------------------------------------------------" << std::endl;
        GstSample* sample = NULL;
        GstCaps* caps;
        GstBuffer* buffer;
        GstMapInfo map;

        if(sample != NULL)
                std::cout << "Got Sample----------------------------------------------------" << std::endl;
                FILE* ufile = file;
          //GstAppSink* app_sink = (GstAppSink*) object;
          //GstSample * sample = gst_app_sink_pull_sample(app_sink);
          buffer = gst_sample_get_buffer(sample);
          caps = gst_sample_get_caps(sample);

          if(gst_buffer_map (buffer, &map, GST_MAP_READ))
          gst_util_dump_mem (, map.size);
          gst_buffer_unmap (buffer, &map);
                std::cout << "no sample" << std::endl;

        return GST_FLOW_OK;
Gstreamer 1.14.3