Package org.gstreamer.swing

Examples of org.gstreamer.swing.VideoComponent


                + ", bpp=32, depth=32, framerate=25/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                // Create the video component and link it in
                VideoComponent videoComponent = new VideoComponent();
                Element videosink = videoComponent.getElement();
                pipe.addMany(videosrc, videofilter, videosink);
                Element.linkMany(videosrc, videofilter, videosink);
               
                // Now create a JFrame to display the video output
                JFrame frame = new JFrame("Swing Video Test");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.add(videoComponent, BorderLayout.CENTER);
                videoComponent.setPreferredSize(new Dimension(720, 576));
                frame.pack();
                frame.setVisible(true);
               
                // Start the pipeline processing
                pipe.play();
View Full Code Here


        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                frame = new JFrame("DecodeBin Player");

                videoComponent = new VideoComponent();
                videoComponent.setPreferredSize(new Dimension(640, 480));

                frame.add(videoComponent, BorderLayout.CENTER);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.pack();
View Full Code Here

                + ", bpp=32, depth=32, framerate=25/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                // Create the video component and link it in
                VideoComponent videoComponent = new VideoComponent();
                System.out.println(PREFIX + "VideoComponent created successfully");
                System.out.flush();
                Element videosink = videoComponent.getElement();
                pipe.addMany(videosrc, videofilter, videosink);
                Element.linkMany(videosrc, videofilter, videosink);

                // Now create a JFrame to display the video output
                JFrame frame = new JFrame("Swing Video Test");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.add(videoComponent, BorderLayout.CENTER);
                videoComponent.setPreferredSize(new Dimension(width, height));
                frame.pack();
                frame.setVisible(true);

                // Start the pipeline processing
                pipe.play();
View Full Code Here

        ratefilter.setCaps(Caps.fromString("video/x-raw-rgb, framerate=2/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                JFrame frame = new JFrame("FakeSrcTest");
                VideoComponent panel = new VideoComponent();
                panel.setPreferredSize(new Dimension(width, height));
                frame.add(panel, BorderLayout.CENTER);
                Element videosink = panel.getElement();
                pipeline.addMany(appsrc, srcfilter, videorate, ratefilter, videosink);
                Element.linkMany(appsrc, srcfilter, videorate, ratefilter, videosink);
                appsrc.set("emit-signals", true);
                appsrc.connect(new AppSrc.NEED_DATA() {
                    byte color = 0;
View Full Code Here

        ratefilter.setCaps(Caps.fromString("video/x-raw-rgb, framerate=2/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                JFrame frame = new JFrame("FakeSrcTest");
                VideoComponent panel = new VideoComponent();
                panel.setPreferredSize(new Dimension(width, height));
                frame.add(panel, BorderLayout.CENTER);
                Element videosink = panel.getElement();
                pipeline.addMany(fakesrc, srcfilter, videorate, ratefilter, videosink);
                Element.linkMany(fakesrc, srcfilter, videorate, ratefilter, videosink);
                fakesrc.set("signal-handoffs", true);
                fakesrc.set("sizemax", width * height * 2);
                fakesrc.set("sizetype", 2);
View Full Code Here

        final Element navtest = ElementFactory.make("navigationtest", "navtest");
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                System.out.println("Creating GstVideoComponent");
                final VideoComponent videoComponent = new VideoComponent();
                videoComponent.setPreferredSize(new Dimension(width, height));
                JFrame frame = new JFrame("Swing Video Test");
                frame.add(videoComponent, BorderLayout.CENTER);
                //
                // Propagate key events.  This could be done with focus, but this
                // test uses the same code as used in VideoPlayer.
                //
                frame.addKeyListener(new KeyAdapter() {

                    public void keyPressed(KeyEvent evt) {
                        for (KeyListener l : videoComponent.getKeyListeners()) {
                            l.keyPressed(evt);
                        }
                    }

                    @Override
                    public void keyReleased(KeyEvent evt) {
                        for (KeyListener l : videoComponent.getKeyListeners()) {
                            l.keyReleased(evt);
                        }
                    }
                   
                });
               
                Element videosink = videoComponent.getElement();

                System.out.println("Adding elements to pipeline");
                pipeline.addMany(fakesrc, flt, navtest, videosink);
                Element.linkMany(fakesrc, flt, navtest, videosink);
                pipeline.play();
View Full Code Here

            public void run() {
                //
                // A VideoComponent displays video in a lightweight swing component
                //
                VideoComponent videoComponent = new VideoComponent();
               
                // Add the video component as the playbin video output
                playbin.setVideoSink(videoComponent.getElement());
               
                // Start the pipeline playing
                playbin.play();
               
                //
View Full Code Here

        pauseButton.setEnabled(true);
        progressSlider.setEnabled(true);

        java.io.File ioFile = getJFile(file);

        gstVideoComponent = new VideoComponent();
        synchronized (playbinLock) {
            if (gstPlaybin2 != null) {
                gstPlaybin2.dispose();
            }
            gstPlaybin2 = new PlayBin2("VideoPlayer"); //NON-NLS
View Full Code Here

        //        + "dvdec ! ffmpegcolorspace ! video/x-raw-rgb, width=720, height=576"
        //        + ", bpp=32, depth=24, framerate=25/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                VideoComponent videoComponent = new VideoComponent();
                Element videosink = videoComponent.getElement();
                pipe.addMany(videosrc, videofilter, videosink);
                Element.linkMany(videosrc, videofilter, videosink);

                // Now create a JFrame to display the video output
                JFrame frame = new JFrame("Duo: Testando webacam com gstream");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.add(videoComponent, BorderLayout.CENTER);
                videoComponent.setPreferredSize(new Dimension(720, 576));
                frame.pack();
                frame.setVisible(true);

                // Start the pipeline processing
                pipe.setState(State.PLAYING);
View Full Code Here

                + "dvdec ! ffmpegcolorspace ! video/x-raw-rgb, width=320, height=240"
                + ", bpp=32, depth=24, framerate=25/1"));
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                VideoComponent videoComponent = new VideoComponent();
                Element videosink = videoComponent.getElement();
                pipe.addMany(videosrc, videofilter, videosink);
                Element.linkMany(videosrc, videofilter, videosink);

                // Now create a JFrame to display the video output
                JFrame frame = new JFrame("Duo: webacam com gstreamer.");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.add(videoComponent, BorderLayout.CENTER);
                //videoComponent.setPreferredSize(new Dimension(720, 576));
                videoComponent.setPreferredSize(new Dimension(320, 240));
                frame.pack();
                frame.setVisible(true);

                // Start the pipeline processing
                pipe.setState(State.PLAYING);
View Full Code Here

TOP

Related Classes of org.gstreamer.swing.VideoComponent

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.