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
f974baf1
Commit
f974baf1
authored
Jan 25, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add vlc-cache-gen to generate the plugins cache off-line
parent
91079ddc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
0 deletions
+112
-0
bin/Makefile.am
bin/Makefile.am
+5
-0
bin/cachegen.c
bin/cachegen.c
+107
-0
No files found.
bin/Makefile.am
View file @
f974baf1
...
...
@@ -2,6 +2,7 @@
#
bin_PROGRAMS
=
vlc
noinst_PROGRAMS
=
vlc-static
vlclib_PROGRAMS
=
vlc-cache-gen
EXTRA_PROGRAMS
=
vlc-wrapper
AM_CFLAGS
=
`
$(VLC_CONFIG)
--cflags
vlc
`
...
...
@@ -46,3 +47,7 @@ endif
vlc_win32_rc.$(OBJEXT)
:
$(top_builddir)/share/vlc_win32_rc.rc
$(WINDRES)
--include-dir
$(top_srcdir)
/share
-i
$<
-o
$@
vlc_cache_gen_SOURCES
=
cachegen.c
vlc_cache_gen_LDADD
=
\
../compat/libcompat.la
\
../src/libvlc.la ../src/libvlccore.la
bin/cachegen.c
0 → 100644
View file @
f974baf1
/*****************************************************************************
* cachegen.c: LibVLC plugins cache generator
*****************************************************************************
* Copyright (C) 2010 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either 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, 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/vlc.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#endif
static
void
version
(
void
)
{
puts
(
"LibVLC plugins cache generation version "
VERSION
);
}
static
void
usage
(
const
char
*
path
)
{
printf
(
"Usage: %s <path>
\n
"
"Generate the LibVLC plugins cache "
"for the specified plugins directory.
\n
"
,
path
);
}
/* Explicit HACK */
extern
void
LocaleFree
(
const
char
*
);
extern
char
*
FromLocale
(
const
char
*
);
int
main
(
int
argc
,
char
*
argv
[])
{
static
const
struct
option
opts
[]
=
{
{
"help"
,
no_argument
,
NULL
,
'h'
},
{
"version"
,
no_argument
,
NULL
,
'V'
},
{
NULL
,
no_argument
,
NULL
,
'\0'
}
};
setlocale
(
LC_CTYPE
,
""
);
/* needed by FromLocale() */
int
c
;
while
((
c
=
getopt_long
(
argc
,
argv
,
"hV"
,
opts
,
NULL
))
!=
-
1
)
switch
(
c
)
{
case
'h'
:
usage
(
argv
[
0
]);
return
0
;
case
'V'
:
version
();
return
0
;
default:
usage
(
argv
[
0
]);
return
1
;
}
for
(
int
i
=
optind
;
i
<
argc
;
i
++
)
{
/* Note that FromLocale() can be used before libvlc is initialized */
const
char
*
path
=
FromLocale
(
argv
[
i
]);
char
*
arg
;
if
(
asprintf
(
&
arg
,
"--plugin-path=%s"
,
path
)
==
-
1
)
abort
();
const
char
*
const
vlc_argv
[]
=
{
"--ignore-config"
,
"--quiet"
,
arg
,
NULL
,
};
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_instance_t
*
vlc
=
libvlc_new
(
3
,
vlc_argv
,
&
ex
);
if
(
vlc
!=
NULL
)
libvlc_release
(
vlc
);
free
(
arg
);
if
(
vlc
==
NULL
)
fprintf
(
stderr
,
"No plugins in %s
\n
"
,
path
);
LocaleFree
(
path
);
if
(
vlc
==
NULL
)
return
1
;
}
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