From 3b18857ab301d2a0b3e86e9d85eed76f0798a29c Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 31 May 2014 20:37:25 +0100 Subject: rtmppkt: Add method to read an AMF string that is not prefixed by its type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtmppkt.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libavformat/rtmppkt.h') diff --git a/libavformat/rtmppkt.h b/libavformat/rtmppkt.h index e973684aa9..149c153cad 100644 --- a/libavformat/rtmppkt.h +++ b/libavformat/rtmppkt.h @@ -277,6 +277,23 @@ int ff_amf_read_bool(GetByteContext *gbc, int *val); */ int ff_amf_read_number(GetByteContext *gbc, double *val); +/** + * Get AMF string value. + * + * This function behaves the same as ff_amf_read_string except that + * it does not expect the AMF type prepended to the actual data. + * Appends a trailing null byte to output string in order to + * ease later parsing. + * + *@param[in,out] gbc GetByteContext initialized with AMF-formatted data + *@param[out] str read string + *@param[in] strsize buffer size available to store the read string + *@param[out] length read string length + *@return 0 on success or an AVERROR code on failure +*/ +int ff_amf_get_string(GetByteContext *bc, uint8_t *str, + int strsize, int *length); + /** * Read AMF string value. * -- cgit v1.2.3