#endif
-typedef struct _FrameHookEntry {
- struct _FrameHookEntry *next;
+typedef struct FrameHookEntry {
+ struct FrameHookEntry *next;
FrameHookConfigureFn Configure;
FrameHookProcessFn Process;
FrameHookReleaseFn Release;
/* Returns 0 on OK */
int frame_hook_add(int argc, char *argv[])
{
-#ifdef CONFIG_VHOOK
void *loaded;
FrameHookEntry *fhe, **fhep;
fhe = av_mallocz(sizeof(*fhe));
if (!fhe) {
- return -ENOMEM;
+ return AVERROR(ENOMEM);
}
fhe->Configure = dlsym(loaded, "Configure");
if (!fhe->Process) {
av_log(NULL, AV_LOG_ERROR, "Failed to find Process entrypoint in %s\n", argv[0]);
- return -1;
+ return AVERROR(ENOENT);
}
if (!fhe->Configure && argc > 1) {
av_log(NULL, AV_LOG_ERROR, "Failed to find Configure entrypoint in %s\n", argv[0]);
- return -1;
+ return AVERROR(ENOENT);
}
if (argc > 1 || fhe->Configure) {
if (fhe->Configure(&fhe->ctx, argc, argv)) {
av_log(NULL, AV_LOG_ERROR, "Failed to Configure %s\n", argv[0]);
- return -1;
+ return AVERROR(EINVAL);
}
}
*fhep = fhe;
return 0;
-#else
- av_log(NULL, AV_LOG_ERROR, "Video hooking not compiled into this version\n");
- return 1;
-#endif
}
-void frame_hook_process(AVPicture *pict, enum PixelFormat pix_fmt, int width, int height)
+void frame_hook_process(AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, int64_t pts)
{
if (first_hook) {
FrameHookEntry *fhe;
- int64_t pts = av_gettime();
for (fhe = first_hook; fhe; fhe = fhe->next) {
fhe->Process(fhe->ctx, pict, pix_fmt, width, height, pts);