avoid to copy video frame to appsrc in gstreamer

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

avoid to copy video frame to appsrc in gstreamer

448件の閲覧回数
yibhan
Contributor III

I am trying to deliver the NV12 video format frame v4l2h264enc. At this time, I am going to do this by passing the video frame to appsrc. The video resolution is 1920x1080, but it takes a lot of time to copy memory. Is there any way to avoid memory copy?

Belows are my psuedo code : I'd like to remove memcpy to access to directly some memory

My raw data are located in g2d memory, It may not be cpu area but, gpu area. So, when I am going to use raw video frame to gstreamer which is operated in cpu area(? not sure), I can copy video frame to user area in gstreamer, but it takes time to complete for every video frame. So, I have to change my scheme that no use memcpy to access directly raw video frame in gstreamer. Do you have any ideas or guides?

gstbuf = gst_buffer_new_allocate(NULL, size, NULL);

gst_buffer_map(gstbuf, &map, GST_MAP_WRITE);

memcpy(map.data, data, size);

gst_buffer_unmap(gstbuf, &map);

gst_app_src_push_buffer(GST_APP_SRC(appsrc), gstbuf);

 

0 件の賞賛
0 返答(返信)