Looks like a larval form of an insect within a cocoon or case - could be from timber. I checked termite larva and they do not have a case. The case is about 1 cm long.
Crystalhead is correct..it is a bagworm, which will emerge later as a caterpillar. Check your trees, too many and they can devastate a tree, as caterpillars, they will eat the leaves.
Yes, after Crystalhead's identification, I read about them. The most fascinating thing I read was that some females never emerge from the case - the male will fertilise her whilst she is inside the case, the eggs hatch inside her and then the young feed off her body! Yuks - and they say kids will do anything for their parents! Their adult lifespan is very brief and, as with some other animals (the Ephemerals), their main (brief) purpose as adults is to procreate - and I think I know some adult humans like that (but not so brief)!
Still better to live a Bagworms life rather than that of a MAY-FLY.... that has a life of 24 hours. Many know that surel'y.
Can I reply, so that on something I can remain on-topic. What is even worse for the mayfly is that it took two or more years to arrive at that one brief moment of passion and death. I will never complain about lockdown again!