diff options
author | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-12-15 16:39:17 +0530 |
---|---|---|
committer | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-12-15 16:39:17 +0530 |
commit | 7ee74a04ba10401a7c7f92026a95f3007e281756 (patch) | |
tree | 89adcef30dfeb8a1935f1d4f65de4262312dfa90 | |
parent | 857bcd8a98d4fea207c40c565484ff008dfe37c2 (diff) |
qcvideodec: Send frame info to the decoder
Send the frame info to the h/w decoder. Otherwise
when the sync frame/keyframe arrives, it will return
all the decoded frames before accepting the new frame.
-rw-r--r-- | src/gstqcvideodec.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/gstqcvideodec.c b/src/gstqcvideodec.c index 6ccb4af..296d6ea 100644 --- a/src/gstqcvideodec.c +++ b/src/gstqcvideodec.c @@ -632,35 +632,41 @@ static GstFlowReturn gst_qcvideodec_handle_frame (GstVideoDecoder *decoder_cxt,G static GstFlowReturn gst_qcvideodec_decode_buffer(Gstqcvideodec *dec, GstBuffer * buf,GstVideoCodecFrame * frame) { Gstqcvideodec *decode_context; - int size; struct vdec_ioctl_msg ioctl_msg = {NULL,NULL}; - struct vdec_input_frameinfo frameinfo; - unsigned int data_len =0; + struct vdec_input_frameinfo frameinfo = {NULL}; GstMapInfo in_map_info = GST_MAP_INFO_INIT; decode_context = GST_QCVIDEODEC (dec); - size = gst_buffer_get_size (buf); - data_len = size; + + if(GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT(frame)) + { + frameinfo.flags |= VDEC_BUFFERFLAG_SYNCFRAME; + } + else + { + frameinfo.flags |= VDEC_BUFFERFLAG_DECODEONLY; + } + gst_buffer_map(buf, &in_map_info, GST_MAP_READ); memcpy(temp_input_buffer->bufferaddr,in_map_info.data,in_map_info.size); frameinfo.bufferaddr = temp_input_buffer->bufferaddr; - frameinfo.offset = 0; - frameinfo.pmem_fd = temp_input_buffer->pmem_fd; - frameinfo.pmem_offset = temp_input_buffer->offset; - frameinfo.datalen = data_len; - frameinfo.client_data = (struct vdec_bufferpayload *)\ + frameinfo.offset = 0; + frameinfo.pmem_fd = temp_input_buffer->pmem_fd; + frameinfo.pmem_offset = temp_input_buffer->offset; + frameinfo.datalen = in_map_info.size; + frameinfo.client_data = (struct vdec_bufferpayload *)\ temp_input_buffer; - ioctl_msg.in = &frameinfo; - ioctl_msg.out = NULL; - if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_DECODE_FRAME, - &ioctl_msg) < 0) - { - GST_ERROR("\n Decoder frame failed"); - sem_post (&decode_context->sem_synchronize); - return GST_FLOW_ERROR; - } + ioctl_msg.in = &frameinfo; + ioctl_msg.out = NULL; + if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_DECODE_FRAME, + &ioctl_msg) < 0) + { + GST_ERROR("\n Decoder frame failed"); + sem_post (&decode_context->sem_synchronize); + return GST_FLOW_ERROR; + } gst_buffer_unmap(buf, &in_map_info); gst_buffer_unref(buf); |