AFAIK with the Nokia N900 this was possible in 2009 using gstreamer. I never actually used it to create a video device but I assume that the v4l2sink was already a thing back then. I did use it quite a few times for streaming to remote windows and OpenCV.
Only good phone I ever had. I wish things were as easy on Android devices, but somehow they almost never are.