avformat/rtmppkt: add ff_amf_write_array for write

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2023-08-25 11:35:34 +08:00 committed by Steven Liu
parent 62fb730762
commit c946e8d921
2 changed files with 14 additions and 0 deletions

View File

@ -40,6 +40,12 @@ void ff_amf_write_number(uint8_t **dst, double val)
bytestream_put_be64(dst, av_double2int(val)); bytestream_put_be64(dst, av_double2int(val));
} }
void ff_amf_write_array_start(uint8_t **dst, uint32_t length)
{
bytestream_put_byte(dst, AMF_DATA_TYPE_ARRAY);
bytestream_put_be32(dst, length);
}
void ff_amf_write_string(uint8_t **dst, const char *str) void ff_amf_write_string(uint8_t **dst, const char *str)
{ {
bytestream_put_byte(dst, AMF_DATA_TYPE_STRING); bytestream_put_byte(dst, AMF_DATA_TYPE_STRING);

View File

@ -244,6 +244,14 @@ void ff_amf_write_null(uint8_t **dst);
*/ */
void ff_amf_write_object_start(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_start(uint8_t **dst, uint32_t length);
/** /**
* Write string used as field name in AMF object to buffer. * Write string used as field name in AMF object to buffer.
* *