Hi Leo,
I found the problem, I have installed the development pkg gst-plugins-base-app-dev but missed the main pkg gst-plugins-base-app. Now I can create appsrc element successfully but I still have problems.
I think the gst VPU plugin is unable to recognize the stream type, although when I used the vpu api's it was fine.
I've got the following pipeline:
/*app-source -> vpu-decoder -> mfw_v4lsink-sink*/
gst_element_link ((GstElement*)ctx->appsrc,ctx->vdecoder );
gst_element_link ( ctx->vdecoder, ctx->vdsink );
I'm pushing packets every time I receive need-data signal but after some packet-pushes I get vpudec critical error.
Do I need to add typefind element to the pipeline?
0:00:00.689993667 1669 0x33865580 DEBUG GST_BUS gstbus.c:767:gst_bus_source_dispatch:<bus1> source 0x33864350 handler returns 1
0:00:00.690191833 1669 0x33865580 DEBUG GST_BUS gstbus.c:500:gst_bus_timed_pop_filtered:<bus1> got message 0x33b02cf8, state-changed from avpacket, type mask is 4294967295
0:00:00.690273167 1669 0x33865580 DEBUG GST_BUS gstbus.c:762:gst_bus_source_dispatch:<bus1> source 0x33864350 calling dispatch with state-changed message from element 'avpacket': GstMessageState, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
0:00:00.690561500 1669 0x33865580 DEBUG GST_BUS gstbus.c:767:gst_bus_source_dispatch:<bus1> source 0x33864350 handler returns 1
vdecode.c(852): push_packet
0:00:00.690957833 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c008
vdecode.c(852): push_packet
0:00:00.691188000 1669 0x33864980 DEBUG appsrc gstappsrc.c:988:gst_app_src_create:<avpacket> we have buffer 0x33b0c008 of size 37905
0:00:00.691412833 1669 0x33864980 DEBUG basesrc gstbasesrc.c:2045:gst_base_src_do_sync:<avpacket> we have no clock
0:00:00.691486000 1669 0x33864980 DEBUG basesrc gstbasesrc.c:2231:gst_base_src_get_range:<avpacket> buffer ok
0:00:00.691587500 1669 0x33864980 DEBUG GST_EVENT gstpad.c:5402:gst_pad_send_event:<video-decoder:sink> have event type newsegment
0:00:00.691670500 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c070
0:00:00.691705167 1669 0x33864980 WARN vpudec vpudec.c:1810:gst_vpudec_sink_event: Unsupport newsegment format 2
0:00:00.691823333 1669 0x33864980 DEBUG GST_PADS gstpad.c:5430:gst_pad_send_event:<video-decoder:sink> sent event, result 0
vdecode.c(852): push_packet
0:00:00.692099166 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c0d8
vdecode.c(852): push_packet
0:00:00.692252666 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c140
vdecode.c(852): push_packet
0:00:00.692390000 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c1a8
vdecode.c(852): push_packet
0:00:00.692523166 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c210
vdecode.c(852): push_packet
0:00:00.692649833 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c278
vdecode.c(852): push_packet
0:00:00.693015166 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c2e0
vdecode.c(852): push_packet
0:00:00.693301666 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c348
vdecode.c(852): push_packet
0:00:00.693585500 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c410
vdecode.c(852): push_packet
0:00:00.693864000 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c478
vdecode.c(852): push_packet
0:00:00.694147166 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c4e0
vdecode.c(852): push_packet
0:00:00.694425833 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c548
vdecode.c(852): push_packet
** (console:1669): CRITICAL **: gst_vpudec_chain: assertion `vpudec->context.handle' failed
0:00:00.695730500 1669 0x33864980 INFO basesrc gstbasesrc.c:2562:gst_base_src_loop:<avpacket> pausing after gst_pad_push() = wrong-state
0:00:00.695841500 1669 0x33864980 DEBUG basesrc gstbasesrc.c:2588:gst_base_src_loop:<avpacket> pausing task, reason wrong-state
0:00:00.695928333 1669 0x33864980 DEBUG GST_PADS gstpad.c:5646:gst_pad_pause_task:<avpacket:src> pause task
0:00:00.696020833 1669 0x33864980 DEBUG task gsttask.c:698:gst_task_set_state:<avpacket:src> Changing task 0x33b0b050 to state 2
0:00:00.724539000 1669 0x33865580 DEBUG appsrc gstappsrc.c:1486:gst_app_src_push_buffer_full:<avpacket> queueing buffer 0x33b0c5b0
vdecode.c(852): push_packet