Read about our upcoming Code of Conduct on this issue

Commit db9bed63 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

qemu-frsp: allocate a YUV buffer if there isn't one already set up (only with CONFIG_QEMU)

Fixes preview on 5D3 and 1100D, where Canon firmware does not allocate one at startup.

branch : qemu
parent 029fecbe1794
b8a97d54799eadd06fdc0d505b13d5aa frsp.ppm
396bb83e615452a4d1619dc4ed07449f frsp.ppm
......@@ -161,6 +161,19 @@ my_init_task(int a, int b, int c, int d)
* and generally it's hard to draw over this screen without trickery. */
/* some cameras don't initialize the YUV buffer right away - but we need it! */
/* let's hope this works... */
extern void * _AllocateMemory(size_t);
int size = 720 * 480 * 2;
void * buf = _AllocateMemory(720 * 480 * 2);
while (!buf); /* lock up on error */
memset(buf, 0, size);
MEM(0xC0F140E0) = YUV422_LV_BUFFER_DISPLAY_ADDR = (uint32_t) buf;
qprintf("Allocated YUV buffer: %X\n", YUV422_LV_BUFFER_DISPLAY_ADDR);
/* for running on real camera: wait for user to enter LiveView,
* then switch to PLAY mode (otherwise you'll capture a dark frame) */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment