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
eec10937
Commit
eec10937
authored
Feb 07, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testapi.c: Also try file playback.
parent
5007c61e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
1 deletion
+54
-1
src/control/testapi.c
src/control/testapi.c
+54
-1
No files found.
src/control/testapi.c
View file @
eec10937
...
...
@@ -35,6 +35,8 @@
static
libvlc_exception_t
ex
;
#define log( ... ) printf( "testapi: " __VA_ARGS__ );
static
void
catch
(
void
)
{
if
(
libvlc_exception_raised
(
&
ex
))
...
...
@@ -56,6 +58,8 @@ static void test_core (const char ** argv, int argc)
libvlc_instance_t
*
vlc
;
int
id
;
log
(
"Testing core
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
catch
();
...
...
@@ -81,6 +85,8 @@ static void test_media_list (const char ** argv, int argc)
libvlc_media_descriptor_t
*
md
;
libvlc_media_list_t
*
ml
;
log
(
"Testing media_list
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
catch
();
...
...
@@ -107,9 +113,48 @@ static void test_media_list (const char ** argv, int argc)
catch
();
}
static
void
test_file_playback
(
const
char
**
argv
,
int
argc
,
const
char
*
file
)
{
libvlc_instance_t
*
vlc
;
libvlc_media_descriptor_t
*
md
;
libvlc_media_instance_t
*
mi
;
log
(
"Testing playback of %s
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
catch
();
md
=
libvlc_media_descriptor_new
(
vlc
,
file
,
&
ex
);
catch
();
mi
=
libvlc_media_instance_new_from_media_descriptor
(
md
,
&
ex
);
catch
();
libvlc_media_descriptor_release
(
md
);
libvlc_media_instance_play
(
mi
,
&
ex
);
catch
();
/* FIXME: Do something clever */
sleep
(
1
);
assert
(
libvlc_media_instance_get_state
(
mi
,
&
ex
)
!=
libvlc_Error
);
catch
();
libvlc_media_instance_stop
(
mi
,
&
ex
);
catch
();
libvlc_media_instance_release
(
mi
);
catch
();
libvlc_release
(
vlc
);
catch
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
const
char
*
args
[
argc
+
3
];
const
char
*
args
[
argc
+
5
];
int
nlibvlc_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
alarm
(
30
);
/* Make sure "make check" does not get stuck */
...
...
@@ -118,11 +163,19 @@ int main (int argc, char *argv[])
args
[
1
]
=
"-I"
;
args
[
2
]
=
"-dummy"
;
args
[
3
]
=
"--plugin-path=../modules"
;
args
[
4
]
=
"--vout=dummy"
;
args
[
5
]
=
"--aout=dummy"
;
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
args
[
i
+
3
]
=
argv
[
i
];
test_core
(
args
,
nlibvlc_args
);
test_media_list
(
args
,
nlibvlc_args
);
/* FIXME try to play all streams from a list. We may want to create an other test category for that. */
test_file_playback
(
args
,
nlibvlc_args
,
"ftp://streams.videolan.org/streams-videolan/reference/mp4/aac_adts.mp4"
);
test_file_playback
(
args
,
nlibvlc_args
,
"ftp://streams.videolan.org/streams-videolan/reference/flv/flash5_004.flv"
);
/* ... */
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