libcamera: pipeline: uvcvideo: add error if no default video device is found
If for any reason a default video device is not found in the media graph the creation of the UVC pipeline silently failed. This is not optimal when debugging problems with the pipeline, add an error to notify the user of the issue. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
3f82f50227
commit
5745bd3df5
1 changed files with 6 additions and 0 deletions
|
@ -8,12 +8,15 @@
|
|||
#include <libcamera/camera.h>
|
||||
|
||||
#include "device_enumerator.h"
|
||||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "pipeline_handler.h"
|
||||
#include "v4l2_device.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
LOG_DEFINE_CATEGORY(UVC)
|
||||
|
||||
class PipelineHandlerUVC : public PipelineHandler
|
||||
{
|
||||
public:
|
||||
|
@ -60,6 +63,9 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)
|
|||
}
|
||||
|
||||
if (!video_ || video_->open()) {
|
||||
if (!video_)
|
||||
LOG(UVC, Error) << "Could not find a default video device";
|
||||
|
||||
media_->release();
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue