gateway: reorganzing rtmp gateway