4 package org.videolan.jvlc;
6 import java.awt.Dimension;
7 import java.awt.Graphics;
9 public final class Video implements VideoIntf {
11 private long libvlcInstance;
13 private JVLCCanvas actualCanvas;
15 public Video( long libvlcInstance) {
16 this.libvlcInstance = libvlcInstance;
20 * Video native methods
22 private native void _toggleFullscreen();
23 private native void _setFullscreen( boolean value);
24 private native boolean _getFullscreen();
25 private native int _getHeight();
26 private native int _getWidth();
27 private native void _getSnapshot(String filename,int width,int height);
28 private native void _destroyVideo();
29 private native void _reparent(JVLCCanvas component);
30 private native void _setSize(int width, int height);
31 private native void _paint(JVLCCanvas canvas, Graphics g);
34 * @see org.videolan.jvlc.VideoIntf#destroyVideo()
36 public void destroyVideo() throws VLCException {
41 * @see org.videolan.jvlc.VideoIntf#getFullscreen()
43 public boolean getFullscreen() throws VLCException {
44 return _getFullscreen();
48 * @see org.videolan.jvlc.VideoIntf#getSnapshot(java.lang.String)
50 public void getSnapshot(String filepath,int width,int height) throws VLCException {
51 _getSnapshot( filepath , width, height);
55 * @see org.videolan.jvlc.VideoIntf#getVideoHeight()
57 public int getHeight() throws VLCException {
62 * @see org.videolan.jvlc.VideoIntf#getVideoWidth()
64 public int getWidth() throws VLCException {
69 * @see org.videolan.jvlc.VideoIntf#reparentVideo(java.awt.Component)
71 public void reparent(JVLCCanvas c) throws VLCException {
77 * @see org.videolan.jvlc.VideoIntf#resizeVideo(int, int)
79 public void setSize(int width, int height) throws VLCException {
80 _setSize( width, height );
84 * @see org.videolan.jvlc.VideoIntf#setFullscreen(boolean)
86 public void setFullscreen(boolean fullscreen) throws VLCException {
87 _setFullscreen( fullscreen );
91 * @see org.videolan.jvlc.VideoIntf#toggleFullscreen()
93 public void toggleFullscreen() throws VLCException {
98 * @see org.videolan.jvlc.VideoIntf#getSize()
100 public Dimension getSize() throws VLCException {
101 return new Dimension (getWidth(), getHeight());
105 * @see org.videolan.jvlc.VideoIntf#setSize(java.awt.Dimension)
107 public void setSize(Dimension d) throws VLCException {
108 setSize(d.width, d.height);
111 public void paint(Graphics g) {
112 _paint(actualCanvas, g);
115 public void setActualCanvas(JVLCCanvas canvas) {
116 actualCanvas = canvas;
119 public long getInstance() {
120 return libvlcInstance;