Package uk.co.caprica.vlcj.player

Examples of uk.co.caprica.vlcj.player.MediaPlayerFactory


    }

    public VisualisationPlayer(String mrl) {
        this.mrl = mrl;

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

        canvas = new Canvas();
        canvas.setBackground(Color.black);
View Full Code Here


    /**
     * Create a test audio player.
     */
    public DirectAudioPlayerTest() throws IOException {
        factory = new MediaPlayerFactory();
        audioPlayer = factory.newDirectAudioPlayer("S16N", 44100, 2, new TestAudioCallbackAdapter(new File("test.raw")));
        audioPlayer.addMediaPlayerEventListener(new MediaPlayerEventAdapter() {

            @Override
            public void playing(MediaPlayer mediaPlayer) {
View Full Code Here

    /**
     * Create a media player.
     */
    public TimecodeTest() {
        factory = new MediaPlayerFactory(
            "--input-slave", "timecode://",
            "--timecode-fps", "25/1"            // <--- Tweak this to suit
        );

        player = factory.newHeadlessMediaPlayer();
View Full Code Here

        frame.setIconImage(new ImageIcon(getClass().getResource("/icons/vlcj-logo.png")).getImage());
        frame.setContentPane(contentPane);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();

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

        videoSurface = factory.newVideoSurface(canvas);

        mediaPlayer.setVideoSurface(videoSurface);
View Full Code Here

            }
        });
    }

    public ScreenRecorder(final String destination) {
        mediaPlayerFactory = new MediaPlayerFactory(OPTIONS);
        mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer();
        JPanel cp = new JPanel();
        JButton recordButton = new JButton("Record");
        cp.add(recordButton);
        frame = new JFrame("vlcj");
View Full Code Here

public class AudioOutputsTest extends VlcjTest {

    private static final String FORMAT_PATTERN = "%3s %-12s %-40s %-40s %s\n";

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

        List<AudioOutput> audioOutputs = factory.getAudioOutputs();

        System.out.println("Audio Outputs:");
        System.out.println();

        System.out.printf(FORMAT_PATTERN, "#", "Name", "Description", "Devices", "Long Name");
View Full Code Here

            }
        });
    }

    public SetAudioOutputTest(final String mrl) {
        factory = new MediaPlayerFactory();
        mediaPlayer = factory.newEmbeddedMediaPlayer();
        audioOutputs = factory.getAudioOutputs();

        canvas = new Canvas();
        canvas.setBackground(Color.black);
View Full Code Here

* Test of the static equalizer preset data provided by the media player factory.
*/
public class EqualizerCapabilityTest extends VlcjTest {

    public static void main(String[] args) {
        MediaPlayerFactory factory = new MediaPlayerFactory();

        if(!factory.isEqualizerAvailable()) {
            System.out.println("Equalizer not available on this platform");
            System.exit(0);
        }

        System.out.println("Preset names:");
        List<String> presetNames = factory.getEqualizerPresetNames();
        for(String presetName : presetNames) {
            System.out.printf(" %s%n", presetName);
        }
        System.out.println();

        System.out.println("Band frequencies:");
        List<Float> bandFrequencies = factory.getEqualizerBandFrequencies();
        for(Float freq : bandFrequencies) {
            System.out.printf(" %f Hz%n", freq);
        }
        System.out.println();

        // You can get individual presets by name, or get them all in one call as is done here...

        Map<String, Equalizer> allPresets = factory.getAllPresetEqualizers();
        for(String presetName : allPresets.keySet()) {
            System.out.printf("%s:%n", presetName);
            Equalizer preset = allPresets.get(presetName);
            System.out.printf("%10s : %f Hz%n", "preamp", preset.getPreamp());
            float[] amps = preset.getAmps();
View Full Code Here

public class FilterTest extends VlcjTest {

    private static final String FORMAT_PATTERN = "%3s %-24s %-24s %-80s %s\n";

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

        List<ModuleDescription> audioFilters = factory.getAudioFilters();
        List<ModuleDescription> videoFilters = factory.getVideoFilters();

        System.out.println("Audio Filters:");
        System.out.println();

        System.out.printf(FORMAT_PATTERN, "#", "Name", "Short Name", "Long Name", "Help");
View Full Code Here

* Requires libvlc 1.2.x.
*/
public class ClockTest extends VlcjTest {

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

        Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                System.out.printf("Clock: %d\n", factory.clock());
            }
        }, 0, 1, TimeUnit.SECONDS);

        Thread.sleep(10000);

View Full Code Here

TOP

Related Classes of uk.co.caprica.vlcj.player.MediaPlayerFactory

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.