scar-chat7/client/media/camera_capture.h

41 lines
890 B
C
Raw Permalink Normal View History

2025-12-07 12:00:44 -07:00
#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