41 lines
890 B
C++
41 lines
890 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <functional>
|
|
#include <vector>
|
|
|
|
namespace scar {
|
|
|
|
// Camera capture interface using Pipewire (Linux)
|
|
class CameraCapture {
|
|
public:
|
|
CameraCapture();
|
|
~CameraCapture();
|
|
|
|
// Start capturing from default camera
|
|
bool start();
|
|
|
|
// Stop capturing
|
|
void stop();
|
|
|
|
// Check if currently capturing
|
|
bool isCapturing() const { return capturing_; }
|
|
|
|
// Set frame callback (called for each captured frame)
|
|
using FrameCallback = std::function<void(const std::vector<uint8_t>& frameData, int width, int height)>;
|
|
void setFrameCallback(FrameCallback callback);
|
|
|
|
private:
|
|
void initPipewire();
|
|
void cleanupPipewire();
|
|
|
|
bool capturing_;
|
|
FrameCallback frameCallback_;
|
|
|
|
// TODO: Pipewire-specific members
|
|
// pw_thread_loop* loop_;
|
|
// pw_stream* stream_;
|
|
};
|
|
|
|
} // namespace scar
|