diff options
author | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-09-18 04:39:41 +0530 |
---|---|---|
committer | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-09-18 04:39:41 +0530 |
commit | a1ee5a4bcc94f6d0140790ce5d7fb82cd6bc01da (patch) | |
tree | 7dd5f99ab9169d693c9379ed931fcb38986e2476 | |
parent | ca105cbe74d85b3f220a2d4e83266e752478d1ed (diff) |
Added src , sink caps and increased the priority
Src and Sink pads were added for mpeg
Increased the priority, so that playbin pick up the h/w plugin in
g-streamer pipe line.
-rw-r--r-- | src/gstqcvideodec.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/gstqcvideodec.c b/src/gstqcvideodec.c index b358aac..0a8fc05 100644 --- a/src/gstqcvideodec.c +++ b/src/gstqcvideodec.c @@ -85,13 +85,18 @@ enum static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("ANY") + GST_STATIC_CAPS ("video/mpeg") ); static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("ANY") + GST_STATIC_CAPS ( + "video/x-raw, " + "format = (string) NV12_64Z32, " + " framerate=(fraction)[ 0, MAX ], " + " width=(int)[ 1, MAX ], " + " height=(int)[ 1, MAX ]") ); #define gst_qcvideodec_parent_class parent_class @@ -286,7 +291,7 @@ static gboolean gst_qcvideodec_set_format (GstVideoDecoder * decoder,GstVideoCod enum vdec_output_fromat output_format = VDEC_YUV_FORMAT_TILE_4x2; Gstqcvideodec *dec = GST_QCVIDEODEC (decoder); GstBuffer *buffer; - GstMapInfo minfo; + GstMapInfo minfo = GST_MAP_INFO_INIT; struct vdec_input_frameinfo frameinfo; GstVideoInfo *Vinfo; GstCaps *caps; @@ -310,7 +315,7 @@ static gboolean gst_qcvideodec_set_format (GstVideoDecoder * decoder,GstVideoCod gst_pad_set_caps (dec->srcpad, caps); gst_caps_unref (caps); g_print("\n gst_qcvideodec_set_format Enter: caps_data : %s \n",caps_data); - // g_print("\n gst_qcvideodec_set_format Enter: data_size : %d \n",minfo.size); + g_print("\n gst_qcvideodec_set_format Enter: data_size : %d \n",minfo.size); g_print("\n gst_qcvideodec_set_format Enter: width : %d , Height : %d \n",Vinfo->width,Vinfo->height); // dec->decoder_format = VDEC_CODECTYPE_H264; @@ -421,7 +426,6 @@ static gboolean gst_qcvideodec_set_format (GstVideoDecoder * decoder,GstVideoCod { g_print("\n Error in output Buffer allocation"); } - /* Create the output state */ dec->output_state = gst_video_decoder_set_output_state (decoder, fmt,Vinfo->width,Vinfo->height,dec->input_state); gst_video_decoder_negotiate (GST_VIDEO_DECODER (dec)); @@ -1109,7 +1113,7 @@ static void* video_thread (void *context) // break; } /*To-do read the next frame*/ - //g_print("\nVDEC_MSG_RESP_INPUT_BUFFER_DONE Input buffer done for index "); + g_print("\nVDEC_MSG_RESP_INPUT_BUFFER_DONE Input buffer done for index "); sem_post(&decode_context->sem_input_buf_done); // GST_VIDEO_DECODER_STREAM_LOCK (decoder_cxt); @@ -1157,7 +1161,7 @@ static void* video_thread (void *context) } g_frame = gst_video_decoder_get_frame(GST_VIDEO_DECODER(decode_context),frm_count); - // g_print("\n VDEC_MSG_RESP_OUTPUT_BUFFER_DONE for the buffer index : %d and len : %d\n",frm_count,outputbuffer->len); + g_print("\n VDEC_MSG_RESP_OUTPUT_BUFFER_DONE for the buffer index : %d and len : %d\n",frm_count,outputbuffer->len); if(g_frame != NULL) { ret = gst_video_decoder_allocate_output_frame(GST_VIDEO_DECODER(decode_context),g_frame); @@ -1348,8 +1352,8 @@ gst_qcvideodec_class_init (GstqcvideodecClass * klass) gst_element_class_set_details_simple(gstelement_class, "qcvideodec", - "FIXME:Generic", - "FIXME:Generic Template Element", + "Codec/Decoder/Video", + "QCOM mpeg4 decodeR", "c_kamuju <<user@hostname.org>>"); video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_qcvideodec_start); @@ -1445,7 +1449,7 @@ qcvideodec_init (GstPlugin * qcvideodec) // gst_video_decoder_set_packetized (GST_VIDEO_DECODER (qcvideodec), FALSE); // gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (qcvideodec), TRUE); - return gst_element_register (qcvideodec, "qcvideodec", GST_RANK_NONE, + return gst_element_register (qcvideodec, "qcvideodec", GST_RANK_PRIMARY+1, GST_TYPE_QCVIDEODEC); } |