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
dd1e8bad
Commit
dd1e8bad
authored
Feb 06, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LibVLC: remove exceptions infrastructure
parent
b6069ae2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
5 additions
and
158 deletions
+5
-158
include/vlc/libvlc.h
include/vlc/libvlc.h
+0
-44
include/vlc/libvlc_structures.h
include/vlc/libvlc_structures.h
+0
-17
src/control/core.c
src/control/core.c
+1
-42
src/libvlc.sym
src/libvlc.sym
+0
-4
test/libvlc/core.c
test/libvlc/core.c
+0
-1
test/libvlc/events.c
test/libvlc/events.c
+0
-5
test/libvlc/libvlc_additions.h
test/libvlc/libvlc_additions.h
+2
-6
test/libvlc/media_list.c
test/libvlc/media_list.c
+2
-4
test/libvlc/media_list_player.c
test/libvlc/media_list_player.c
+0
-6
test/libvlc/media_player.c
test/libvlc/media_player.c
+0
-3
test/libvlc/meta.c
test/libvlc/meta.c
+0
-1
test/libvlc/test.h
test/libvlc/test.h
+0
-25
No files found.
include/vlc/libvlc.h
View file @
dd1e8bad
...
@@ -61,50 +61,6 @@ extern "C" {
...
@@ -61,50 +61,6 @@ extern "C" {
#include <stdarg.h>
#include <stdarg.h>
#include <vlc/libvlc_structures.h>
#include <vlc/libvlc_structures.h>
/*****************************************************************************
* Exception handling
*****************************************************************************/
/** \defgroup libvlc_exception libvlc_exception
* \ingroup libvlc_core
* LibVLC Exceptions handling
* @{
*/
/**
* Initialize an exception structure. This can be called several times to
* reuse an exception structure.
*
* \param p_exception the exception to initialize
*/
VLC_PUBLIC_API
void
libvlc_exception_init
(
libvlc_exception_t
*
p_exception
);
/**
* Has an exception been raised?
*
* \param p_exception the exception to query
* \return 0 if the exception was raised, 1 otherwise
*/
VLC_PUBLIC_API
int
libvlc_exception_raised
(
const
libvlc_exception_t
*
p_exception
);
/**
* Raise an exception.
*
* \param p_exception the exception to raise
*/
VLC_PUBLIC_API
void
libvlc_exception_raise
(
libvlc_exception_t
*
p_exception
);
/**
* Clear an exception object so it can be reused.
* The exception object must have be initialized.
*
* \param p_exception the exception to clear
*/
VLC_PUBLIC_API
void
libvlc_exception_clear
(
libvlc_exception_t
*
);
/**@} */
/*****************************************************************************
/*****************************************************************************
* Error handling
* Error handling
*****************************************************************************/
*****************************************************************************/
...
...
include/vlc/libvlc_structures.h
View file @
dd1e8bad
...
@@ -38,23 +38,6 @@ extern "C" {
...
@@ -38,23 +38,6 @@ extern "C" {
/** This structure is opaque. It represents a libvlc instance */
/** This structure is opaque. It represents a libvlc instance */
typedef
struct
libvlc_instance_t
libvlc_instance_t
;
typedef
struct
libvlc_instance_t
libvlc_instance_t
;
/*****************************************************************************
* Exceptions
*****************************************************************************/
/** \defgroup libvlc_exception libvlc_exception
* \ingroup libvlc_core
* LibVLC Exceptions handling
* @{
*/
typedef
struct
libvlc_exception_t
{
int
b_raised
;
}
libvlc_exception_t
;
/**@} */
/*****************************************************************************
/*****************************************************************************
* Time
* Time
*****************************************************************************/
*****************************************************************************/
...
...
src/control/core.c
View file @
dd1e8bad
/*****************************************************************************
/*****************************************************************************
* core.c: Core libvlc new API functions : initialization
, exceptions handling
* core.c: Core libvlc new API functions : initialization
*****************************************************************************
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* Copyright (C) 2005 the VideoLAN team
* $Id$
* $Id$
...
@@ -37,47 +37,6 @@
...
@@ -37,47 +37,6 @@
static
const
char
nomemstr
[]
=
"Insufficient memory"
;
static
const
char
nomemstr
[]
=
"Insufficient memory"
;
/*************************************************************************
* Exceptions handling
*************************************************************************/
void
libvlc_exception_init
(
libvlc_exception_t
*
p_exception
)
{
p_exception
->
b_raised
=
0
;
}
void
libvlc_exception_clear
(
libvlc_exception_t
*
p_exception
)
{
if
(
NULL
==
p_exception
)
return
;
p_exception
->
b_raised
=
0
;
libvlc_clearerr
();
}
int
libvlc_exception_raised
(
const
libvlc_exception_t
*
p_exception
)
{
return
(
NULL
!=
p_exception
)
&&
p_exception
->
b_raised
;
}
static
void
libvlc_exception_not_handled
(
const
char
*
psz
)
{
fprintf
(
stderr
,
"*** LibVLC Exception not handled: %s
\n
Set a breakpoint in '%s' to debug.
\n
"
,
psz
,
__func__
);
abort
();
}
void
libvlc_exception_raise
(
libvlc_exception_t
*
p_exception
)
{
/* Does caller care about exceptions ? */
if
(
p_exception
==
NULL
)
{
/* Print something, so that lazy third-parties can easily
* notice that something may have gone unnoticedly wrong */
libvlc_exception_not_handled
(
libvlc_errmsg
()
);
return
;
}
p_exception
->
b_raised
=
1
;
}
libvlc_instance_t
*
libvlc_new
(
int
argc
,
const
char
*
const
*
argv
)
libvlc_instance_t
*
libvlc_new
(
int
argc
,
const
char
*
const
*
argv
)
{
{
libvlc_instance_t
*
p_new
=
malloc
(
sizeof
(
*
p_new
));
libvlc_instance_t
*
p_new
=
malloc
(
sizeof
(
*
p_new
));
...
...
src/libvlc.sym
View file @
dd1e8bad
...
@@ -30,10 +30,6 @@ libvlc_event_manager_register_event_type
...
@@ -30,10 +30,6 @@ libvlc_event_manager_register_event_type
libvlc_event_manager_release
libvlc_event_manager_release
libvlc_event_send
libvlc_event_send
libvlc_event_type_name
libvlc_event_type_name
libvlc_exception_clear
libvlc_exception_init
libvlc_exception_raise
libvlc_exception_raised
libvlc_free
libvlc_free
libvlc_get_changeset
libvlc_get_changeset
libvlc_get_compiler
libvlc_get_compiler
...
...
test/libvlc/core.c
View file @
dd1e8bad
...
@@ -29,7 +29,6 @@ static void test_core (const char ** argv, int argc)
...
@@ -29,7 +29,6 @@ static void test_core (const char ** argv, int argc)
log
(
"Testing core
\n
"
);
log
(
"Testing core
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
...
test/libvlc/events.c
View file @
dd1e8bad
...
@@ -61,7 +61,6 @@ static void test_events (const char ** argv, int argc)
...
@@ -61,7 +61,6 @@ static void test_events (const char ** argv, int argc)
libvlc_media_player_t
*
mi
;
libvlc_media_player_t
*
mi
;
libvlc_event_manager_t
*
em
;
libvlc_event_manager_t
*
em
;
bool
callback_was_called
;
bool
callback_was_called
;
libvlc_exception_t
ex
;
libvlc_event_type_t
mi_events
[]
=
{
libvlc_event_type_t
mi_events
[]
=
{
libvlc_MediaPlayerPlaying
,
libvlc_MediaPlayerPlaying
,
libvlc_MediaPlayerPaused
,
libvlc_MediaPlayerPaused
,
...
@@ -74,7 +73,6 @@ static void test_events (const char ** argv, int argc)
...
@@ -74,7 +73,6 @@ static void test_events (const char ** argv, int argc)
log
(
"Testing events
\n
"
);
log
(
"Testing events
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -125,10 +123,7 @@ static void test_events (const char ** argv, int argc)
...
@@ -125,10 +123,7 @@ static void test_events (const char ** argv, int argc)
libvlc_event_detach
(
em
,
mi_events
[
i
],
test_events_dummy_callback
,
&
callback_was_called
);
libvlc_event_detach
(
em
,
mi_events
[
i
],
test_events_dummy_callback
,
&
callback_was_called
);
libvlc_media_player_release
(
mi
);
libvlc_media_player_release
(
mi
);
catch
();
libvlc_release
(
vlc
);
libvlc_release
(
vlc
);
catch
();
}
}
int
main
(
void
)
int
main
(
void
)
...
...
test/libvlc/libvlc_additions.h
View file @
dd1e8bad
...
@@ -21,12 +21,8 @@
...
@@ -21,12 +21,8 @@
static
void
*
media_list_add_file_path
(
libvlc_instance_t
*
vlc
,
libvlc_media_list_t
*
ml
,
const
char
*
file_path
)
static
void
*
media_list_add_file_path
(
libvlc_instance_t
*
vlc
,
libvlc_media_list_t
*
ml
,
const
char
*
file_path
)
{
{
libvlc_media_t
*
md
=
libvlc_media_new
(
vlc
,
file_path
,
&
ex
);
libvlc_media_t
*
md
=
libvlc_media_new
(
vlc
,
file_path
);
catch
();
libvlc_media_list_add_media
(
ml
,
md
);
libvlc_media_list_add_media
(
ml
,
md
,
&
ex
);
catch
();
libvlc_media_release
(
md
);
libvlc_media_release
(
md
);
return
md
;
return
md
;
}
}
...
...
test/libvlc/media_list.c
View file @
dd1e8bad
...
@@ -32,7 +32,6 @@ static void test_media_list (const char ** argv, int argc)
...
@@ -32,7 +32,6 @@ static void test_media_list (const char ** argv, int argc)
log
(
"Testing media_list
\n
"
);
log
(
"Testing media_list
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -82,8 +81,8 @@ static void test_media_list (const char ** argv, int argc)
...
@@ -82,8 +81,8 @@ static void test_media_list (const char ** argv, int argc)
assert
(
libvlc_media_list_item_at_index
(
ml
,
2
)
==
md3
);
assert
(
libvlc_media_list_item_at_index
(
ml
,
2
)
==
md3
);
/* test if give e
xception
s, when it should */
/* test if give e
rror
s, when it should */
/* have 4 items, so index 4 should give e
xception
*/
/* have 4 items, so index 4 should give e
rror
*/
ret
=
libvlc_media_list_remove_index
(
ml
,
4
);
ret
=
libvlc_media_list_remove_index
(
ml
,
4
);
assert
(
ret
==
-
1
);
assert
(
ret
==
-
1
);
...
@@ -120,7 +119,6 @@ static void test_media_list (const char ** argv, int argc)
...
@@ -120,7 +119,6 @@ static void test_media_list (const char ** argv, int argc)
libvlc_media_list_release
(
ml
);
libvlc_media_list_release
(
ml
);
libvlc_release
(
vlc
);
libvlc_release
(
vlc
);
catch
();
}
}
int
main
(
void
)
int
main
(
void
)
...
...
test/libvlc/media_list_player.c
View file @
dd1e8bad
...
@@ -100,7 +100,6 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
...
@@ -100,7 +100,6 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
log
(
"Testing media player item queue-ing
\n
"
);
log
(
"Testing media player item queue-ing
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -171,7 +170,6 @@ static void test_media_list_player_previous(const char** argv, int argc)
...
@@ -171,7 +170,6 @@ static void test_media_list_player_previous(const char** argv, int argc)
log
(
"Testing media player previous()
\n
"
);
log
(
"Testing media player previous()
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -248,7 +246,6 @@ static void test_media_list_player_next(const char** argv, int argc)
...
@@ -248,7 +246,6 @@ static void test_media_list_player_next(const char** argv, int argc)
log
(
"Testing media player next()
\n
"
);
log
(
"Testing media player next()
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -324,7 +321,6 @@ static void test_media_list_player_pause_stop(const char** argv, int argc)
...
@@ -324,7 +321,6 @@ static void test_media_list_player_pause_stop(const char** argv, int argc)
log
(
"Testing play and pause of %s using the media list.
\n
"
,
file
);
log
(
"Testing play and pause of %s using the media list.
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -371,7 +367,6 @@ static void test_media_list_player_play_item_at_index(const char** argv, int arg
...
@@ -371,7 +367,6 @@ static void test_media_list_player_play_item_at_index(const char** argv, int arg
log
(
"Testing play_item_at_index of %s using the media list.
\n
"
,
file
);
log
(
"Testing play_item_at_index of %s using the media list.
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -427,7 +422,6 @@ static void test_media_list_player_playback_options (const char** argv, int argc
...
@@ -427,7 +422,6 @@ static void test_media_list_player_playback_options (const char** argv, int argc
log
(
"Testing media player playback options()
\n
"
);
log
(
"Testing media player playback options()
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
...
test/libvlc/media_player.c
View file @
dd1e8bad
...
@@ -32,7 +32,6 @@ static void test_media_player_play_stop(const char** argv, int argc)
...
@@ -32,7 +32,6 @@ static void test_media_player_play_stop(const char** argv, int argc)
log
(
"Testing play and pause of %s
\n
"
,
file
);
log
(
"Testing play and pause of %s
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -70,7 +69,6 @@ static void test_media_player_pause_stop(const char** argv, int argc)
...
@@ -70,7 +69,6 @@ static void test_media_player_pause_stop(const char** argv, int argc)
log
(
"Testing pause and stop of %s
\n
"
,
file
);
log
(
"Testing pause and stop of %s
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
@@ -90,7 +88,6 @@ static void test_media_player_pause_stop(const char** argv, int argc)
...
@@ -90,7 +88,6 @@ static void test_media_player_pause_stop(const char** argv, int argc)
libvlc_state_t
state
;
libvlc_state_t
state
;
do
{
do
{
state
=
libvlc_media_player_get_state
(
mi
);
state
=
libvlc_media_player_get_state
(
mi
);
catch
();
}
while
(
state
!=
libvlc_Playing
&&
}
while
(
state
!=
libvlc_Playing
&&
state
!=
libvlc_Error
&&
state
!=
libvlc_Error
&&
state
!=
libvlc_Ended
);
state
!=
libvlc_Ended
);
...
...
test/libvlc/meta.c
View file @
dd1e8bad
...
@@ -34,7 +34,6 @@ static void test_meta (const char ** argv, int argc)
...
@@ -34,7 +34,6 @@ static void test_meta (const char ** argv, int argc)
log
(
"Testing meta
\n
"
);
log
(
"Testing meta
\n
"
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
assert
(
vlc
!=
NULL
);
...
...
test/libvlc/test.h
View file @
dd1e8bad
...
@@ -46,7 +46,6 @@
...
@@ -46,7 +46,6 @@
/*********************************************************************
/*********************************************************************
* Some useful global var
* Some useful global var
*/
*/
static
libvlc_exception_t
ex
;
static
const
char
*
test_defaults_args
[]
=
{
static
const
char
*
test_defaults_args
[]
=
{
"-v"
,
"-v"
,
...
@@ -72,30 +71,6 @@ static const char test_default_sample[] = SRCDIR"/samples/empty.voc";
...
@@ -72,30 +71,6 @@ static const char test_default_sample[] = SRCDIR"/samples/empty.voc";
#define log( ... ) printf( "testapi: " __VA_ARGS__ );
#define log( ... ) printf( "testapi: " __VA_ARGS__ );
/* test if we have exception */
static
inline
bool
have_exception
(
void
)
{
if
(
libvlc_exception_raised
(
&
ex
))
{
libvlc_exception_clear
(
&
ex
);
return
true
;
}
else
return
false
;
}
#define catch() catch_with_info(__FILE__, __FUNCTION__, __LINE__)
static
inline
void
catch_with_info
(
const
char
*
file
,
const
char
*
func
,
unsigned
line
)
{
if
(
libvlc_exception_raised
(
&
ex
))
{
fprintf
(
stderr
,
"%s:%s():%d Exception: %s
\n
"
,
file
,
func
,
line
,
libvlc_errmsg
());
abort
();
}
libvlc_exception_clear
(
&
ex
);
}
static
inline
void
test_init
(
void
)
static
inline
void
test_init
(
void
)
{
{
(
void
)
test_default_sample
;
/* This one may not be used */
(
void
)
test_default_sample
;
/* This one may not be used */
...
...
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