Hi guys .
I have an application which use gstreamer appsink and appsrc.
Here is my pipleline :
filesrc location=/usr/local/1080P.mp4 ! decodebin name=dec ! videoconvert ! appsink name="appsink"
appsrc name="appsrc" ! autovideosink
Then I continuely get buffer from appsink successfully like that
sink_pipeline__->GetLatestSample(&sample);
caps = gst_sample_get_caps(sample);
buffer = gst_sample_get_buffer(sample);
s = gst_caps_get_structure(caps, 0);
gst_structure_get_int(s, "height", &height);
gst_structure_get_int(s, "width", &width);
format = gst_structure_get_string(s, "format");
size = gst_buffer_get_size(buffer);
printf("height = %d width =%d format%s size=%d\n", height , width,format,size);
Then I push buffer to appsrc like that
GstFlowReturn ret = gst_app_src_push_buffer((GstAppSrc*)appsrc, buffer); // buffer released automatically
if(ret == GST_FLOW_OK){
std::cout << "GstFlowReturn OK ";
}
It show me the return value of gst_app_src_push_buffer is GST_FLOW_OK which indicate I have successfully push to the appsrc .
Then why my autovideosink can no show any video even I can see the display window .
Am I miss something important ?