nsviewCanvas.setBackground(Color.black);
xwindowCanvas = new Canvas();
xwindowCanvas.setBackground(Color.black);
aglVideoSurface = new CanvasVideoSurface(aglCanvas, new VideoSurfaceAdapter() {
@Override
public void attach(LibVlc libvlc, MediaPlayer mediaPlayer, long componentId) {
dump("AGL", aglCanvas);
libvlc.libvlc_media_player_set_agl(aglMediaPlayer.mediaPlayerInstance(), RuntimeUtil.safeLongToInt(componentId));
}
});
nsobjectVideoSurface = new CanvasVideoSurface(nsobjectCanvas, new VideoSurfaceAdapter() {
@Override
public void attach(LibVlc libvlc, MediaPlayer mediaPlayer, long componentId) {
dump("NSObject", nsobjectCanvas);
libvlc.libvlc_media_player_set_nsobject(nsobjectMediaPlayer.mediaPlayerInstance(), componentId);
}
});
nsviewVideoSurface = new CanvasVideoSurface(nsviewCanvas, new VideoSurfaceAdapter() {
@Override
public void attach(LibVlc libvlc, MediaPlayer mediaPlayer, long componentId) {
dump("NSView", nsviewCanvas);
// TODO shouldn't this component pointer be on the attach template method?
// (that may be moot since it returns the same value anyway)
try {
long viewPtr = getViewPointer(nsviewCanvas);
libvlc.libvlc_media_player_set_nsobject(nsobjectMediaPlayer.mediaPlayerInstance(), viewPtr);
}
catch(Throwable t) {
System.out.println("Failed to set nsobject view");
}
}
});
xwindowVideoSurface = new CanvasVideoSurface(xwindowCanvas, new VideoSurfaceAdapter() {
@Override
public void attach(LibVlc libvlc, MediaPlayer mediaPlayer, long componentId) {
dump("XWindow", xwindowCanvas);
libvlc.libvlc_media_player_set_xwindow(xwindowMediaPlayer.mediaPlayerInstance(), RuntimeUtil.safeLongToInt(componentId));
}