Allow Sink.SetSource() to be given an empty source.

In Java, allow source to be null (pointers are not used in C++, so
this isn't necessary).
This commit is contained in:
Peter Johnson
2016-12-28 00:47:26 -08:00
parent b91ab0b44f
commit 23135d7a5a
4 changed files with 21 additions and 10 deletions

View File

@@ -84,7 +84,11 @@ public class VideoSink {
/// provide frames to multiple clients.
/// @param source Source
public void setSource(VideoSource source) {
CameraServerJNI.setSinkSource(m_handle, source.m_handle);
if (source == null) {
CameraServerJNI.setSinkSource(m_handle, 0);
} else {
CameraServerJNI.setSinkSource(m_handle, source.m_handle);
}
}
/// Get the connected source.