Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
8444ce12
Commit
8444ce12
authored
Feb 15, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More VLM API stuff
parent
73c29a6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
167 additions
and
17 deletions
+167
-17
include/vlc/libvlc.h
include/vlc/libvlc.h
+36
-0
src/control/vlm.c
src/control/vlm.c
+90
-16
test/native/libvlc.c
test/native/libvlc.c
+41
-1
No files found.
include/vlc/libvlc.h
View file @
8444ce12
...
...
@@ -346,6 +346,42 @@ void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
void
libvlc_vlm_set_enabled
(
libvlc_instance_t
*
,
char
*
,
int
,
libvlc_exception_t
*
);
/**
* Set the output for a media
* \param p_instance the instance
* \param psz_name the media to work on
* \param psz_output the output MRL (the parameter to the "sout" variable)
* \param p_exception an initialized exception
*/
void
libvlc_vlm_set_output
(
libvlc_instance_t
*
,
char
*
,
char
*
,
libvlc_exception_t
*
);
/**
* Set a media's input MRL. This will delete all existing inputs and
* add the specified one.
* \param p_instance the instance
* \param psz_name the media to work on
* \param psz_input the input MRL
* \param p_exception an initialized exception
*/
void
libvlc_vlm_set_input
(
libvlc_instance_t
*
,
char
*
,
char
*
,
libvlc_exception_t
*
);
/**
* Set output for a media
* \param p_instance the instance
* \param psz_name the media to work on
* \param b_loop the new status
* \param p_exception an initialized exception
*/
void
libvlc_vlm_set_loop
(
libvlc_instance_t
*
,
char
*
,
int
,
libvlc_exception_t
*
);
/**
* Edit the parameters of a media. This will delete all existing inputs and
* add the specified one.
...
...
src/control/vlm.c
View file @
8444ce12
...
...
@@ -39,6 +39,13 @@ void InitVLM( libvlc_instance_t *p_instance )
libvlc_exception_raise( p_exception, \
"Unable to create VLM" ); return; } }
#define GET_MEDIA { p_media = vlm_MediaSearch( p_instance->p_vlm, psz_name );\
if( !p_media ) \
{ \
libvlc_exception_raise( p_exception, \
"Media %s does not exist", \
psz_name ); return; } }
void
libvlc_vlm_add_broadcast
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
char
*
psz_input
,
char
*
psz_output
,
int
i_options
,
char
**
ppsz_options
,
...
...
@@ -82,36 +89,103 @@ void libvlc_vlm_set_enabled( libvlc_instance_t *p_instance, char *psz_name,
{
vlm_media_t
*
p_media
;
CHECK_VLM
;
GET_MEDIA
;
if
(
b_enabled
!=
0
)
b_enabled
=
1
;
p_media
=
vlm_MediaSearch
(
p_instance
->
p_vlm
,
psz_name
);
if
(
!
p_media
)
{
libvlc_exception_raise
(
p_exception
,
"Media %s does not exist"
,
psz_name
);
return
;
}
p_media
->
b_enabled
=
b_enabled
;
}
void
libvlc_vlm_set_loop
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
int
b_loop
,
libvlc_exception_t
*
p_exception
)
{
vlm_media_t
*
p_media
;
CHECK_VLM
;
GET_MEDIA
;
if
(
b_loop
!=
0
)
b_loop
=
1
;
p_media
->
b_loop
=
b_loop
;
}
void
libvlc_vlm_set_output
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
char
*
psz_output
,
libvlc_exception_t
*
p_exception
)
{
vlm_media_t
*
p_media
;
int
i_ret
;
CHECK_VLM
;
GET_MEDIA
;
vlc_mutex_lock
(
&
p_instance
->
p_vlm
->
lock
);
i_ret
=
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"output"
,
psz_output
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to set output"
);
return
;}
vlc_mutex_unlock
(
&
p_instance
->
p_vlm
->
lock
);
}
void
libvlc_vlm_set_input
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
char
*
psz_input
,
libvlc_exception_t
*
p_exception
)
{
vlm_media_t
*
p_media
;
int
i_ret
;
CHECK_VLM
;
GET_MEDIA
;
vlc_mutex_lock
(
&
p_instance
->
p_vlm
->
lock
);
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"inputdel"
,
"all"
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to change input"
);
return
;}
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"input"
,
psz_input
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to change input"
);
return
;}
vlc_mutex_unlock
(
&
p_instance
->
p_vlm
->
lock
);
}
void
libvlc_vlm_add_input
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
char
*
psz_input
,
libvlc_exception_t
*
p_exception
)
{
vlm_media_t
*
p_media
;
int
i_ret
;
CHECK_VLM
;
GET_MEDIA
;
vlc_mutex_lock
(
&
p_instance
->
p_vlm
->
lock
);
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"input"
,
psz_input
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to change input"
);
return
;}
vlc_mutex_unlock
(
&
p_instance
->
p_vlm
->
lock
);
}
void
libvlc_vlm_change_media
(
libvlc_instance_t
*
p_instance
,
char
*
psz_name
,
char
*
psz_input
,
char
*
psz_output
,
int
i_options
,
char
**
ppsz_options
,
int
b_enabled
,
int
b_loop
,
libvlc_exception_t
*
p_exception
)
{
vlm_media_t
*
p_media
;
int
i_ret
;
CHECK_VLM
;
GET_MEDIA
;
if
(
b_enabled
!=
0
)
b_enabled
=
1
;
if
(
b_loop
!=
0
)
b_loop
=
1
;
p_media
=
vlm_MediaSearch
(
p_instance
->
p_vlm
,
psz_name
);
if
(
!
p_media
)
{
libvlc_exception_raise
(
p_exception
,
"Media %s does not exist"
,
psz_name
);
return
;
}
vlc_mutex_lock
(
&
p_instance
->
p_vlm
->
lock
);
i_ret
=
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"output"
,
psz_output
);
if
(
i_ret
)
libvlc_exception_raise
(
p_exception
,
"Unable to set output"
);
p_media
->
b_enabled
=
b_enabled
;
p_media
->
b_loop
=
b_loop
;
i_ret
=
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"output"
,
psz_output
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to set output"
);
return
;}
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"inputdel"
,
"all"
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to change input"
);
return
;}
vlm_MediaSetup
(
p_instance
->
p_vlm
,
p_media
,
"input"
,
psz_input
);
if
(
i_ret
)
{
libvlc_exception_raise
(
p_exception
,
"Unable to change input"
);
return
;}
vlc_mutex_unlock
(
&
p_instance
->
p_vlm
->
lock
);
}
test/native/libvlc.c
View file @
8444ce12
...
...
@@ -93,15 +93,55 @@ static PyObject *vlm_test( PyObject *self, PyObject *args )
{
libvlc_instance_t
*
p_instance
;
char
*
argv
[]
=
{
"vlc"
,
"--quiet"
};
char
*
ppsz_empty
[]
=
{};
libvlc_exception_t
exception
;
libvlc_exception_init
(
&
exception
);
p_instance
=
libvlc_new
(
2
,
argv
,
&
exception
);
ASSERT_NOEXCEPTION
;
/* Test that working on unexisting streams fail */
libvlc_vlm_set_enabled
(
p_instance
,
"test"
,
1
,
&
exception
);
ASSERT_EXCEPTION
;
libvlc_exception_clear
(
&
exception
);
libvlc_vlm_set_input
(
p_instance
,
"test"
,
"input"
,
&
exception
);
ASSERT_EXCEPTION
;
libvlc_exception_clear
(
&
exception
);
libvlc_vlm_del_media
(
p_instance
,
"test"
,
&
exception
);
ASSERT_EXCEPTION
;
libvlc_exception_clear
(
&
exception
);
/******* Broadcast *******/
/* Now create a media */
libvlc_vlm_add_broadcast
(
p_instance
,
"test"
,
"input_test"
,
"output_test"
,
0
,
ppsz_empty
,
1
,
1
,
&
exception
);
ASSERT_NOEXCEPTION
;
libvlc_exception_clear
(
&
exception
);
/* Change its parameters */
libvlc_vlm_set_enabled
(
p_instance
,
"test"
,
0
,
&
exception
);
ASSERT_NOEXCEPTION
;
libvlc_exception_clear
(
&
exception
);
libvlc_vlm_set_output
(
p_instance
,
"test"
,
"output_test2"
,
&
exception
);
ASSERT_NOEXCEPTION
;
libvlc_exception_clear
(
&
exception
);
/* Check the parameters */
fprintf
(
stderr
,
"The code for this is not written yet
\n
"
);
/* Control it a bit */
fprintf
(
stderr
,
"The code for this is not written yet
\n
"
);
/* Try to delete it */
libvlc_vlm_del_media
(
p_instance
,
"test"
,
&
exception
);
ASSERT_NOEXCEPTION
;
libvlc_exception_clear
(
&
exception
);
libvlc_vlm_del_media
(
p_instance
,
"test"
,
&
exception
);
ASSERT_EXCEPTION
;
libvlc_exception_clear
(
&
exception
);
/******* VOD *******/
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
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