Skip to content

Commit bcc5c37

Browse files
i-n-g-oneilcsmith-net
authored andcommitted
Add missing fields to map info struct (#111)
* add missing fields to MapInfoStruct, add doc for MapInfoStruct from gstmemory.c v 1.8.3 * add comments and doc for BufferStruct from gstbuffer.h version 1.8
1 parent 32b74a8 commit bcc5c37

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

src/org/freedesktop/gstreamer/lowlevel/GstBufferAPI.java

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import com.sun.jna.NativeLong;
3232
import com.sun.jna.Pointer;
33+
import static org.freedesktop.gstreamer.lowlevel.GstAPI.GST_PADDING;
3334

3435
/**
3536
* GstBuffer functions
@@ -41,13 +42,33 @@ public interface GstBufferAPI extends com.sun.jna.Library {
4142
public static final int GST_LOCK_FLAG_WRITE = (1 << 1);
4243
public static final int GST_MAP_READ = GST_LOCK_FLAG_READ;
4344
public static final int GST_MAP_WRITE = GST_LOCK_FLAG_WRITE;
45+
46+
/**
47+
* GstMapInfo:
48+
* @memory: a pointer to the mapped memory
49+
* @flags: flags used when mapping the memory
50+
* @data: (array length=size): a pointer to the mapped data
51+
* @size: the valid size in @data
52+
* @maxsize: the maximum bytes in @data
53+
* @user_data: extra private user_data that the implementation of the memory
54+
* can use to store extra info.
55+
*
56+
* A structure containing the result of a map operation such as
57+
* gst_memory_map(). It contains the data and size.
58+
*/
4459
public static final class MapInfoStruct extends com.sun.jna.Structure {
4560
public volatile Pointer memory; // Pointer to GstMemory
4661
public volatile int flags; // GstMapFlags
4762
public volatile Pointer data;
4863
public volatile NativeLong size;
4964
public volatile NativeLong maxSize;
5065

66+
/*< protected >*/
67+
public volatile Pointer[] user_data = new Pointer[4];
68+
69+
/*< private >*/
70+
public volatile Pointer[] _gst_reserved = new Pointer[GST_PADDING];
71+
5172
/**
5273
* Creates a new instance of MessageStruct
5374
*/
@@ -60,7 +81,8 @@ public MapInfoStruct(Pointer ptr) {
6081
@Override
6182
protected List<String> getFieldOrder() {
6283
return Arrays.asList(new String[]{
63-
"memory", "flags", "data", "size", "maxSize"
84+
"memory", "flags", "data", "size", "maxSize",
85+
"user_data", "_gst_reserved"
6486
});
6587
}
6688
}
@@ -92,12 +114,40 @@ protected List<String> getFieldOrder() {
92114
// @CallerOwnsReturn Buffer gst_buffer_merge(Buffer buf1, Buffer buf2);
93115
// @CallerOwnsReturn Buffer gst_buffer_join(@Invalidate Buffer buf1, @Invalidate Buffer buf2);
94116

117+
/**
118+
* GstBuffer:
119+
* @mini_object: the parent structure
120+
* @pool: pointer to the pool owner of the buffer
121+
* @pts: presentation timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
122+
* pts is not known or relevant. The pts contains the timestamp when the
123+
* media should be presented to the user.
124+
* @dts: decoding timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
125+
* dts is not known or relevant. The dts contains the timestamp when the
126+
* media should be processed.
127+
* @duration: duration in time of the buffer data, can be #GST_CLOCK_TIME_NONE
128+
* when the duration is not known or relevant.
129+
* @offset: a media specific offset for the buffer data.
130+
* For video frames, this is the frame number of this buffer.
131+
* For audio samples, this is the offset of the first sample in this buffer.
132+
* For file data or compressed data this is the byte offset of the first
133+
* byte in this buffer.
134+
* @offset_end: the last offset contained in this buffer. It has the same
135+
* format as @offset.
136+
*
137+
* The structure of a #GstBuffer. Use the associated macros to access the public
138+
* variables.
139+
*/
95140
public static final class BufferStruct extends com.sun.jna.Structure {
96141
volatile public MiniObjectStruct mini_object;
142+
97143
public Pointer pool;
144+
145+
/* timestamp */
98146
public ClockTime pts;
99147
public ClockTime dts;
100148
public ClockTime duration;
149+
150+
/* media specific offset */
101151
public long offset;
102152
public long offset_end;
103153

0 commit comments

Comments
 (0)