Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
d3bb1243
Commit
d3bb1243
authored
Sep 25, 2006
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mediacontrol_new: new API (pass argc and argv), use the new libvlc_new API
parent
8261a227
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
38 deletions
+8
-38
include/mediacontrol_internal.h
include/mediacontrol_internal.h
+2
-2
include/vlc/mediacontrol.h
include/vlc/mediacontrol.h
+1
-1
src/control/mediacontrol_core.c
src/control/mediacontrol_core.c
+5
-35
No files found.
include/mediacontrol_internal.h
View file @
d3bb1243
...
...
@@ -49,8 +49,8 @@ vlc_int64_t mediacontrol_position2microsecond(
#define RAISE( c, m ) exception->code = c; \
exception->message = strdup(m);
#define RAISE_NULL( c, m )
RAISE( c, m ); return NULL;
#define RAISE_VOID( c, m )
RAISE( c, m ); return;
#define RAISE_NULL( c, m )
{ RAISE( c, m ); return NULL; }
#define RAISE_VOID( c, m )
{ RAISE( c, m ); return; }
#define HANDLE_LIBVLC_EXCEPTION_VOID( e ) if( libvlc_exception_raised( e ) ) { \
RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \
...
...
include/vlc/mediacontrol.h
View file @
d3bb1243
...
...
@@ -112,7 +112,7 @@ void mediacontrol_exception_free(mediacontrol_Exception *exception);
* Core functions
*****************************************************************************/
mediacontrol_Instance
*
mediacontrol_new
(
char
**
args
,
mediacontrol_Exception
*
exception
);
mediacontrol_new
(
int
argc
,
char
**
argv
,
mediacontrol_Exception
*
exception
);
/* Bridge with the libvlc API */
mediacontrol_Instance
*
...
...
src/control/mediacontrol_core.c
View file @
d3bb1243
...
...
@@ -55,49 +55,19 @@
# include <sys/types.h>
#endif
mediacontrol_Instance
*
mediacontrol_new
(
char
**
args
,
mediacontrol_Exception
*
exception
)
mediacontrol_Instance
*
mediacontrol_new
(
int
argc
,
char
**
argv
,
mediacontrol_Exception
*
exception
)
{
mediacontrol_Instance
*
retval
;
libvlc_exception_t
ex
;
char
**
ppsz_argv
;
int
i_count
=
0
;
int
i_index
;
char
**
p_tmp
;
libvlc_exception_init
(
&
ex
);
exception
=
mediacontrol_exception_init
(
exception
);
/* Copy args array */
if
(
args
)
{
for
(
p_tmp
=
args
;
*
p_tmp
!=
NULL
;
p_tmp
++
)
i_count
++
;
}
ppsz_argv
=
malloc
(
(
i_count
+
2
)
*
sizeof
(
char
*
)
)
;
if
(
!
ppsz_argv
)
{
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
);
}
ppsz_argv
[
0
]
=
"vlc"
;
for
(
i_index
=
0
;
i_index
<
i_count
;
i_index
++
)
{
ppsz_argv
[
i_index
+
1
]
=
strdup
(
args
[
i_index
]
);
if
(
!
ppsz_argv
[
i_index
+
1
]
)
{
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
);
}
}
ppsz_argv
[
i_count
+
2
]
=
NULL
;
retval
=
(
mediacontrol_Instance
*
)
malloc
(
sizeof
(
mediacontrol_Instance
)
);
if
(
!
retval
)
{
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
);
}
if
(
!
retval
)
RAISE_NULL
(
mediacontrol_InternalException
,
"Out of memory"
);
retval
->
p_instance
=
libvlc_new
(
i_count
+
1
,
ppsz_
argv
,
&
ex
);
retval
->
p_instance
=
libvlc_new
(
argc
,
argv
,
&
ex
);
retval
->
p_playlist
=
retval
->
p_instance
->
p_libvlc_int
->
p_playlist
;
HANDLE_LIBVLC_EXCEPTION_NULL
(
&
ex
);
return
retval
;
...
...
@@ -127,7 +97,7 @@ mediacontrol_new_from_instance( libvlc_instance_t* p_instance,
retval
=
(
mediacontrol_Instance
*
)
malloc
(
sizeof
(
mediacontrol_Instance
)
);
if
(
!
retval
)
{
RAISE_NULL
(
mediacontrol_InternalException
,
"
o
ut of memory"
);
RAISE_NULL
(
mediacontrol_InternalException
,
"
O
ut of memory"
);
}
retval
->
p_instance
=
p_instance
;
retval
->
p_playlist
=
retval
->
p_instance
->
p_libvlc_int
->
p_playlist
;
...
...
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