<div id="geary-body" dir="auto"><div>Hi all,</div><div><br></div><div>I have doing some researching regarding hot-plugging UVC devices. The goal</div><div>is to have CameraManager emit a "camera-added" hotplug signal so that applications</div><div>like QCam, can detect the newly hotplugged camera and be able to start streaming.</div><div>I have discussed this with Kieran briefly and we both agree this is something worth</div><div>pursuing.</div><div><br></div><div>As far as I read the implementation, DeviceEnumeratorUdev::udevNotify() can </div><div>detect new UVC devices being plugged in and add the the list of media devices in the</div><div>DeviceEnumerator.</div><div><br></div><div>But right now, there is nothing done when a new device is being plugged-in, so that</div><div>it can be brought into use. Below is what I think is a very crude version of the code flow is:</div><div><br></div><div>1) Emit a signal for DeviceEnumerator::addDevice() that CameraManager can connect to.</div><div><br></div><div>2) Upon receiving the signal, the CameraManager queries the PipelineHandler to see if</div><div>     it has a supported pipeline. Initially, this is being done via PipelineHandler::match()</div><div>     but match() takes a entire DeviceEnumerator as argument and is meant to run in a loop(in ::init()).</div><div>     We need something similar to  match() which can validate the pipeline-handling-support</div><div>     but for a specific MediaDevice instance(s?).</div><div><br></div><div>3) After the Pipeline Handler can validate the support for a MediaDevice, it can go ahead</div><div>    and create/register the Camera via PipelineHandler::registerCamera() with the CameraManager.</div><div><br></div><div>4) The signal-handler in 2), proceeds to emit a CameraManager::camera-added signal</div><div>    for applications to connect to.</div><div><br></div><div>This is what I have researched till now. Of course, this is right now being targeted towards</div><div>UVC devices but I am sure folks here, will have some generalistic point of view to support</div><div>hotplugs for various other media-device domains that I might not be aware of. Your </div><div>thoughts/comments will be helpful.</div><div><br></div><div>Let me know what you think!</div><div><br></div><div><br></div><div>--</div><div>Umang Jain</div><div><br></div></div><img src="https://u15657259.ct.sendgrid.net/wf/open?upn=GCEip0g28ftA9O9fsCR2M7x08El53O4YVYtHuSI-2FrLwtytoSlmO-2FnSq-2B0q807R-2FE9rPtdi-2Bkd41LKS3EQ4tK8PSoRiIK9c9YQIbldTJF-2FcTqBSndZaX1byhdK-2Bq-2BCroa4gH9HOp-2B9TUnJ10cJbtmf-2BMWTKp0bP3z0plgFJdjeDwsxrqOW-2BtFpOyX-2FbnIH3jWx8VMhiZ3yKES7QAzY20T1UgZMIa5fbf3-2BOhItsLWavrdh3HFeJ8zm9hfp0S1fyl-2Bm-2BgPi1BtP2pFyleQLw81GQ-3D-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>