summaryrefslogtreecommitdiff
path: root/libavformat/rtmppkt.h
diff options
context:
space:
mode:
authorJordi Ortiz <nenjordi@gmail.com>2012-08-01 11:25:19 +0200
committerLuca Barbato <lu_zero@gentoo.org>2012-08-02 14:06:44 +0200
commit50468f93e3940ba78836dfdac5165c20ae75327a (patch)
tree9ecdf69ddb838f5c3e58eb6a59ea31bb82bd43e7 /libavformat/rtmppkt.h
parentcfb1091898684e1b433ef138c83389ba4390c9b7 (diff)
rtmp: add functions for reading AMF values
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/rtmppkt.h')
-rw-r--r--libavformat/rtmppkt.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/libavformat/rtmppkt.h b/libavformat/rtmppkt.h
index a83d0feb8f..cd5be5ad83 100644
--- a/libavformat/rtmppkt.h
+++ b/libavformat/rtmppkt.h
@@ -231,6 +231,48 @@ void ff_amf_write_field_name(uint8_t **dst, const char *str);
*/
void ff_amf_write_object_end(uint8_t **dst);
+/**
+ * Read AMF boolean value.
+ *
+ *@param[in,out] gbc GetByteContext initialized with AMF-formatted data
+ *@param[out] val 0 or 1
+ *@return 0 on success or an AVERROR code on failure
+*/
+int ff_amf_read_bool(GetByteContext *gbc, int *val);
+
+/**
+ * Read AMF number value.
+ *
+ *@param[in,out] gbc GetByteContext initialized with AMF-formatted data
+ *@param[out] val read value
+ *@return 0 on success or an AVERROR code on failure
+*/
+int ff_amf_read_number(GetByteContext *gbc, double *val);
+
+/**
+ * Read AMF string value.
+ *
+ * Appends a trailing \0 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_read_string(GetByteContext *gbc, uint8_t *str,
+ int strsize, int *length);
+
+/**
+ * Read AMF NULL value.
+ *
+ *@param[in,out] gbc GetByteContext initialized with AMF-formatted data
+ *@return 0 on success or an AVERROR code on failure
+*/
+int ff_amf_read_null(GetByteContext *gbc);
+
+
/** @} */ // AMF funcs
#endif /* AVFORMAT_RTMPPKT_H */