mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
add WebPISetIOHooks() to set some custom hooks on the incremental decoder object.
Change-Id: I01e973a1e45e3d60dc11fd284df3cbb938cf0485
This commit is contained in:
@ -621,6 +621,23 @@ uint8_t* WebPIDecGetYUV(const WebPIDecoder* const idec, int* last_y,
|
||||
return src->u.YUVA.y;
|
||||
}
|
||||
|
||||
int WebPISetIOHooks(WebPIDecoder* const idec,
|
||||
VP8IoPutHook put,
|
||||
VP8IoSetupHook setup,
|
||||
VP8IoTeardownHook teardown,
|
||||
void* user_data) {
|
||||
if (!idec || !idec->dec_ || idec->state_ > STATE_HEADER) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
idec->io_.put = put;
|
||||
idec->io_.setup = setup;
|
||||
idec->io_.teardown = teardown;
|
||||
idec->io_.opaque = user_data;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user