From: Michael Zucchi Date: Wed, 16 Oct 2019 22:40:47 +0000 (+1030) Subject: Add FrameSideData api missing files. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=1822f5e63d1b4bd8e063ced59bbf7b1467ccf345;p=jjmpeg Add FrameSideData api missing files. --- diff --git a/src/notzed.jjmpeg/classes/au/notzed/jjmpeg/AVFrameSideData.java b/src/notzed.jjmpeg/classes/au/notzed/jjmpeg/AVFrameSideData.java new file mode 100644 index 0000000..7626f17 --- /dev/null +++ b/src/notzed.jjmpeg/classes/au/notzed/jjmpeg/AVFrameSideData.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Michael Zucchi + * + * This file is part of jjmpeg + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package au.notzed.jjmpeg; + +import java.nio.ByteBuffer; + +/** + * + */ +public class AVFrameSideData extends AVObject { + + private AVFrameSideData(long p) { + super(p); + } + + private static void release(long p) { + } + + public native int getType(); + + public native ByteBuffer getData(); + +} diff --git a/src/notzed.jjmpeg/classes/au/notzed/jjmpeg/AVFrameSideDataType.java b/src/notzed.jjmpeg/classes/au/notzed/jjmpeg/AVFrameSideDataType.java new file mode 100644 index 0000000..ead17a4 --- /dev/null +++ b/src/notzed.jjmpeg/classes/au/notzed/jjmpeg/AVFrameSideDataType.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2019 Michael Zucchi + * + * This file is part of jjmpeg + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package au.notzed.jjmpeg; + +/** + */ +public class AVFrameSideDataType implements AVFrameSideDataTypeBits { + + static { + AVObject.init(); + } + + /** + * Call av_frame_side_data_name + */ + public static native String toString(int value); +} diff --git a/src/notzed.jjmpeg/jni/jj-avframesidedata.c b/src/notzed.jjmpeg/jni/jj-avframesidedata.c new file mode 100644 index 0000000..81c0ec8 --- /dev/null +++ b/src/notzed.jjmpeg/jni/jj-avframesidedata.c @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2019 Michael Zucchi + * + * This file is part of jjmpeg + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + +#include + +#include "au_notzed_jjmpeg_AVFrameSideData.h" + +#include "jjmpeg.h" +//#include "jj-avframesidedata.h" + +//jint AVFrameSideData_OnLoad(JavaVM *vmi, JNIEnv *env) { +// return nativez_ResolveReferences(env, java_names, &java); +//} + +/* ********************************************************************** */ +/* Fields */ + +GET_prim(jint, AVFrameSideData, Type, type) + +/* +GET_prim(jint, AVStream, Index, index) +GS_int(AVStream, ID, id) + +GS_value(AVRational_new, AVRational_get, AVStream, TimeBase, time_base) + +GS_long(AVStream, StartTime, start_time) +GS_long(AVStream, Duration, duration) +GS_long(AVStream, NumFrames, nb_frames) + +GS_int(AVStream, Discard, discard) + +GS_value(AVRational_new, AVRational_get, AVStream, AverageFrameRate, avg_frame_rate) +GS_value(AVRational_new, AVRational_get, AVStream, SampleAspectRatio, sample_aspect_ratio) +GS_value(AVRational_new, AVRational_get, AVStream, DisplayAspectRatio, display_aspect_ratio) + +REF_object(AVCodecParameters, AVStream, CodecParameters, codecpar) +*/ + +JNIEXPORT jobject JNICALL Java_au_notzed_jjmpeg_AVFrameSideData_getData +(JNIEnv *env, jobject jsd) { + AVFrameSideData *sd = NativeZ_getP(env, jsd); + + if (sd->data) + return nativez_NewDirectBuffer(env, sd->data, sd->size); + + return NULL; +} diff --git a/src/notzed.jjmpeg/jni/jj-avframesidedata.def b/src/notzed.jjmpeg/jni/jj-avframesidedata.def new file mode 100644 index 0000000..785ed2c --- /dev/null +++ b/src/notzed.jjmpeg/jni/jj-avframesidedata.def @@ -0,0 +1,4 @@ + +java AVCodecParameters au/notzed/jjmpeg/AVCodecParameters { +} +