1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
8 #include "extensions/browser/api/webcam_private/webcam.h"
10 #include "base/files/scoped_file.h"
12 namespace extensions
{
14 class V4L2Webcam
: public Webcam
{
16 V4L2Webcam(const std::string
& device_id
);
20 ~V4L2Webcam() override
;
21 bool EnsureLogitechCommandsMapped();
22 bool SetWebcamParameter(int fd
, uint32_t control_id
, int value
);
23 bool GetWebcamParameter(int fd
, uint32_t control_id
, int* value
);
26 void GetPan(const GetPTZCompleteCallback
& callback
) override
;
27 void GetTilt(const GetPTZCompleteCallback
& callback
) override
;
28 void GetZoom(const GetPTZCompleteCallback
& callback
) override
;
29 void SetPan(int value
,
31 const SetPTZCompleteCallback
& callback
) override
;
32 void SetTilt(int value
,
34 const SetPTZCompleteCallback
& callback
) override
;
35 void SetZoom(int value
, const SetPTZCompleteCallback
& callback
) override
;
36 void SetPanDirection(PanDirection direction
,
38 const SetPTZCompleteCallback
& callback
) override
;
39 void SetTiltDirection(TiltDirection direction
,
41 const SetPTZCompleteCallback
& callback
) override
;
45 const SetPTZCompleteCallback
& callback
) override
;
47 const std::string device_id_
;
50 DISALLOW_COPY_AND_ASSIGN(V4L2Webcam
);
54 } // namespace extensions
56 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_