Package uk.co.caprica.vlcj.player.embedded.videosurface

Examples of uk.co.caprica.vlcj.player.embedded.videosurface.CanvasVideoSurface


        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));
            }
View Full Code Here


        MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(args);
        EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();

        Canvas canvas = new Canvas();
        canvas.setBackground(Color.black);
        CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);
        mediaPlayer.setVideoSurface(videoSurface);

        JFrame f = new JFrame("vlcj duplicate output test");
        f.setIconImage(new ImageIcon(StreamRtpDuplicate.class.getResource("/icons/vlcj-logo.png")).getImage());
        f.add(canvas);
View Full Code Here

    public static void main(String[] args) throws Exception {
        MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();

        Canvas canvas = new Canvas();
        canvas.setBackground(Color.black);
        CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);

        EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();
        mediaPlayer.setVideoSurface(videoSurface);

        MediaListPlayer mediaListPlayer = mediaPlayerFactory.newMediaListPlayer();
View Full Code Here

        });

        factory = new MediaPlayerFactory();
        mediaPlayer = factory.newEmbeddedMediaPlayer();

        CanvasVideoSurface cvs = factory.newVideoSurface(c);
        mediaPlayer.setVideoSurface(cvs);
    }
View Full Code Here

            videoSurfaceAdapter = new MacVideoSurfaceAdapter();
        }
        else {
            throw new RuntimeException("Unable to create a media player - failed to detect a supported operating system");
        }
        CanvasVideoSurface videoSurface = new CanvasVideoSurface(canvas, videoSurfaceAdapter);
        Logger.debug("videoSurface={}", videoSurface);
        return videoSurface;
    }
View Full Code Here

TOP

Related Classes of uk.co.caprica.vlcj.player.embedded.videosurface.CanvasVideoSurface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.