Giter Site home page Giter Site logo

vlog-buddie's Introduction


A little more about me...

  • I am an Embedded Linux Developer, interested in yocto build system and Linux device drivers development.
  • Iโ€™m working on system programming, yet struggling to understand the linux kernel :/
  • Passionated with planet Saturn, galaxies, Black holes and space ^^
  • Reach me with: [email protected]|[email protected]

    ben-ali-samar-721b66169


Languages and Tools :

c cplusplus python arduino bash git VS code linux opencv

Thanks for Visiting! By

vlog-buddie's People

Contributors

benali-samar avatar

Stargazers

 avatar  avatar

Watchers

 avatar

vlog-buddie's Issues

possible NULL pointure

line 62
buffers = calloc(req.count, sizeof(*buffers));
you miss to check for possible NULL pointer .

Possile inf loop

while (1) {
int ret = poll(poll_fds, 1, 1000); // wait up to 1 second for events
// ( put -1 if it should wait forever )
if (ret < 0) {
perror("Failed to poll");
exit(1);
} else if (ret == 0) {
printf("Poll timeout\n");
continue;
}

    if (poll_fds[0].revents & POLLIN) {
        // Dequeue the video buffer for sending it to the output/display
        struct v4l2_buffer buf = {0};
        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        buf.memory = V4L2_MEMORY_MMAP;
        if (ioctl(fd, VIDIOC_DQBUF, &buf) < 0) {
            perror("Failed to dequeue buffer");
            exit(1);
        }

        // Write the video data to the output device
        write(out_fd, buffers[buf.index].start, buf.bytesused);

        // Enqueue the video buffer again
        if (ioctl(fd, VIDIOC_QBUF, &buf) < 0) {
            perror("Failed to enqueue buffer");
            exit(1);
        }
    }
}

in this peace of code there's no break point to continue the rest of code .
we see only exit .it will stop code from running need to double check this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.