2
2
* Video processing hooks
3
3
* Copyright (c) 2000, 2001 Fabrice Bellard.
5
* This library is free software; you can redistribute it and/or
5
* This file is part of FFmpeg.
7
* FFmpeg is free software; you can redistribute it and/or
6
8
* modify it under the terms of the GNU Lesser General Public
7
9
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
12
* FFmpeg is distributed in the hope that it will be useful,
11
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
15
* Lesser General Public License for more details.
15
17
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
* License along with FFmpeg; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
22
#include "config.h"
21
24
#include "framehook.h"
24
#ifdef CONFIG_HAVE_DLFCN
50
52
loaded = dlopen(argv[0], RTLD_NOW);
52
fprintf(stderr, "%s\n", dlerror());
54
av_log(NULL, AV_LOG_ERROR, "%s\n", dlerror());
56
58
fhe = av_mallocz(sizeof(*fhe));
60
return AVERROR(ENOMEM);
61
63
fhe->Configure = dlsym(loaded, "Configure");
63
65
fhe->Release = dlsym(loaded, "Release"); /* Optional */
65
67
if (!fhe->Process) {
66
fprintf(stderr, "Failed to find Process entrypoint in %s\n", argv[0]);
68
av_log(NULL, AV_LOG_ERROR, "Failed to find Process entrypoint in %s\n", argv[0]);
69
return AVERROR(ENOENT);
70
72
if (!fhe->Configure && argc > 1) {
71
fprintf(stderr, "Failed to find Configure entrypoint in %s\n", argv[0]);
73
av_log(NULL, AV_LOG_ERROR, "Failed to find Configure entrypoint in %s\n", argv[0]);
74
return AVERROR(ENOENT);
75
77
if (argc > 1 || fhe->Configure) {
76
78
if (fhe->Configure(&fhe->ctx, argc, argv)) {
77
fprintf(stderr, "Failed to Configure %s\n", argv[0]);
79
av_log(NULL, AV_LOG_ERROR, "Failed to Configure %s\n", argv[0]);
80
return AVERROR(EINVAL);