Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vc.ril.rawcam no used buffers in videocode #71

Open
CZLYddy opened this issue May 22, 2022 · 2 comments
Open

vc.ril.rawcam no used buffers in videocode #71

CZLYddy opened this issue May 22, 2022 · 2 comments

Comments

@CZLYddy
Copy link

CZLYddy commented May 22, 2022

I set output->buffer_num=8,so the vcsm applied for 8 buffers in GPU memory.
Rawcam sent a pair of buffers(MMAL_WORKER_BUFFER_TO_HOST message) with the same timestamp,then it had been Stop sent the next image frame until it received a pair of buffers(MMAL_WORKER_BUFFER_FROM_HOST message).
If rawcam wait for a long time,it would lost some image frame.
Is there any way to solve this problem?

@6by9
Copy link
Collaborator

6by9 commented May 23, 2022

I don't follow your issue.

vc.ril.rawcam will accept an buffers. It will write them with incoming data, and return 2 buffers with the same timestamp each time it receives a Frame End short packet on the CSI interface. One buffer is the image data (data that matches the configured CSI-2 data type) and one buffer gets the MMAL_BUFFER_HEADER_FLAG_CODECSIDEINFO flag set and contains any data which does not match the image CSI-2 data type.

When you send stop to the image sensor it will stop producing frames. vc.ril.rawcam will see no more Frame End packets, so will stop producing buffers until mmal_port_disable is called (which then flushes all buffers back to the client).

@CZLYddy
Copy link
Author

CZLYddy commented May 24, 2022

Dear 6by9:
Thank you for your reply.I am sorry my english is pool.I mean that the vc.ril.rawcam can't take full advantage of the buffers.
For example,output->buffer_num=8.When I don't call "mmal_buffer_header_release(buffer)" in callback(), the vc.ril.camera is going to send eight pieces of image data to fill the buffers and then stop and wait for our program to process it.
But in the same situation, the vc.ril.rawcam is going to just send two pieces of image data to fill the buffers and then stop and wait for our program to process it.
So "output->buffer_num=8" or "output->buffer_num=2" have the same effect on vc.ril.rawcam.This is the result of my experiment.
When my program is interrupted by a high-priority process, it may not be able to process the image frame enough to lose frames.That's why I want to solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants