30
30
31
31
import com .sun .jna .NativeLong ;
32
32
import com .sun .jna .Pointer ;
33
+ import static org .freedesktop .gstreamer .lowlevel .GstAPI .GST_PADDING ;
33
34
34
35
/**
35
36
* GstBuffer functions
@@ -41,13 +42,33 @@ public interface GstBufferAPI extends com.sun.jna.Library {
41
42
public static final int GST_LOCK_FLAG_WRITE = (1 << 1 );
42
43
public static final int GST_MAP_READ = GST_LOCK_FLAG_READ ;
43
44
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
+ */
44
59
public static final class MapInfoStruct extends com .sun .jna .Structure {
45
60
public volatile Pointer memory ; // Pointer to GstMemory
46
61
public volatile int flags ; // GstMapFlags
47
62
public volatile Pointer data ;
48
63
public volatile NativeLong size ;
49
64
public volatile NativeLong maxSize ;
50
65
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
+
51
72
/**
52
73
* Creates a new instance of MessageStruct
53
74
*/
@@ -60,7 +81,8 @@ public MapInfoStruct(Pointer ptr) {
60
81
@ Override
61
82
protected List <String > getFieldOrder () {
62
83
return Arrays .asList (new String []{
63
- "memory" , "flags" , "data" , "size" , "maxSize"
84
+ "memory" , "flags" , "data" , "size" , "maxSize" ,
85
+ "user_data" , "_gst_reserved"
64
86
});
65
87
}
66
88
}
@@ -92,12 +114,40 @@ protected List<String> getFieldOrder() {
92
114
// @CallerOwnsReturn Buffer gst_buffer_merge(Buffer buf1, Buffer buf2);
93
115
// @CallerOwnsReturn Buffer gst_buffer_join(@Invalidate Buffer buf1, @Invalidate Buffer buf2);
94
116
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
+ */
95
140
public static final class BufferStruct extends com .sun .jna .Structure {
96
141
volatile public MiniObjectStruct mini_object ;
142
+
97
143
public Pointer pool ;
144
+
145
+ /* timestamp */
98
146
public ClockTime pts ;
99
147
public ClockTime dts ;
100
148
public ClockTime duration ;
149
+
150
+ /* media specific offset */
101
151
public long offset ;
102
152
public long offset_end ;
103
153
0 commit comments