You can install v4l2loopback. It is a kernel module that simulates a webcam. Load it with:
modprobe v4l2loopback
Then you need to send the video stream to the device /dev/video0 using a program like ffmpeg. In order to capture the desktop and forward it to /dev/video0 with ffmpeg, you can use the following command line:
ffmpeg -f x11grab -r 15 -s 1280x720 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
Change the value of -r from 15 to something else if you want a different frame rate. The resolution is chosen in the -s parameter. If you want to specify an offset from the upper-left corner of the screen, pass it in the -i parameter in the form "-i :0.0+x,y", where x and y are the horizontal and vertical offset respectively.