From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5206D46F19 for ; Thu, 24 Aug 2023 20:50:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB77268C65D; Thu, 24 Aug 2023 23:50:14 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D483268B947 for ; Thu, 24 Aug 2023 23:50:07 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 004EDE8656 for ; Thu, 24 Aug 2023 22:47:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hJQ9rDz-Hxlx for ; Thu, 24 Aug 2023 22:47:30 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 3454BE788C for ; Thu, 24 Aug 2023 22:47:30 +0200 (CEST) Date: Thu, 24 Aug 2023 22:47:30 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20230824053213.982-1-lq@chinaffmpeg.org> Message-ID: References: <20230824053213.982-1-lq@chinaffmpeg.org> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v1 1/2] avformat/rtmppkt: add ff_amf_write_array for write array strings X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 24 Aug 2023, Steven Liu wrote: > Signed-off-by: Steven Liu > --- > libavformat/rtmppkt.c | 6 ++++++ > libavformat/rtmppkt.h | 8 ++++++++ > 2 files changed, 14 insertions(+) > > diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c > index 4b97c0833f..cd0c68ec8a 100644 > --- a/libavformat/rtmppkt.c > +++ b/libavformat/rtmppkt.c > @@ -40,6 +40,12 @@ void ff_amf_write_number(uint8_t **dst, double val) > bytestream_put_be64(dst, av_double2int(val)); > } > > +void ff_amf_write_array(uint8_t **dst, uint32_t val) ff_amf_write_array_start() would be a better name for the function, because it does not write the full array, only the beginning. length would be a better name for the parameter. Regards, Marton > +{ > + bytestream_put_byte(dst, AMF_DATA_TYPE_ARRAY); > + bytestream_put_be32(dst, val); > +} > + > void ff_amf_write_string(uint8_t **dst, const char *str) > { > bytestream_put_byte(dst, AMF_DATA_TYPE_STRING); > diff --git a/libavformat/rtmppkt.h b/libavformat/rtmppkt.h > index a15d2a5773..44c3420436 100644 > --- a/libavformat/rtmppkt.h > +++ b/libavformat/rtmppkt.h > @@ -244,6 +244,14 @@ void ff_amf_write_null(uint8_t **dst); > */ > void ff_amf_write_object_start(uint8_t **dst); > > +/** > + * Write marker and length for AMF array to buffer. > + * > + * @param dst pointer to the input buffer (will be modified) > + * @param length value to write > + */ > +void ff_amf_write_array(uint8_t **dst, uint32_t val); > + > /** > * Write string used as field name in AMF object to buffer. > * > -- > 2.40.0 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".