1 /*****************************************************************************
2 * MediaInstance.java: VLC Java Bindings
3 *****************************************************************************
4 * Copyright (C) 1998-2007 the VideoLAN team
6 * Authors: Filippo Carone <filippo@carone.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
26 package org.videolan.jvlc;
29 public class MediaInstance
31 private long _media_instance;
33 private native long _new_media_instance();
34 private native long _new_from_media_descriptor(MediaDescriptor mediaDescriptor);
35 private native void _instance_release(long mediaInstance);
36 private native void _instance_retain();
37 private native void _set_media_descriptor();
38 private native MediaDescriptor _get_media_descriptor();
39 private native EventManager _event_manager();
40 private native void _play();
41 private native void _stop();
42 private native void _pause();
43 private native void _set_drawable();
44 private native long _get_length();
45 private native long _get_time();
46 private native void _set_time(long time);
47 private native float _get_position();
48 private native void _set_position(float position);
49 private native boolean _will_play();
50 private native float _get_rate();
51 private native void _set_rate(float rate);
52 private native void _get_state();
53 private native boolean _has_vout();
54 private native float _get_fps();
56 public MediaInstance()
58 this._media_instance = _new_media_instance();
61 public MediaInstance(MediaDescriptor mediaDescriptor)
63 this._media_instance = _new_from_media_descriptor(mediaDescriptor);
66 public MediaDescriptor getMediaDescriptor()
68 return _get_media_descriptor();
71 public void setMediaDescriptor(MediaDescriptor mediaDescriptor)
73 _new_from_media_descriptor(mediaDescriptor);
76 public EventManager getEventManager()
78 return _event_manager();
96 public long getLength()
101 public long getTime()
106 public void setTime(long time)
111 public float getPosition()
113 return _get_position();
116 public void setPosition(float position)
118 _set_position(position);
121 public boolean willPlay()
126 public float getRate()
131 public void setRate(float rate)
136 public boolean hasVideoOutput()
141 public float getFPS()
150 protected void finalize() throws Throwable
153 _instance_release(_media_instance);