整理代码

This commit is contained in:
蒲爽 2026-09-28 21:33:04 +08:00
commit c7b4e178ec
364 changed files with 59691 additions and 0 deletions

43
video/v4l2/MmapDevice.h Executable file
View file

@ -0,0 +1,43 @@
#pragma once
#include "Device.h"
namespace Video
{
namespace V4L2
{
#define V4L2MMAP_NBBUFFER 10
class MmapDevice: public Device
{
protected:
size_t writeInternal(char* buffer, size_t bufferSize);
bool startPartialWrite();
size_t writePartialInternal(char*, size_t);
bool endPartialWrite();
size_t readInternal(char* buffer, size_t bufferSize);
public:
MmapDevice(const DeviceParameters& params, v4l2_buf_type deviceType);
virtual ~MmapDevice();
virtual bool init(unsigned int mandatoryCapabilities);
virtual bool isReady()
{
return ((m_fd != -1) && (n_buffers != 0));
}
virtual bool start();
virtual bool stop();
protected:
unsigned int n_buffers;
struct buffer
{
void* start;
size_t length;
};
buffer m_buffer[V4L2MMAP_NBBUFFER];
};
}
}