1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @file ccap_imp_macos.h
* @author wysaid (this@wysaid.org)
* @date 2025-04
*
*/
#pragma once
#ifndef CAMERA_CAPTURE_MAC_H
#define CAMERA_CAPTURE_MAC_H
#if __APPLE__
#include "ccap_imp.h"
#if __OBJC__
@class CameraCaptureObjc;
#else
typedef void* CameraCaptureObjc;
#endif
namespace ccap {
class FileReaderApple;
class ProviderApple : public ProviderImp {
public:
ProviderApple();
~ProviderApple() override;
std::vector<std::string> findDeviceNames() override;
bool open(std::string_view deviceName) override;
bool isOpened() const override;
std::optional<DeviceInfo> getDeviceInfo() const override;
void close() override;
bool start() override;
void stop() override;
bool isStarted() const override;
using ProviderImp::getFreeFrame;
using ProviderImp::newFrameAvailable;
inline FrameOrientation frameOrientation() const { return m_frameOrientation; }
inline bool hasNewFrameCallback() const { return m_callback && *m_callback; }
// File playback support
bool setFileProperty(PropertyName prop, double value) override;
double getFileProperty(PropertyName prop) const override;
private:
bool openCamera(std::string_view deviceName);
bool openFile(std::string_view filePath);
CameraCaptureObjc* m_imp{};
std::unique_ptr<FileReaderApple> m_fileReader;
};
ProviderImp* createProviderApple();
} // namespace ccap
#endif
#endif // CAMERA_CAPTURE_MAC_H