Skip to content

Commit de91d3c

Browse files
Merge pull request #20 from lafoletc/AppSink
AppSink : newPreroll and newSample shall return a FlowReturn
2 parents 374406d + 8f6deaa commit de91d3c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/org/freedesktop/gstreamer/elements/AppSink.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2016 Christophe Lafolet
23
* Copyright (c) 2015 Neil C Smith
34
* Copyright (c) 2009 Levente Farkas
45
* Copyright (c) 2009 Wayne Meissner
@@ -25,6 +26,7 @@
2526

2627
import org.freedesktop.gstreamer.Buffer;
2728
import org.freedesktop.gstreamer.Caps;
29+
import org.freedesktop.gstreamer.FlowReturn;
2830
import org.freedesktop.gstreamer.Sample;
2931
import org.freedesktop.gstreamer.lowlevel.AppAPI;
3032
import org.freedesktop.gstreamer.lowlevel.GstAPI.GstCallback;
@@ -170,21 +172,21 @@ public static interface NEW_SAMPLE {
170172
*
171173
* @param elem
172174
*/
173-
public void newBuffer(AppSink elem);
175+
public FlowReturn newSample(AppSink elem);
174176
}
175177
/**
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
177179
* 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
179181
* buffer can be pulled without blocking.
180182
*
181183
* @param listener
182184
*/
183185
public void connect(final NEW_SAMPLE listener) {
184186
connect(NEW_SAMPLE.class, listener, new GstCallback() {
185187
@SuppressWarnings("unused")
186-
public void callback(AppSink elem) {
187-
listener.newBuffer(elem);
188+
public FlowReturn callback(AppSink elem) {
189+
return listener.newSample(elem);
188190
}
189191
});
190192
}
@@ -205,7 +207,7 @@ public static interface NEW_PREROLL {
205207
*
206208
* @param elem
207209
*/
208-
public void newPreroll(AppSink elem);
210+
public FlowReturn newPreroll(AppSink elem);
209211
}
210212
/**
211213
* Adds a listener for the <code>new-preroll</code> signal. If a blocking
@@ -218,8 +220,8 @@ public static interface NEW_PREROLL {
218220
public void connect(final NEW_PREROLL listener) {
219221
connect(NEW_PREROLL.class, listener, new GstCallback() {
220222
@SuppressWarnings("unused")
221-
public void callback(AppSink elem) {
222-
listener.newPreroll(elem);
223+
public FlowReturn callback(AppSink elem) {
224+
return listener.newPreroll(elem);
223225
}
224226
});
225227
}

0 commit comments

Comments
 (0)