* Frame Data Export Function * Exports frame data as JSON string with size information * Returns malloc'd buffer that must be freed with freeFrameData() */
| 68 | * Returns malloc'd buffer that must be freed with freeFrameData() |
| 69 | */ |
| 70 | EMSCRIPTEN_KEEPALIVE void* getFrameData(int* dataSize) { |
| 71 | // Fill active strips data |
| 72 | fl::ActiveStripData& active_strips = fl::ActiveStripData::Instance(); |
| 73 | fl::jsFillInMissingScreenMaps(active_strips); |
| 74 | |
| 75 | // Serialize to JSON |
| 76 | fl::string json_str = active_strips.infoJsonString(); |
| 77 | |
| 78 | // Allocate and return data pointer |
| 79 | char* buffer = (char*)fl::malloc(json_str.length() + 1); |
| 80 | fl::strcpy(buffer, json_str.c_str()); |
| 81 | *dataSize = json_str.length(); |
| 82 | |
| 83 | return buffer; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * ScreenMap Export Function |
nothing calls this directly
no test coverage detected