Fake GV Camera - Setting next frame

When controlling a fake GV camera, how can one achieve setting the content of the next frame?

According to the docs, it appears the arv_fake_camera_set_fill_pattern is meant for this, but I’m not clear how to use it. The API takes a callback that gets called for each frame, but the ArvBuffer provided to that callback has no function to obtain a writable buffer to the frame data. There does exist an arv_buffer_get_data function, but this returns a const void*.

Looking at the source code, it seems the default callback (arv_fake_camera_diagonal_ramp) only achieves this by accessing the ArvBuffer’s priv member, which I cannot access from client code.

Maybe I’m going about this all wrong. Is there another way to do it?



You are right the accessor to the buffer data returns a const pointer. A possible fix would be to remove the const qualifier, but I’m not sure about the consequences of this API break.

As the camera simulator is a side product of aravis, mostly meant as a test tool for aravis itself, I prefer to not take the risk.

In your code, that just mean you have to make a cast to (void *).


Thanks for your response. As was the case with my other question, I understand this isn’t officially supported and may break in later versions, but as of Aravis-0.8, I’m able to write to the buffer data by casting away the const as you suggested.

Thanks again for your help