def _decode_prop(prop):
    prop_type = librtmp.AMFProp_GetType(prop)

    if prop_type == librtmp.AMF_NUMBER:
        val = librtmp.AMFProp_GetNumber(prop)
    elif prop_type in AMF_STRING_TYPES:
        aval = AVal()
        librtmp.AMFProp_GetString(prop, aval.aval)
        val = aval.value.decode("utf8", "ignore")
    elif prop_type == librtmp.AMF_BOOLEAN:
        val = bool(librtmp.AMFProp_GetBoolean(prop))
    elif prop_type in AMF_OBJECT_DICT_TYPES:
        if prop_type == librtmp.AMF_OBJECT:
            val = AMFObject()
        else:
            val = dict()

        for key, value in _decode_prop_obj(prop):
            val[key] = value
    elif prop_type == librtmp.AMF_STRICT_ARRAY:
        val = []
        for key, value in _decode_prop_obj(prop):
            val.append(value)
    else:
        val = None

    return val
dataset/ETHPy150Open chrippa/python-librtmp/librtmp/amf.py/_decode_prop/original