@encoder.register(str)
def _encode_str(val):
    val = AVal(val)
    pbuf, pend, buf = _create_buffer(val.aval.av_len + 1 + 4)

    res = librtmp.AMF_EncodeString(pbuf, pend, val.aval)
    size = res - pbuf

    return buf[:size]
dataset/ETHPy150Open chrippa/python-librtmp/librtmp/amf.py/_encode_str/original