# Fake GV Camera - Setting next frame

**URL:** <https://aravis-project.discourse.group/t/fake-gv-camera-setting-next-frame/275>\
**Category:** Using Aravis\
**Created:** [June 2, 2021, 12:01am UTC](https://aravis-project.discourse.group/t/fake-gv-camera-setting-next-frame/275 "2021-06-02T00:01:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammy](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sammy](https://aravis-project.discourse.group/u/sammy)\
**Post date:** [June 2, 2021, 12:01am UTC](https://aravis-project.discourse.group/t/fake-gv-camera-setting-next-frame/275/1 "2021-06-02T00:01:44Z")

</div>

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [June 2, 2021, 6:17am UTC](https://aravis-project.discourse.group/t/fake-gv-camera-setting-next-frame/275/2 "2021-06-02T06:17:07Z")

</div>

Hi,

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 \*).

Emmanuel.

---

<div class="post-metadata">

**Author:** ![sammy](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sammy](https://aravis-project.discourse.group/u/sammy)\
**Post date:** [June 3, 2021, 11:11pm UTC](https://aravis-project.discourse.group/t/fake-gv-camera-setting-next-frame/275/3 "2021-06-03T23:11:49Z")

</div>

Thanks for your response. As was the case with my [other question](https://aravis-project.discourse.group/t/fake-gv-camera-4k-resolution/274/3), 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
