1
1
/*
2
+ * Copyright (c) 2016 Christophe Lafolet
2
3
* Copyright (c) 2015 Neil C Smith
3
4
* Copyright (c) 2009 Levente Farkas
4
5
* Copyright (c) 2009 Wayne Meissner
25
26
26
27
import org .freedesktop .gstreamer .Buffer ;
27
28
import org .freedesktop .gstreamer .Caps ;
29
+ import org .freedesktop .gstreamer .FlowReturn ;
28
30
import org .freedesktop .gstreamer .Sample ;
29
31
import org .freedesktop .gstreamer .lowlevel .AppAPI ;
30
32
import org .freedesktop .gstreamer .lowlevel .GstAPI .GstCallback ;
@@ -170,21 +172,21 @@ public static interface NEW_SAMPLE {
170
172
*
171
173
* @param elem
172
174
*/
173
- public void newBuffer (AppSink elem );
175
+ public FlowReturn newSample (AppSink elem );
174
176
}
175
177
/**
176
- * Adds a listener for the <code>new-buffer </code> signal. If a blocking
178
+ * Adds a listener for the <code>new-sample </code> signal. If a blocking
177
179
* behaviour is not desirable, setting the "emit-signals" property to TRUE
178
- * will make appsink emit the "new-buffer " and "new-preroll" signals when a
180
+ * will make appsink emit the "new-sample " and "new-preroll" signals when a
179
181
* buffer can be pulled without blocking.
180
182
*
181
183
* @param listener
182
184
*/
183
185
public void connect (final NEW_SAMPLE listener ) {
184
186
connect (NEW_SAMPLE .class , listener , new GstCallback () {
185
187
@ SuppressWarnings ("unused" )
186
- public void callback (AppSink elem ) {
187
- listener .newBuffer (elem );
188
+ public FlowReturn callback (AppSink elem ) {
189
+ return listener .newSample (elem );
188
190
}
189
191
});
190
192
}
@@ -205,7 +207,7 @@ public static interface NEW_PREROLL {
205
207
*
206
208
* @param elem
207
209
*/
208
- public void newPreroll (AppSink elem );
210
+ public FlowReturn newPreroll (AppSink elem );
209
211
}
210
212
/**
211
213
* Adds a listener for the <code>new-preroll</code> signal. If a blocking
@@ -218,8 +220,8 @@ public static interface NEW_PREROLL {
218
220
public void connect (final NEW_PREROLL listener ) {
219
221
connect (NEW_PREROLL .class , listener , new GstCallback () {
220
222
@ SuppressWarnings ("unused" )
221
- public void callback (AppSink elem ) {
222
- listener .newPreroll (elem );
223
+ public FlowReturn callback (AppSink elem ) {
224
+ return listener .newPreroll (elem );
223
225
}
224
226
});
225
227
}
0 commit comments