MCPcopy Create free account
hub / github.com/TzuHuanTai/RaspberryPi-WebRTC / WriteImage

Function WriteImage

test/test_libcamera.cpp:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <unistd.h>
9
10void WriteImage(void *start, int length, int index) {
11 printf("Dequeued buffer index: %d\n"
12 " bytesused: %d\n",
13 index, length);
14
15 std::string filename = "img" + std::to_string(index) + ".yuv";
16 int outfd = open(filename.c_str(), O_WRONLY | O_CREAT | O_EXCL, 0600);
17 if ((outfd == -1) && (EEXIST == errno)) {
18 /* open the existing file with write flag */
19 outfd = open(filename.c_str(), O_WRONLY);
20 }
21
22 write(outfd, start, length);
23}
24
25int main(int argc, char *argv[]) {
26 std::mutex mtx;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected