From: Wim Taymans Date: Thu, 22 Sep 2005 11:28:23 +0000 (+0000) Subject: gst/rtp/gstrtpmp4venc.c: Don't fragment packets with multiple frames. X-Git-Tag: RELEASE-0_9_3~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4aac63130ad939751a44f827d11f8d0ed79e53ac;p=platform%2Fupstream%2Fgst-plugins-good.git gst/rtp/gstrtpmp4venc.c: Don't fragment packets with multiple frames. Original commit message from CVS: * gst/rtp/gstrtpmp4venc.c: (gst_rtpmp4venc_class_init), (gst_rtpmp4venc_parse_data), (gst_rtpmp4venc_handle_buffer), (gst_rtpmp4venc_set_property): Don't fragment packets with multiple frames. --- diff --git a/ChangeLog b/ChangeLog index 704ddb1..f43cc33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2005-09-22 Wim Taymans + * gst/rtp/gstrtpmp4venc.c: (gst_rtpmp4venc_class_init), + (gst_rtpmp4venc_parse_data), (gst_rtpmp4venc_handle_buffer), + (gst_rtpmp4venc_set_property): + Don't fragment packets with multiple frames. + +2005-09-22 Wim Taymans + * gst/rtp/TODO: * gst/rtp/gstrtpmp4vdec.c: (gst_rtpmp4vdec_setcaps): * gst/rtp/gstrtpmp4venc.c: (gst_rtpmp4venc_class_init), diff --git a/gst/rtp/gstrtpmp4venc.c b/gst/rtp/gstrtpmp4venc.c index 59603f8..08d9b2d 100644 --- a/gst/rtp/gstrtpmp4venc.c +++ b/gst/rtp/gstrtpmp4venc.c @@ -370,6 +370,7 @@ gst_rtpmp4venc_handle_buffer (GstBaseRTPPayload * basepayload, /* strip off header */ subbuf = gst_buffer_create_sub (buffer, strip, size - strip); + GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buffer); gst_buffer_unref (buffer); buffer = subbuf; @@ -381,20 +382,24 @@ gst_rtpmp4venc_handle_buffer (GstBaseRTPPayload * basepayload, /* if we need to flush, do so now */ if (flush) { ret = gst_rtpmp4venc_flush (rtpmp4venc); + avail = 0; + rtpmp4venc->first_ts = GST_BUFFER_TIMESTAMP (buffer); } - /* push new data */ - gst_adapter_push (rtpmp4venc->adapter, buffer); - avail = gst_adapter_available (rtpmp4venc->adapter); /* get packet length of data and see if we exceeded MTU. */ - packet_len = gst_rtpbuffer_calc_packet_len (avail, 0, 0); + packet_len = gst_rtpbuffer_calc_packet_len (avail + size, 0, 0); if (packet_len > GST_BASE_RTP_PAYLOAD_MTU (rtpmp4venc)) { ret = gst_rtpmp4venc_flush (rtpmp4venc); + avail = 0; + rtpmp4venc->first_ts = GST_BUFFER_TIMESTAMP (buffer); } + /* push new data */ + gst_adapter_push (rtpmp4venc->adapter, buffer); + return ret; } diff --git a/gst/rtp/gstrtpmp4vpay.c b/gst/rtp/gstrtpmp4vpay.c index 59603f8..08d9b2d 100644 --- a/gst/rtp/gstrtpmp4vpay.c +++ b/gst/rtp/gstrtpmp4vpay.c @@ -370,6 +370,7 @@ gst_rtpmp4venc_handle_buffer (GstBaseRTPPayload * basepayload, /* strip off header */ subbuf = gst_buffer_create_sub (buffer, strip, size - strip); + GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buffer); gst_buffer_unref (buffer); buffer = subbuf; @@ -381,20 +382,24 @@ gst_rtpmp4venc_handle_buffer (GstBaseRTPPayload * basepayload, /* if we need to flush, do so now */ if (flush) { ret = gst_rtpmp4venc_flush (rtpmp4venc); + avail = 0; + rtpmp4venc->first_ts = GST_BUFFER_TIMESTAMP (buffer); } - /* push new data */ - gst_adapter_push (rtpmp4venc->adapter, buffer); - avail = gst_adapter_available (rtpmp4venc->adapter); /* get packet length of data and see if we exceeded MTU. */ - packet_len = gst_rtpbuffer_calc_packet_len (avail, 0, 0); + packet_len = gst_rtpbuffer_calc_packet_len (avail + size, 0, 0); if (packet_len > GST_BASE_RTP_PAYLOAD_MTU (rtpmp4venc)) { ret = gst_rtpmp4venc_flush (rtpmp4venc); + avail = 0; + rtpmp4venc->first_ts = GST_BUFFER_TIMESTAMP (buffer); } + /* push new data */ + gst_adapter_push (rtpmp4venc->adapter, buffer); + return ret; }