Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
c26e07cd
Commit
c26e07cd
authored
Oct 24, 2006
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrate patch from Ticket #725. needs testing.
parent
b6eebc11
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
273 additions
and
3 deletions
+273
-3
THANKS
THANKS
+1
-0
bindings/java/org/videolan/jvlc/VLM.java
bindings/java/org/videolan/jvlc/VLM.java
+46
-0
bindings/java/src/video-jni.cc
bindings/java/src/video-jni.cc
+1
-1
bindings/java/src/vlm-jni.cc
bindings/java/src/vlm-jni.cc
+58
-0
include/vlc/libvlc.h
include/vlc/libvlc.h
+31
-1
src/control/vlm.c
src/control/vlm.c
+136
-1
No files found.
THANKS
View file @
c26e07cd
...
@@ -88,6 +88,7 @@ Jeroen Massar <jeroen at unfix dot org> - IPv6 hostname resolution fix
...
@@ -88,6 +88,7 @@ Jeroen Massar <jeroen at unfix dot org> - IPv6 hostname resolution fix
Jérôme Guilbaud - Update of the WinAmp 5 VLC skin
Jérôme Guilbaud - Update of the WinAmp 5 VLC skin
Joel Arvidsson <dogai at privat.utfors.se> - Swedish translation
Joel Arvidsson <dogai at privat.utfors.se> - Swedish translation
Joeri van Dooren <joeri at van.dooren.be> - OS X icon (v0.4.0)
Joeri van Dooren <joeri at van.dooren.be> - OS X icon (v0.4.0)
Jörg<vlc-ml at aab.noctis dot de> - VLM seek/show media functions
Johen Michael Zorko <zorko at att.net> - fix for delay issues in udp sout
Johen Michael Zorko <zorko at att.net> - fix for delay issues in udp sout
John Paul Lorenti <jpl31 at columbia.edu> - ALSA device selection patch
John Paul Lorenti <jpl31 at columbia.edu> - ALSA device selection patch
Jonas Larsen <jonas at vrt.dk> - Danish translation
Jonas Larsen <jonas at vrt.dk> - Danish translation
...
...
bindings/java/org/videolan/jvlc/VLM.java
View file @
c26e07cd
...
@@ -19,6 +19,15 @@ public class VLM implements VLMIntf {
...
@@ -19,6 +19,15 @@ public class VLM implements VLMIntf {
private
native
void
_playMedia
(
String
mediaName
);
private
native
void
_playMedia
(
String
mediaName
);
private
native
void
_stopMedia
(
String
mediaName
);
private
native
void
_stopMedia
(
String
mediaName
);
private
native
void
_pauseMedia
(
String
mediaName
);
private
native
void
_pauseMedia
(
String
mediaName
);
private
native
void
_seekMedia
(
String
mediaName
,
float
percentage
);
private
native
String
_showMedia
(
String
mediaName
);
private
native
float
_getMediaposition
(
String
name
,
int
mediaInstance
);
private
native
int
_getMediatime
(
String
name
,
int
mediaInstance
);
private
native
int
_getMedialength
(
String
name
,
int
mediaInstance
);
private
native
int
_getMediarate
(
String
name
,
int
mediaInstance
);
private
native
int
_getMediatitle
(
String
name
,
int
mediaInstance
);
private
native
int
_getMediachapter
(
String
name
,
int
mediaInstance
);
private
native
int
_getMediaseekable
(
String
name
,
int
mediaInstance
);
public
VLM
(
long
instance
)
{
public
VLM
(
long
instance
)
{
this
.
libvlcInstance
=
instance
;
this
.
libvlcInstance
=
instance
;
...
@@ -68,6 +77,43 @@ public class VLM implements VLMIntf {
...
@@ -68,6 +77,43 @@ public class VLM implements VLMIntf {
_pauseMedia
(
name
);
_pauseMedia
(
name
);
}
}
public
void
seekMedia
(
String
name
,
float
percentage
)
throws
VLCException
{
_seekMedia
(
name
,
percentage
);
}
public
String
showMedia
(
String
name
)
throws
VLCException
{
return
_showMedia
(
name
);
}
public
float
getMediaPosition
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMediaposition
(
name
,
mediaInstance
);
}
public
int
getMediaTime
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMediatime
(
name
,
mediaInstance
);
}
public
int
getMediaLength
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMedialength
(
name
,
mediaInstance
);
}
public
int
getMediaRate
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMediarate
(
name
,
mediaInstance
);
}
public
int
getMediaTitle
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMediatitle
(
name
,
mediaInstance
);
}
public
int
getMediaChapter
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMediachapter
(
name
,
mediaInstance
);
}
public
boolean
getMediaSeekable
(
String
name
,
int
mediaInstance
)
throws
VLCException
{
return
_getMediaseekable
(
name
,
mediaInstance
)
>
0
;
}
public
long
getInstance
()
{
public
long
getInstance
()
{
return
libvlcInstance
;
return
libvlcInstance
;
}
}
...
...
bindings/java/src/video-jni.cc
View file @
c26e07cd
...
@@ -200,7 +200,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
...
@@ -200,7 +200,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
XSetBackground
(
dsi_x11
->
display
,
gc
,
0
);
XSetBackground
(
dsi_x11
->
display
,
gc
,
0
);
/* and reparent */
/* and reparent */
libvlc_video_reparent
(
input
,
dsi_x11
->
drawable
,
exception
);
libvlc_video_reparent
(
input
,
(
libvlc_drawable_t
)
dsi_x11
->
drawable
,
exception
);
CHECK_EXCEPTION_FREE
;
CHECK_EXCEPTION_FREE
;
...
...
bindings/java/src/vlm-jni.cc
View file @
c26e07cd
...
@@ -217,3 +217,61 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1pauseMedia (JNIEnv *env, job
...
@@ -217,3 +217,61 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1pauseMedia (JNIEnv *env, job
}
}
}
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_VLM__1seekMedia
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jfloat
percentage
)
{
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_seek_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
float
)
percentage
,
exception
);
CHECK_EXCEPTION_FREE
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
}
JNIEXPORT
jstring
JNICALL
Java_org_videolan_jvlc_VLM__1showMedia
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
)
{
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
char
*
psz_response
;
jstring
js_response
;
psz_response
=
libvlc_vlm_show_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
CHECK_EXCEPTION_FREE
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
js_response
=
env
->
NewStringUTF
(
psz_response
);
if
(
psz_response
!=
NULL
)
{
free
(
psz_response
);
}
return
js_response
;
}
#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, dummyGetType, dummyDefault)\
JNIEXPORT j ## returnType JNICALL Java_org_videolan_jvlc_VLM__1getMedia ## attr(JNIEnv *env, jobject _this, jstring name, jint index) \
{ \
INIT_FUNCTION; \
const char* psz_name = env->GetStringUTFChars( name, 0 ); \
returnType response; \
\
response = libvlc_vlm_get_media_ ## attr( (libvlc_instance_t *) instance, (char*)psz_name, (int)index, exception ); \
CHECK_EXCEPTION_FREE ; \
\
if (psz_name != NULL) { \
env->ReleaseStringUTFChars( name, psz_name ); \
} \
return response; \
}
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
position
,
float
,
Float
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
time
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
length
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
rate
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
title
,
int
,
Integer
,
0
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
chapter
,
int
,
Integer
,
0
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
seekable
,
int
,
Bool
,
0
);
#undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
include/vlc/libvlc.h
View file @
c26e07cd
...
@@ -580,7 +580,37 @@ void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * )
...
@@ -580,7 +580,37 @@ void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * )
*/
*/
void
libvlc_vlm_pause_media
(
libvlc_instance_t
*
,
char
*
,
libvlc_exception_t
*
);
void
libvlc_vlm_pause_media
(
libvlc_instance_t
*
,
char
*
,
libvlc_exception_t
*
);
/**
* Seeks in the named broadcast.
* \param p_instance the instance
* \param psz_name the name of the broadcast
* \param f_percentage the percentage to seek to
* \param p_exception an initialized exception
*/
void
libvlc_vlm_seek_media
(
libvlc_instance_t
*
,
char
*
,
float
,
libvlc_exception_t
*
);
/**
* Return information of the named broadcast.
* \param p_instance the instance
* \param psz_name the name of the broadcast
* \param p_exception an initialized exception
*/
char
*
libvlc_vlm_show_media
(
libvlc_instance_t
*
,
char
*
,
libvlc_exception_t
*
);
#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
char *, int , libvlc_exception_t * );
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
position
,
float
,
Float
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
time
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
length
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
rate
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
title
,
int
,
Integer
,
0
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
chapter
,
int
,
Integer
,
0
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
seekable
,
int
,
Bool
,
0
);
#undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
/** @} */
/** @} */
/** @} */
/** @} */
...
...
src/control/vlm.c
View file @
c26e07cd
...
@@ -290,6 +290,141 @@ void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
...
@@ -290,6 +290,141 @@ void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
libvlc_exception_raise
(
p_exception
,
"Unable to pause %s"
,
libvlc_exception_raise
(
p_exception
,
"Unable to pause %s"
,
psz_name
);
psz_name
);
}
}
free
(
psz_message
);
free
(
psz_message
);
#endif
}
void
libvlc_vlm_seek_media
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
float
f_percentage
,
libvlc_exception_t
*
p_exception
)
{
char
*
psz_message
;
vlm_message_t
*
answer
;
CHECK_VLM
;
#ifdef ENABLE_VLM
asprintf
(
&
psz_message
,
"control %s seek %f"
,
psz_name
,
f_percentage
);
vlm_ExecuteCommand
(
p_instance
->
p_vlm
,
psz_message
,
&
answer
);
if
(
answer
->
psz_value
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to seek %s to %f"
,
psz_name
,
f_percentage
);
}
free
(
psz_message
);
#endif
}
#ifdef ENABLE_VLM
#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *p_instance, \
char *psz_name, int i_instance, \
libvlc_exception_t *p_exception ) \
{ \
vlm_media_instance_t *p_media_instance; \
CHECK_VLM; \
vlm_media_t *p_media; \
p_media = vlm_MediaSearch( p_instance->p_vlm, psz_name ); \
if ( p_media == NULL ) \
{ \
libvlc_exception_raise( p_exception, "Unable to find media %s", \
psz_name); \
} \
else \
{ \
if ( i_instance < p_media->i_instance ) \
{ \
p_media_instance = p_media->instance[ i_instance ]; \
return var_Get ## getType( p_media_instance->p_input, #attr );\
} \
else \
{ \
libvlc_exception_raise( p_exception, "Media index %i out of range",\
i_instance); \
} \
} \
return default; \
}
#else
#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *p_instance, \
char *psz_name, int i_instance, libvlc_exception_t *p_exception ) \
{ \
char *psz_message; \
vlm_message_t *answer; \
CHECK_VLM; \
return default; \
}
#endif
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
position
,
float
,
Float
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
time
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
length
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
rate
,
int
,
Integer
,
-
1
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
title
,
int
,
Integer
,
0
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
chapter
,
int
,
Integer
,
0
);
LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
(
seekable
,
int
,
Bool
,
0
);
#undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
char
*
libvlc_vlm_show_media
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
libvlc_exception_t
*
p_exception
)
{
char
*
recurse_answer
(
char
*
psz_prefix
,
vlm_message_t
*
p_answer
)
{
char
*
psz_childprefix
;
char
*
psz_response
=
""
;
char
*
response_tmp
;
int
i
;
vlm_message_t
*
aw_child
,
**
paw_child
;
asprintf
(
&
psz_childprefix
,
"%s%s."
,
psz_prefix
,
p_answer
->
psz_name
);
if
(
p_answer
->
i_child
)
{
paw_child
=
p_answer
->
child
;
aw_child
=
*
(
paw_child
);
for
(
i
=
0
;
i
<
p_answer
->
i_child
;
i
++
)
{
asprintf
(
&
response_tmp
,
"%s%s%s:%s
\n
"
,
psz_response
,
psz_prefix
,
aw_child
->
psz_name
,
aw_child
->
psz_value
);
free
(
psz_response
);
psz_response
=
response_tmp
;
if
(
aw_child
->
i_child
)
{
asprintf
(
&
response_tmp
,
"%s%s"
,
psz_response
,
recurse_answer
(
psz_childprefix
,
aw_child
));
free
(
psz_response
);
psz_response
=
response_tmp
;
}
paw_child
++
;
aw_child
=
*
(
paw_child
);
}
}
free
(
psz_childprefix
);
return
psz_response
;
}
char
*
psz_message
;
vlm_message_t
*
answer
;
char
*
psz_response
;
CHECK_VLM
;
#ifdef ENABLE_VLM
asprintf
(
&
psz_message
,
"show %s"
,
psz_name
);
asprintf
(
&
psz_response
,
""
,
psz_name
);
vlm_ExecuteCommand
(
p_instance
->
p_vlm
,
psz_message
,
&
answer
);
if
(
answer
->
psz_value
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to call show %s: %s"
,
psz_name
,
answer
->
psz_value
);
}
else
{
if
(
answer
->
child
)
{
psz_response
=
recurse_answer
(
""
,
answer
);
}
}
free
(
psz_message
);
return
(
psz_response
);
#endif
#endif
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment