|
27 | 27 | #include "libavutil/dict.h" |
28 | 28 | #include "libavutil/imgutils.h" |
29 | 29 | #include "libavcodec/avcodec.h" |
30 | | -#include "libavformat/url.h" |
31 | 30 | #include "libavformat/avformat.h" |
| 31 | +#include "libavformat/url.h" |
32 | 32 | #include "libavfilter/avfilter.h" |
33 | 33 | #include "libavdevice/avdevice.h" |
34 | 34 | #include "libpostproc/postprocess.h" |
35 | 35 | #include "libswscale/swscale.h" |
36 | 36 | #include "libswresample/swresample.h" |
37 | 37 |
|
38 | | -struct AVFrame ** swig_create_frame_p_p(AVFrame * p); |
39 | | -struct AVDictionary ** swig_create_dictionary_p_p(); |
40 | | -struct AVFormatContext ** swig_create_format_context_p_p(); |
41 | | -struct URLContext ** swig_create_url_context_p_p(); |
42 | | -struct AVDictionary * swig_get_dictionary(struct AVDictionary ** p); |
43 | | -struct AVFormatContext * swig_get_format_context(struct AVFormatContext ** p); |
44 | | -struct URLContext * swig_get_url_context(struct URLContext ** p); |
45 | 38 | struct AVStream * swig_get_stream_p(struct AVStream **streams, int index); |
46 | | -int * swig_create_int_p(); |
47 | | -int swig_get_int(int * p, int index); |
48 | | -void swig_set_int(int * p, int index, int value); |
| 39 | + |
| 40 | +void ** swig_from_p_to_p_p(void * p); |
| 41 | +void * swig_from_p_p_to_p(void ** p); |
| 42 | + |
49 | 43 | %} |
50 | 44 |
|
51 | 45 | %javaconst(1); |
@@ -84,24 +78,18 @@ void swig_set_int(int * p, int index, int value); |
84 | 78 |
|
85 | 79 | %array_class(AVIOContext, AVIOContextArray); |
86 | 80 |
|
87 | | -%extend AVFormatContext { |
88 | | - AVIOContext ** get_aviocontext_p_p() { |
89 | | - return &self->pb; |
| 81 | +%extend AVCPBProperties { |
| 82 | + long size_of() { |
| 83 | + return sizeof(AVCPBProperties); |
90 | 84 | } |
91 | 85 | } |
92 | 86 |
|
93 | | -%typemap(javacode) SWIGTYPE *, SWIGTYPE ** %{ |
| 87 | +%typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE ** %{ |
94 | 88 | public static final $javaclassname asTypePointer(SWIGTYPE_p_void p) { |
95 | | - return new $javaclassname(SWIGTYPE_p_void.getCPtr(p), false); |
96 | | - } |
97 | | - public static final SWIGTYPE_p_void asVoidPointer($javaclassname p) { |
98 | | - return new SWIGTYPE_p_void($javaclassname.getCPtr(p), false); |
| 89 | + return new $javaclassname(SWIGTYPE_p_void.getCPtr(p), false); |
99 | 90 | } |
100 | | -%} |
101 | | - |
102 | | -%typemap(javacode) SWIGTYPE %{ |
103 | 91 | public static final SWIGTYPE_p_void asVoidPointer($javaclassname p) { |
104 | | - return new SWIGTYPE_p_void($javaclassname.getCPtr(p), false); |
| 92 | + return new SWIGTYPE_p_void($javaclassname.getCPtr(p), false); |
105 | 93 | } |
106 | 94 | %} |
107 | 95 |
|
@@ -165,52 +153,21 @@ void swig_set_int(int * p, int index, int value); |
165 | 153 |
|
166 | 154 | %{ |
167 | 155 |
|
168 | | -struct AVFrame ** swig_create_frame_p_p(AVFrame * p) { |
169 | | - AVFrame ** d = (struct AVFrame **) av_mallocz(sizeof(struct AVFrame **)); |
170 | | - *d = p; |
171 | | - return d; |
172 | | -} |
173 | | - |
174 | | -struct AVDictionary ** swig_create_dictionary_p_p() { |
175 | | - return (struct AVDictionary **) av_mallocz(sizeof(struct AVDictionary **)); |
| 156 | +void ** swig_from_p_to_p_p(void * p) { |
| 157 | + void ** q = av_mallocz(sizeof(void *)); |
| 158 | + *q = p; |
| 159 | + return q; |
176 | 160 | } |
177 | 161 |
|
178 | | -struct AVFormatContext ** swig_create_format_context_p_p() { |
179 | | - return (struct AVFormatContext **) av_mallocz(sizeof(struct AVFormatContext **)); |
| 162 | +void * swig_from_p_p_to_p(void ** p) { |
| 163 | + void * q = *p; |
| 164 | + return q; |
180 | 165 | } |
181 | 166 |
|
182 | | -struct URLContext ** swig_create_url_context_p_p() { |
183 | | - return (struct URLContext **) av_mallocz(sizeof(struct URLContext **)); |
184 | | -} |
185 | | - |
186 | | -struct AVDictionary * swig_get_dictionary(struct AVDictionary ** p) { |
187 | | - return *p; |
188 | | -} |
189 | | - |
190 | | -struct AVFormatContext * swig_get_format_context(struct AVFormatContext ** p) { |
191 | | - return *p; |
192 | | -} |
193 | | - |
194 | | -struct URLContext * swig_get_url_context(struct URLContext ** p) { |
195 | | - return *p; |
196 | | -} |
197 | | - |
198 | 167 | struct AVStream * swig_get_stream_p(struct AVStream **streams, int index) { |
199 | 168 | return streams[index]; |
200 | 169 | } |
201 | 170 |
|
202 | | -int * swig_create_int_p() { |
203 | | - return (int *) av_malloc(sizeof(int *)); |
204 | | -} |
205 | | - |
206 | | -int swig_get_int(int * p, int index) { |
207 | | - return p[index]; |
208 | | -} |
209 | | - |
210 | | -void swig_set_int(int * p, int index, int value) { |
211 | | - p[index] = value; |
212 | | -} |
213 | | - |
214 | 171 | SWIGEXPORT void JNICALL Java_com_nextbreakpoint_ffmpeg4java_FFmpeg4JavaJNI_swig_1get_1bytes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jbyteArray jarg2) { |
215 | 172 | jbyte buf[1024]; |
216 | 173 | uint8_t *data = (uint8_t *) jarg1; |
@@ -13759,17 +13716,7 @@ int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in); |
13759 | 13716 |
|
13760 | 13717 | /* glue */ |
13761 | 13718 |
|
13762 | | -struct AVFrame ** swig_create_frame_p_p(AVFrame * p); |
13763 | | -struct AVDictionary ** swig_create_dictionary_p_p(); |
13764 | | -struct AVFormatContext ** swig_create_format_context_p_p(); |
13765 | | -struct URLContext ** swig_create_url_context_p_p(); |
13766 | | - |
13767 | | -struct AVDictionary * swig_get_dictionary(struct AVDictionary ** p); |
13768 | | -struct AVFormatContext * swig_get_format_context(struct AVFormatContext ** p); |
13769 | | -struct URLContext * swig_get_url_context(struct URLContext ** p); |
13770 | | - |
13771 | 13719 | struct AVStream * swig_get_stream_p(struct AVStream **streams, int index); |
13772 | 13720 |
|
13773 | | -int * swig_create_int_p(); |
13774 | | -int swig_get_int(int * p, int index); |
13775 | | -void swig_set_int(int * p, int index, int value); |
| 13721 | +void ** swig_from_p_to_p_p(void * p); |
| 13722 | +void * swig_from_p_p_to_p(void ** p); |
0 commit comments