Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
508d87e6
Commit
508d87e6
authored
Oct 21, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch API smoke test to libvlc API
parent
4a2ded0b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
53 deletions
+34
-53
include/vlc/libvlc.h
include/vlc/libvlc.h
+2
-1
src/control/core.c
src/control/core.c
+1
-1
src/control/testapi.c
src/control/testapi.c
+31
-51
No files found.
include/vlc/libvlc.h
View file @
508d87e6
...
@@ -107,7 +107,8 @@ libvlc_exception_get_message( const libvlc_exception_t *p_exception );
...
@@ -107,7 +107,8 @@ libvlc_exception_get_message( const libvlc_exception_t *p_exception );
* \param argv command-line-type arguments
* \param argv command-line-type arguments
* \param exception an initialized exception pointer
* \param exception an initialized exception pointer
*/
*/
VLC_PUBLIC_API
libvlc_instance_t
*
libvlc_new
(
int
,
char
**
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
libvlc_instance_t
*
libvlc_new
(
int
,
const
char
*
const
*
,
libvlc_exception_t
*
);
/**
/**
* Returns a libvlc instance identifier for legacy APIs. Use of this
* Returns a libvlc instance identifier for legacy APIs. Use of this
...
...
src/control/core.c
View file @
508d87e6
...
@@ -79,7 +79,7 @@ void libvlc_exception_raise( libvlc_exception_t *p_exception,
...
@@ -79,7 +79,7 @@ void libvlc_exception_raise( libvlc_exception_t *p_exception,
p_exception
->
b_raised
=
1
;
p_exception
->
b_raised
=
1
;
}
}
libvlc_instance_t
*
libvlc_new
(
int
argc
,
c
har
*
*
argv
,
libvlc_instance_t
*
libvlc_new
(
int
argc
,
c
onst
char
*
const
*
argv
,
libvlc_exception_t
*
p_e
)
libvlc_exception_t
*
p_e
)
{
{
libvlc_instance_t
*
p_new
;
libvlc_instance_t
*
p_new
;
...
...
src/control/testapi.c
View file @
508d87e6
/*
/*
* testapi.c - libvlc
-control
smoke test
* testapi.c - libvlc smoke test
*
*
* $Id$
* $Id$
*/
*/
...
@@ -21,66 +21,46 @@
...
@@ -21,66 +21,46 @@
* http://www.gnu.org/copyleft/gpl.html *
* http://www.gnu.org/copyleft/gpl.html *
**********************************************************************/
**********************************************************************/
#include <vlc/
mediacontrol
.h>
#include <vlc/
libvlc
.h>
#undef NDEBUG
#undef NDEBUG
#include <assert.h>
#include <assert.h>
int
main
(
int
argc
,
char
*
argv
[])
#include <stdio.h>
{
#include <stdlib.h>
mediacontrol_Exception
ex
;
mediacontrol_Instance
*
mc
,
*
mc2
;
libvlc_instance_t
*
vlc
;
mediacontrol_exception_init
(
&
ex
);
mc
=
mediacontrol_new
(
argc
,
argv
,
&
ex
);
assert
(
mc
);
assert
(
!
ex
.
code
);
mediacontrol_exception_cleanup
(
&
ex
);
/* Duplication test */
vlc
=
mediacontrol_get_libvlc_instance
(
mc
);
assert
(
vlc
);
assert
(
!
ex
.
code
);
mediacontrol_exception_init
(
&
ex
);
mc2
=
mediacontrol_new_from_instance
(
vlc
,
&
ex
);
assert
(
mc2
);
assert
(
!
ex
.
code
);
mediacontrol_exception_cleanup
(
&
ex
);
//mediacontrol_exit (mc2)
;
static
libvlc_exception_t
ex
;
/* Input tests */
static
void
catch
(
void
)
mediacontrol_exception_init
(
&
ex
);
{
mediacontrol_resume
(
mc
,
NULL
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
))
assert
(
ex
.
code
);
/* should fail: we have no input */
{
mediacontrol_exception_cleanup
(
&
ex
);
fprintf
(
stderr
,
"Exception: %s
\n
"
,
libvlc_exception_get_message
(
&
ex
));
mediacontrol_exception_init
(
&
ex
);
abort
();
mediacontrol_pause
(
mc
,
NULL
,
&
ex
);
}
assert
(
ex
.
code
);
/* should fail: we have no input */
mediacontrol_exception_cleanup
(
&
ex
);
mediacontrol_exception_init
(
&
ex
);
assert
(
libvlc_exception_get_message
(
&
ex
)
==
NULL
);
mediacontrol_stop
(
mc
,
NULL
,
&
ex
);
libvlc_exception_clear
(
&
ex
);
mediacontrol_exception_cleanup
(
&
ex
);
}
/* Playlist tests */
int
main
(
int
argc
,
char
*
argv
[])
mediacontrol_exception_init
(
&
ex
);
{
mediacontrol_playlist_clear
(
mc
,
&
ex
);
libvlc_instance_t
*
vlc
;
assert
(
!
ex
.
code
);
const
char
*
args
[
argc
+
3
];
mediacontrol_exception_cleanup
(
&
ex
);
mediacontrol_exception_init
(
&
ex
);
args
[
0
]
=
"-I"
;
mediacontrol_playlist_add_item
(
mc
,
"/dev/null"
,
&
ex
);
args
[
1
]
=
"dummy"
;
mediacontrol_exception_cleanup
(
&
ex
);
args
[
2
]
=
"-vvv"
;
args
[
3
]
=
"--plugin-path=.."
;
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
args
[
i
+
3
]
=
argv
[
i
];
mediacontrol_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
mediacontrol_playlist_clear
(
mc
,
&
ex
);
vlc
=
libvlc_new
(
sizeof
(
args
)
/
sizeof
(
args
[
0
]),
args
,
&
ex
);
assert
(
!
ex
.
code
);
catch
();
mediacontrol_exception_cleanup
(
&
ex
);
mediacontrol_exit
(
mc
);
libvlc_destroy
(
vlc
,
&
ex
);
catch
();
return
0
;
return
0
;
}
}
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