[Spice-devel] Discuss about camera redirection in SPICE
zhenwei pi
pizhenwei at bytedance.com
Mon Jan 17 07:28:05 UTC 2022
On 1/17/22 2:29 PM, Gerd Hoffmann wrote:
> Hi,
>
>> Camera redirection through the USB redirection protocol seems feasible. But
>> I have several concerns:
>> 1, UVC started to support H.264 and VP8 since version 1.5, old version OS
>> has no support(Link https://en.wikipedia.org/wiki/USB_video_device_class).
>>
>> 2, Even guest side supports UVC 1.5, the camera App still has a chance to
>> select which format to use. We can control this from hypervisor side.
>
> The camera could offer vp8 as only supported codec ...
>
> But, yes, using usb redirection will loose some flexibility because you
> can't recode the video frames then.
>
>> 3, I noticed that USB emulation uses a lot of CPU, so I also have a plan to
>> introduce virtio camera to reduce the CPU utilization.
>
> uhci and ehci are pretty bad indeed. xhci should behave noticeable better.
>
>> So from the point of my view, I prefer a common camera redirection
>> protocol(event a hard work to do, but I can support it for a long time).
>
> I think you can take some ideas from the audio protocol (start/stop
> stream, ...). Define controls (brighness etc), probably best to follow
> uvc or v4l2 here. Negotiate video format capabilities, so there is the
> option that server and client agree on some future codec when supported
> on both ends.
>
> take care,
> Gerd
>
Hi,
Actually, during I developed the QEMU camera subsystem and UVC
emulation, I referred to both UVC and v4l2.
Detailed type definition and function declaration in
include/camera/camera.h of this patch:
https://patchwork.kernel.org/project/qemu-devel/patch/20211227142734.691900-2-pizhenwei@bytedance.com/
I suppose the API may looks like this(of cause, detailed implementation
needs take some ideas from audio). Could you please take a look at it?
--
zhenwei pi
More information about the Spice-devel
mailing list