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
2fc112a1
Commit
2fc112a1
authored
Feb 22, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Test preparsing.
parent
8d6ec464
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
+81
-0
test/Makefile.am
test/Makefile.am
+6
-0
test/libvlc/media.c
test/libvlc/media.c
+75
-0
No files found.
test/Makefile.am
View file @
2fc112a1
...
@@ -15,6 +15,7 @@ extra_check_verbose__0 = $(extra_check_verbose_0)
...
@@ -15,6 +15,7 @@ extra_check_verbose__0 = $(extra_check_verbose_0)
check_PROGRAMS
=
\
check_PROGRAMS
=
\
test_libvlc_core
\
test_libvlc_core
\
test_libvlc_events
\
test_libvlc_events
\
test_libvlc_media
\
test_libvlc_media_list
\
test_libvlc_media_list
\
test_libvlc_media_player
\
test_libvlc_media_player
\
test_src_misc_variables
\
test_src_misc_variables
\
...
@@ -60,6 +61,11 @@ test_libvlc_events_LDADD = $(top_builddir)/src/libvlc.la
...
@@ -60,6 +61,11 @@ test_libvlc_events_LDADD = $(top_builddir)/src/libvlc.la
test_libvlc_events_CFLAGS
=
$(CFLAGS_tests)
test_libvlc_events_CFLAGS
=
$(CFLAGS_tests)
test_libvlc_events_LDFLAGS
=
$(LDFLAGS_tests)
test_libvlc_events_LDFLAGS
=
$(LDFLAGS_tests)
test_libvlc_media_SOURCES
=
libvlc/media.c
test_libvlc_media_LDADD
=
$(top_builddir)
/src/libvlc.la
test_libvlc_media_CFLAGS
=
$(CFLAGS_tests)
test_libvlc_media_LDFLAGS
=
$(LDFLAGS_tests)
test_libvlc_media_list_player_SOURCES
=
libvlc/media_list_player.c
test_libvlc_media_list_player_SOURCES
=
libvlc/media_list_player.c
test_libvlc_media_list_player_LDADD
=
$(top_builddir)
/src/libvlc.la
test_libvlc_media_list_player_LDADD
=
$(top_builddir)
/src/libvlc.la
test_libvlc_media_list_player_CFLAGS
=
$(CFLAGS_tests)
test_libvlc_media_list_player_CFLAGS
=
$(CFLAGS_tests)
...
...
test/libvlc/media.c
0 → 100644
View file @
2fc112a1
/*
* media_player.c - libvlc smoke test
*
* $Id$
*/
/**********************************************************************
* Copyright (C) 2007 Rémi Denis-Courmont. *
* This program is free software; you can redistribute and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation; version 2 of the license, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, you can get it from: *
* http://www.gnu.org/copyleft/gpl.html *
**********************************************************************/
#include "test.h"
static
void
preparsed_changed
(
const
libvlc_event_t
*
event
,
void
*
user_data
)
{
(
void
)
event
;
int
*
received
=
user_data
;
*
received
=
true
;
}
static
void
test_media_preparsed
(
const
char
**
argv
,
int
argc
)
{
const
char
*
file
=
test_default_sample
;
log
(
"Testing set_media
\n
"
);
libvlc_instance_t
*
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
libvlc_media_t
*
media
=
libvlc_media_new_path
(
vlc
,
file
);
assert
(
media
!=
NULL
);
int
received
=
false
;
// Force preparsing. FIXME - Expose a better API for that.
libvlc_media_es_t
*
es
;
int
num
=
libvlc_media_get_es
(
media
,
&
es
);
free
(
es
);
libvlc_event_manager_t
*
em
=
libvlc_media_event_manager
(
media
);
libvlc_event_attach
(
em
,
libvlc_MediaPreparsedChanged
,
preparsed_changed
,
&
received
);
// Wait to see if we properly receive preparsed.
while
(
!
received
);
// We are good, now check Elementary Stream info.
num
=
libvlc_media_get_es
(
media
,
&
es
);
assert
(
num
>
0
);
free
(
es
);
libvlc_media_release
(
media
);
libvlc_release
(
vlc
);
}
int
main
(
void
)
{
test_init
();
test_media_preparsed
(
test_defaults_args
,
test_defaults_nargs
);
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