Hi,
I previously used Gstreamer-0.10, in which I read a video file using fread() system call. The read file is buffer injected in the following method, where u8TxBuf has the file read output. This method of using fread() is because of the need to transport the video packets through the socket from one node to the other.
Code in GStreamer-0.10:
VideoOutputPointer = g_malloc(1316);
memcpy(VideoOutputPointer,&u8TxBuf,1316);
sample_cnt=0;
InjectionBuffer = gst_buffer_new();
GST_BUFFER_MALLOCDATA(InjectionBuffer) = VideoOutputPointer;
GST_BUFFER_SIZE(InjectionBuffer) = 1316;
GST_BUFFER_DATA(InjectionBuffer) = VideoOutputPointer;
ret = gst_app_src_push_buffer(Access2Player->StreamSource, InjectionBuffer);
The Red Highlighted lines are some changes when we shift to Gstreamer-1.0. Errors were thrown at the time of compiling. Now, I changed this portion of code in the following manner.
Code in Gstreamer-1.0:
VideoOutputPointer = g_malloc(1316);
memcpy(VideoOutputPointer,&u8TxBuf,1316);
sample_cnt=0;
InjectionBuffer = gst_buffer_new();
mem = gst_allocator_alloc (NULL, 1316, NULL);
gst_buffer_insert_memory (InjectionBuffer, -1, mem);
gst_memory_map (mem, &info, GST_MAP_WRITE);
for(i=0;i<info.size; i++)
{
info.data= ptr[i];
}
ret = gst_app_src_push_buffer(Access2Player->StreamSource, InjectionBuffer);
I have modified my code in this way. I see that info.size returns my desired 1316 bytes and the gst_app_src_push_buffer() succeeds. But the Dynamic padding process next to buffer injection doesn't happen because of some reasons like unavailability of data or wrong data.
Kindly someone help me in solving this issue.
Thanks & Regards,
Shylesh S.