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
e85a5a61
Commit
e85a5a61
authored
Sep 18, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit of cleanup and test
parent
74543709
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
40 deletions
+75
-40
include/libvlc_internal.h
include/libvlc_internal.h
+6
-3
include/vlc/libvlc.h
include/vlc/libvlc.h
+2
-2
src/control/core.c
src/control/core.c
+1
-1
src/libvlc-common.c
src/libvlc-common.c
+1
-2
test/NativeLibvlcTest.py
test/NativeLibvlcTest.py
+8
-8
test/native/libvlc.c
test/native/libvlc.c
+54
-24
test/test.sh
test/test.sh
+3
-0
No files found.
include/libvlc_internal.h
View file @
e85a5a61
...
...
@@ -59,9 +59,12 @@ struct libvlc_input_t
struct
libvlc_instance_t
*
p_instance
;
///< Parent instance
};
#define RAISENULL( psz ) { libvlc_exception_raise( p_e, psz ); return NULL; }
#define RAISEVOID( psz ) { libvlc_exception_raise( p_e, psz ); return; }
#define RAISEZERO( psz ) { libvlc_exception_raise( p_e, psz ); return 0; }
#define RAISENULL( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \
return NULL; }
#define RAISEVOID( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \
return; }
#define RAISEZERO( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \
return 0; }
# ifdef __cplusplus
}
...
...
include/vlc/libvlc.h
View file @
e85a5a61
...
...
@@ -122,10 +122,10 @@ libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
int
libvlc_get_vlc_id
(
libvlc_instance_t
*
p_instance
);
/**
* Destroy a libvlc instance
* Destroy a libvlc instance
.
* \param p_instance the instance to destroy
*/
void
libvlc_destroy
(
libvlc_instance_t
*
);
void
libvlc_destroy
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
/** @}*/
...
...
src/control/core.c
View file @
e85a5a61
...
...
@@ -101,7 +101,7 @@ libvlc_instance_t * libvlc_new( int argc, char **argv,
return
p_new
;
}
void
libvlc_destroy
(
libvlc_instance_t
*
p_instance
)
void
libvlc_destroy
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_e
)
{
libvlc_InternalCleanup
(
p_instance
->
p_libvlc_int
);
libvlc_InternalDestroy
(
p_instance
->
p_libvlc_int
,
VLC_FALSE
);
...
...
src/libvlc-common.c
View file @
e85a5a61
...
...
@@ -868,14 +868,13 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
*/
int
libvlc_InternalDestroy
(
libvlc_int_t
*
p_libvlc
,
vlc_bool_t
b_release
)
{
/* Free allocated memory */
if
(
p_libvlc
->
p_memcpy_module
)
{
module_Unneed
(
p_libvlc
,
p_libvlc
->
p_memcpy_module
);
p_libvlc
->
p_memcpy_module
=
NULL
;
}
/* Free module bank
!
*/
/* Free module bank
. It is refcounted, so we call this each time
*/
module_EndBank
(
p_libvlc
);
FREENULL
(
p_libvlc
->
psz_homedir
);
...
...
test/NativeLibvlcTest.py
View file @
e85a5a61
...
...
@@ -3,15 +3,15 @@ import unittest
import
native_libvlc_test
class
NativeLibvlcTestCase
(
unittest
.
TestCase
):
def
testException
(
self
):
def
test
1
Exception
(
self
):
"""[LibVLC] Checks libvlc_exception"""
#
native_libvlc_test.exception_test()
def
testStartup
(
self
):
native_libvlc_test
.
exception_test
()
def
test
2
Startup
(
self
):
"""[LibVLC] Checks creation/destroy of libvlc"""
#
native_libvlc_test.create_destroy()
def
testPlaylist
(
self
):
native_libvlc_test
.
create_destroy
()
def
test
3
Playlist
(
self
):
"""[LibVLC] Checks basic playlist interaction"""
#
native_libvlc_test.playlist_test()
def
testVLM
(
self
):
native_libvlc_test
.
playlist_test
()
def
test
4
VLM
(
self
):
"""[LibVLC] Checks VLM wrapper"""
#
native_libvlc_test.vlm_test()
native_libvlc_test
.
vlm_test
()
test/native/libvlc.c
View file @
e85a5a61
#include "../pyunit.h"
#include <vlc/libvlc.h>
PyObject
*
exception_test
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
exception_test
(
PyObject
*
self
,
PyObject
*
args
)
{
libvlc_exception_t
exception
;
libvlc_exception_t
exception
;
libvlc_exception_init
(
&
exception
);
ASSERT
(
!
libvlc_exception_raised
(
&
exception
)
,
"Exception raised"
);
ASSERT
(
!
libvlc_exception_get_message
(
&
exception
)
,
"Exception raised"
);
libvlc_exception_init
(
&
exception
);
ASSERT
(
!
libvlc_exception_raised
(
&
exception
)
,
"Exception raised"
);
ASSERT
(
!
libvlc_exception_get_message
(
&
exception
)
,
"Exception raised"
);
libvlc_exception_raise
(
&
exception
,
NULL
);
ASSERT
(
!
libvlc_exception_get_message
(
&
exception
),
"Unexpected message"
);
ASSERT
(
libvlc_exception_raised
(
&
exception
),
"Exception not raised"
);
libvlc_exception_raise
(
&
exception
,
NULL
);
ASSERT
(
!
libvlc_exception_get_message
(
&
exception
),
"Unexpected message"
);
ASSERT
(
libvlc_exception_raised
(
&
exception
),
"Exception not raised"
);
libvlc_exception_raise
(
&
exception
,
"test"
);
ASSERT
(
libvlc_exception_get_message
(
&
exception
),
"No Message"
);
ASSERT
(
libvlc_exception_raised
(
&
exception
),
"Exception not raised"
);
libvlc_exception_raise
(
&
exception
,
"test"
);
ASSERT
(
libvlc_exception_get_message
(
&
exception
),
"No Message"
);
ASSERT
(
libvlc_exception_raised
(
&
exception
),
"Exception not raised"
);
libvlc_exception_clear
(
&
exception
);
ASSERT
(
!
libvlc_exception_raised
(
&
exception
),
"Exception not cleared"
);
libvlc_exception_clear
(
&
exception
);
ASSERT
(
!
libvlc_exception_raised
(
&
exception
),
"Exception not cleared"
);
Py_INCREF
(
Py_None
);
return
Py_None
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
PyObject
*
create_destroy
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
create_destroy
(
PyObject
*
self
,
PyObject
*
args
)
{
libvlc_instance_t
*
p_instance
;
char
*
argv
[]
=
{
"vlc"
,
"--quiet"
};
libvlc_instance_t
*
p_i1
,
*
p_i2
;
char
*
argv1
[]
=
{
"vlc"
,
"--quiet"
};
char
*
argv2
[]
=
{
"vlc"
,
"-vvv"
};
int
id1
,
id2
;
printf
(
"
\n
"
);
libvlc_exception_t
exception
;
libvlc_exception_init
(
&
exception
);
p_instance
=
libvlc_new
(
2
,
argv
,
&
exception
);
/* Create and destroy a single instance */
fprintf
(
stderr
,
"Create 1
\n
"
);
p_i1
=
libvlc_new
(
2
,
argv1
,
&
exception
);
ASSERT
(
p_i1
!=
NULL
,
"Instance creation failed"
);
ASSERT_NOEXCEPTION
;
id1
=
libvlc_get_vlc_id
(
p_i1
);
libvlc_destroy
(
p_i1
,
&
exception
);
ASSERT_NOEXCEPTION
;
/* Create and destroy two instances */
fprintf
(
stderr
,
"Create 2
\n
"
);
p_i1
=
libvlc_new
(
2
,
argv1
,
&
exception
);
ASSERT
(
p_i1
!=
NULL
,
"Instance creation failed"
);
ASSERT_NOEXCEPTION
;
fprintf
(
stderr
,
"Create 3
\n
"
);
p_i2
=
libvlc_new
(
2
,
argv2
,
&
exception
);
ASSERT
(
p_i2
!=
NULL
,
"Instance creation failed"
);
ASSERT_NOEXCEPTION
;
ASSERT
(
p_instance
!=
NULL
,
"Instance creation failed"
);
fprintf
(
stderr
,
"Destroy 1
\n
"
);
libvlc_destroy
(
p_i1
,
&
exception
);
ASSERT_NOEXCEPTION
;
fprintf
(
stderr
,
"Destroy 2
\n
"
);
libvlc_destroy
(
p_i2
,
&
exception
);
ASSERT_NOEXCEPTION
;
/* Deinit */
fprintf
(
stderr
,
"Create 4
\n
"
);
p_i1
=
libvlc_new
(
2
,
argv1
,
&
exception
);
ASSERT_NOEXCEPTION
;
id2
=
libvlc_get_vlc_id
(
p_i1
);
ASSERT
(
!
libvlc_exception_raised
(
&
exception
),
"Exception raised while creating instance"
);
ASSERT
(
id1
==
id2
,
"libvlc object ids do not match after deinit"
);
libvlc_destroy
(
p_instance
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
...
...
test/test.sh
View file @
e85a5a61
...
...
@@ -9,6 +9,9 @@ export PYTHONPATH=$PYTHONPATH:bindings/mediacontrol-python/build/lib.linux-i686-
export
LD_LIBRARY_PATH
=
src/.libs/
# Always dump core
ulimit
-c
unlimited
python
test
/test.py
-v
2>&1|perl
-e
\
'$bold = "\033[1m";
$grey = "\033[37m";
...
...
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