Skip to content

Commit 4112af7

Browse files
author
Andrea Medeghini
committed
Completed tests
1 parent ae5ce9c commit 4112af7

2 files changed

Lines changed: 127 additions & 78 deletions

File tree

ffmpeg4java.i

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "libswscale/swscale.h"
3636
#include "libswresample/swresample.h"
3737

38-
struct AVStream * swig_get_stream_p(struct AVStream **streams, int index);
38+
typedef void * void_p;
3939

4040
void ** swig_from_p_to_p_p(void * p);
4141
void * swig_from_p_p_to_p(void ** p);
@@ -75,7 +75,7 @@ void * swig_from_p_p_to_p(void ** p);
7575
%array_class(uint64_t, uint64Array);
7676
%array_class(signed char, byteArray);
7777

78-
%array_class(AVIOContext, AVIOContextArray);
78+
%array_class(void_p, VoidPointerArray);
7979

8080
%extend AVCPBProperties {
8181
long size_of() {
@@ -112,11 +112,11 @@ void * swig_from_p_p_to_p(void ** p);
112112

113113
%pragma(java) modulecode=%{
114114
public static void swig_get_bytes(SWIGTYPE_p_uint8_t buffer, byte[] data) {
115-
FFmpeg4JavaJNI.swig_get_bytes(SWIGTYPE_p_uint8_t.getCPtr(buffer), buffer, data);
115+
FFmpeg4JavaJNI.swig_get_bytes(SWIGTYPE_p_uint8_t.getCPtr(buffer), buffer, data);
116116
}
117117

118118
public static void swig_set_bytes(SWIGTYPE_p_uint8_t buffer, byte[] data) {
119-
FFmpeg4JavaJNI.swig_set_bytes(SWIGTYPE_p_uint8_t.getCPtr(buffer), buffer, data);
119+
FFmpeg4JavaJNI.swig_set_bytes(SWIGTYPE_p_uint8_t.getCPtr(buffer), buffer, data);
120120
}
121121
%}
122122

@@ -126,22 +126,6 @@ void * swig_from_p_p_to_p(void ** p);
126126
}
127127
%}
128128

129-
%typemap(in) int16_t (*motion_val[2])[2] %{
130-
$1 = *(int16_t (***)[2])&$input;
131-
%}
132-
133-
%typemap(out) int16_t (*motion_val[2])[2] %{
134-
*(int16_t (***)[2])&$result = $1;
135-
%}
136-
137-
%typemap(memberin) int16_t (*motion_val[2])[2] %{
138-
{
139-
size_t ii;
140-
int16_t (**b)[2] = (int16_t (**)[2]) arg1->motion_val;
141-
for (ii = 0; ii < (size_t)2; ii++) b[ii] = *((int16_t (**)[2]) arg2 + ii);
142-
}
143-
%}
144-
145129
%typemap(javacode) AVAppToDevMessageType %{
146130
public static final int MKBETAG(char a, char b, char c, char d) {
147131
int na = Character.getNumericValue(a);
@@ -162,7 +146,6 @@ void * swig_from_p_p_to_p(void ** p);
162146
}
163147
%}
164148

165-
166149
%{
167150

168151
void ** swig_from_p_to_p_p(void * p) {
@@ -176,10 +159,6 @@ void * swig_from_p_p_to_p(void ** p) {
176159
return q;
177160
}
178161

179-
struct AVStream * swig_get_stream_p(struct AVStream **streams, int index) {
180-
return streams[index];
181-
}
182-
183162
SWIGEXPORT void JNICALL Java_com_nextbreakpoint_ffmpeg4java_FFmpeg4JavaJNI_swig_1get_1bytes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jbyteArray jarg2) {
184163
jbyte buf[1024];
185164
uint8_t *data = (uint8_t *) jarg1;
@@ -230,11 +209,19 @@ SWIGEXPORT void JNICALL Java_com_nextbreakpoint_ffmpeg4java_FFmpeg4JavaJNI_swig_
230209

231210
%}
232211

212+
/* glue */
213+
214+
typedef void * void_p;
215+
216+
void ** swig_from_p_to_p_p(void * p);
217+
void * swig_from_p_p_to_p(void ** p);
218+
233219
#define av_const
234220
#define av_warn_unused_result
235221
#define attribute_deprecated
236222
#define av_printf_format(x,y)
237223

224+
238225
/* libavutil/version.h */
239226

240227
#define LIBAVUTIL_VERSION_MAJOR 55
@@ -13724,11 +13711,3 @@ int swr_convert_frame(SwrContext *swr,
1372413711
* @return 0 on success, AVERROR on failure.
1372513712
*/
1372613713
int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in);
13727-
13728-
13729-
/* glue */
13730-
13731-
struct AVStream * swig_get_stream_p(struct AVStream **streams, int index);
13732-
13733-
void ** swig_from_p_to_p_p(void * p);
13734-
void * swig_from_p_p_to_p(void ** p);

0 commit comments

Comments
 (0)