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
15d640b8
Commit
15d640b8
authored
Dec 19, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
probe: infrastructure for run-time features probing
parent
dccd9472
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
0 deletions
+123
-0
include/vlc_probe.h
include/vlc_probe.h
+70
-0
src/Makefile.am
src/Makefile.am
+2
-0
src/misc/probe.c
src/misc/probe.c
+51
-0
No files found.
include/vlc_probe.h
0 → 100644
View file @
15d640b8
/*****************************************************************************
* vlc_probe.h: service probing interface
*****************************************************************************
* Copyright (C) 2009 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_PROBE_H
# define VLC_PROBE_H 1
# include <stdlib.h>
/**
* \file
* This file defines functions and structures to run-time probe VLC extensions
*/
# ifdef __cplusplus
extern
"C"
{
# endif
VLC_EXPORT
(
void
*
,
vlc_probe
,
(
vlc_object_t
*
,
const
char
*
,
size_t
*
restrict
));
#define vlc_probe(obj, cap, pcount) \
vlc_probe(VLC_OBJECT(obj), cap, pcount)
struct
vlc_probe_t
{
VLC_COMMON_MEMBERS
void
*
list
;
size_t
count
;
};
typedef
struct
vlc_probe_t
vlc_probe_t
;
static
inline
int
vlc_probe_add
(
vlc_probe_t
*
obj
,
const
void
*
data
,
size_t
len
)
{
char
*
tab
=
(
char
*
)
realloc
(
obj
->
list
,
(
obj
->
count
+
1
)
*
len
);
if
(
unlikely
(
tab
==
NULL
))
return
VLC_ENOMEM
;
memcpy
(
tab
+
(
obj
->
count
*
len
),
data
,
len
);
obj
->
list
=
tab
;
obj
->
count
++
;
return
VLC_SUCCESS
;
}
# define VLC_PROBE_CONTINUE VLC_EGENERIC
# define VLC_PROBE_STOP VLC_SUCCESS
# ifdef __cplusplus
}
# endif
#endif
src/Makefile.am
View file @
15d640b8
...
...
@@ -88,6 +88,7 @@ pluginsinclude_HEADERS = \
../include/vlc_picture_pool.h
\
../include/vlc_playlist.h
\
../include/vlc_plugin.h
\
../include/vlc_probe.h
\
../include/vlc_rand.h
\
../include/vlc_services_discovery.h
\
../include/vlc_sql.h
\
...
...
@@ -402,6 +403,7 @@ SOURCES_libvlc_common = \
text/iso_lang.c
\
text/iso-639_def.h
\
misc/md5.c
\
misc/probe.c
\
misc/rand.c
\
misc/mtime.c
\
misc/block.c
\
...
...
src/misc/probe.c
0 → 100644
View file @
15d640b8
/*****************************************************************************
* probe.c : run-time service listing
*****************************************************************************
* Copyright © 2009 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_probe.h>
#include "libvlc.h"
#undef vlc_probe
void
*
vlc_probe
(
vlc_object_t
*
obj
,
const
char
*
capability
,
size_t
*
restrict
pcount
)
{
vlc_probe_t
*
probe
=
vlc_custom_create
(
obj
,
sizeof
(
*
probe
),
VLC_OBJECT_GENERIC
,
"probe"
);
if
(
unlikely
(
probe
==
NULL
))
{
*
pcount
=
0
;
return
NULL
;
}
probe
->
list
=
NULL
;
probe
->
count
=
0
;
module_t
*
mod
=
module_need
(
probe
,
capability
,
NULL
,
false
);
if
(
mod
!=
NULL
)
module_unneed
(
probe
,
mod
);
void
*
ret
=
probe
->
list
;
*
pcount
=
probe
->
count
;
vlc_object_release
(
probe
);
return
ret
;
}
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