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();