• Val Doroshchuk's avatar
    DirectShow: Notify if camera has been unplugged · 1b58b96b
    Val Doroshchuk authored
    
    If being used camera has been disconnected, state and status will
    remain like it is still active. Also no events are sent.
    Previously to fix this the camera needed to be unloaded and loaded again manually.
    
    IMediaEvent provides an ability to catch device removal notification
    with EC_DEVICE_LOST event.
    
    Since ISampleGrabber is used to get buffers.
    Added a fix to check if no buffers received for some time
    afterwards check for EC_DEVICE_LOST event.
    In case if the device is lost, the camera should be unloaded.
    
    Change-Id: I3a5edf00ce8ee25d8b06800fdad833a722bdba0d
    Task-number: QTBUG-68035
    Reviewed-by: default avatarVaL Doroshchuk <valentyn.doroshchuk@qt.io>
    Reviewed-by: default avatarMaurice Kalinowski <maurice.kalinowski@qt.io>
    1b58b96b