X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fgstmarudec.c;h=b7d543014c47a94ce03980c06762e1703c35f6e8;hb=refs%2Fchanges%2F26%2F11826%2F1;hp=0798ff45e8a6d905fb5ee91a414c1857b6e15b7d;hpb=4b9e3b6ab217999a2c7557f34f2a9b3983a1e2b8;p=platform%2Fadaptation%2Femulator%2Fgst-plugins-emulator.git diff --git a/src/gstmarudec.c b/src/gstmarudec.c index 0798ff4..b7d5430 100644 --- a/src/gstmarudec.c +++ b/src/gstmarudec.c @@ -231,8 +231,11 @@ gst_marudec_do_qos (GstMaruDec *marudec, GstClockTime timestamp, // if (marudec->waiting_for_key) { if (0) { res = FALSE; - } else { } +#if 0 + else { + } +#endif GstClockTime stream_time, jitter; GstMessage *qos_msg; @@ -299,7 +302,7 @@ gst_marudec_drain (GstMaruDec *marudec) oclass = (GstMaruDecClass *) (G_OBJECT_GET_CLASS (marudec)); - // TODO: drain + CODEC_LOG (DEBUG, "drain frame\n"); #if 1 { gint have_data, len, try = 0; @@ -512,12 +515,10 @@ gst_marudec_sink_event (GstPad *pad, GstEvent *event) break; case GST_EVENT_FLUSH_STOP: { -#if 0 if (marudec->opened) { - // TODO: what does avcodec_flush_buffers do? - maru_avcodec_flush_buffers (marudec->context, marudec->dev); + codec_flush_buffers (marudec->context, marudec->dev); } -#endif + gst_marudec_reset_ts (marudec); gst_marudec_reset_qos (marudec); #if 0 @@ -937,18 +938,18 @@ get_output_buffer (GstMaruDec *marudec, GstBuffer **outbuf) return GST_FLOW_ERROR; } - CODEC_LOG (DEBUG, "outbuf size of decoded video: %d\n", pict_size); + CODEC_LOG (DEBUG, "outbuf size of decoded video: %d\n", pict_size); - if (pict_size < (256 * 1024)) { - /* GstPadBufferAllocFunction is mostly overridden by elements that can - * provide a hardware buffer in order to avoid additional memcpy operations. - */ + if (pict_size < (256 * 1024)) { + /* GstPadBufferAllocFunction is mostly overridden by elements that can + * provide a hardware buffer in order to avoid additional memcpy operations. + */ gst_pad_set_bufferalloc_function( GST_PAD_PEER(marudec->srcpad), (GstPadBufferAllocFunction) codec_buffer_alloc); - } else { - CODEC_LOG (DEBUG, "request a large size of memory\n"); - } + } else { + CODEC_LOG (DEBUG, "request large size of memory. pict_size: %d\n", pict_size); + } ret = gst_pad_alloc_buffer_and_set_caps (marudec->srcpad, GST_BUFFER_OFFSET_NONE, pict_size, @@ -1061,11 +1062,11 @@ gst_marudec_video_frame (GstMaruDec *marudec, guint8 *data, guint size, codec_decode_video (marudec->context, data, size, dec_info->idx, in_offset, outbuf, &have_data, marudec->dev); - +#if 0 + // skip_frame if (!decode) { - // skip_frame } - +#endif GST_DEBUG_OBJECT (marudec, "after decode: len %d, have_data %d", len, have_data); @@ -1081,8 +1082,14 @@ gst_marudec_video_frame (GstMaruDec *marudec, guint8 *data, guint size, #endif if (len < 0 || have_data <= 0) { +// if (len < 0) { // have_data <= 0) { GST_DEBUG_OBJECT (marudec, "return flow %d, out %p, len %d", *ret, *outbuf, len); + + CODEC_LOG (DEBUG, + "return flow %d, out %p, len %d, have_data: %d\n", + *ret, *outbuf, len, have_data); + return len; } @@ -1402,12 +1409,12 @@ gst_marudec_chain (GstPad *pad, GstBuffer *buffer) discont = GST_BUFFER_IS_DISCONT (buffer); -// FIXME + // FIXME if (G_UNLIKELY (discont)) { GST_DEBUG_OBJECT (marudec, "received DISCONT"); gst_marudec_drain (marudec); // gst_marudec_flush_pcache (marudec); -// maru_avcodec_flush buffers (marudec->context, marudec->dev); + codec_flush_buffers (marudec->context, marudec->dev); marudec->discont = TRUE; gst_marudec_reset_ts (marudec); }