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
7f9b7d3e
Commit
7f9b7d3e
authored
Jul 08, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a proper API to set the user agent
parent
d3b02be6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
1 deletion
+31
-1
bin/vlc.c
bin/vlc.c
+2
-0
include/vlc/libvlc.h
include/vlc/libvlc.h
+13
-0
src/control/core.c
src/control/core.c
+12
-0
src/libvlc.c
src/libvlc.c
+3
-1
src/libvlc.sym
src/libvlc.sym
+1
-0
No files found.
bin/vlc.c
View file @
7f9b7d3e
...
@@ -198,6 +198,8 @@ int main( int i_argc, const char *ppsz_argv[] )
...
@@ -198,6 +198,8 @@ int main( int i_argc, const char *ppsz_argv[] )
if
(
vlc
==
NULL
)
if
(
vlc
==
NULL
)
goto
out
;
goto
out
;
libvlc_set_user_agent
(
vlc
,
"VLC media player"
,
NULL
);
#if !defined (HAVE_MAEMO) && !defined __APPLE__
#if !defined (HAVE_MAEMO) && !defined __APPLE__
libvlc_add_intf
(
vlc
,
"globalhotkeys,none"
);
libvlc_add_intf
(
vlc
,
"globalhotkeys,none"
);
#endif
#endif
...
...
include/vlc/libvlc.h
View file @
7f9b7d3e
...
@@ -171,6 +171,19 @@ void libvlc_set_exit_handler( libvlc_instance_t *p_instance,
...
@@ -171,6 +171,19 @@ void libvlc_set_exit_handler( libvlc_instance_t *p_instance,
VLC_PUBLIC_API
VLC_PUBLIC_API
void
libvlc_wait
(
libvlc_instance_t
*
p_instance
);
void
libvlc_wait
(
libvlc_instance_t
*
p_instance
);
/**
* Sets the application name. LibVLC passes this as the user agent string
* when a protocol requires it.
*
* \param p_instance LibVLC instance
* \param name human-readable application name, e.g. "FooBar player 1.2.3"
* \param http HTTP User Agent, e.g. "FooBar/1.2.3 Python/2.6.0"
* \version LibVLC 1.1.1 or later
*/
VLC_PUBLIC_API
void
libvlc_set_user_agent
(
libvlc_instance_t
*
p_instance
,
const
char
*
name
,
const
char
*
http
);
/**
/**
* Retrieve libvlc version.
* Retrieve libvlc version.
*
*
...
...
src/control/core.c
View file @
7f9b7d3e
...
@@ -69,6 +69,8 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
...
@@ -69,6 +69,8 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
p_new
->
verbosity
=
1
;
p_new
->
verbosity
=
1
;
p_new
->
p_callback_list
=
NULL
;
p_new
->
p_callback_list
=
NULL
;
vlc_mutex_init
(
&
p_new
->
instance_lock
);
vlc_mutex_init
(
&
p_new
->
instance_lock
);
var_Create
(
p_libvlc_int
,
"http-user-agent"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
return
p_new
;
return
p_new
;
error:
error:
...
@@ -127,6 +129,16 @@ void libvlc_wait( libvlc_instance_t *p_i )
...
@@ -127,6 +129,16 @@ void libvlc_wait( libvlc_instance_t *p_i )
libvlc_InternalWait
(
p_libvlc
);
libvlc_InternalWait
(
p_libvlc
);
}
}
void
libvlc_set_user_agent
(
libvlc_instance_t
*
p_i
,
const
char
*
name
,
const
char
*
http
)
{
libvlc_int_t
*
p_libvlc
=
p_i
->
p_libvlc_int
;
var_SetString
(
p_libvlc
,
"user-agent"
,
name
);
if
(
http
!=
NULL
)
var_SetString
(
p_libvlc
,
"http-user-agent"
,
http
);
}
const
char
*
libvlc_get_version
(
void
)
const
char
*
libvlc_get_version
(
void
)
{
{
return
VLC_Version
();
return
VLC_Version
();
...
...
src/libvlc.c
View file @
7f9b7d3e
...
@@ -761,8 +761,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -761,8 +761,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
var_Create
(
p_libvlc
,
"snapshot-file"
,
VLC_VAR_STRING
);
var_Create
(
p_libvlc
,
"snapshot-file"
,
VLC_VAR_STRING
);
var_Create
(
p_libvlc
,
"record-file"
,
VLC_VAR_STRING
);
var_Create
(
p_libvlc
,
"record-file"
,
VLC_VAR_STRING
);
/*
vout window provider
*/
/*
some default internal settings
*/
var_Create
(
p_libvlc
,
"window"
,
VLC_VAR_STRING
);
var_Create
(
p_libvlc
,
"window"
,
VLC_VAR_STRING
);
var_Create
(
p_libvlc
,
"user-agent"
,
VLC_VAR_STRING
);
var_SetString
(
p_libvlc
,
"user-agent"
,
"(LibVLC "
VERSION
")"
);
/* Initialize playlist and get commandline files */
/* Initialize playlist and get commandline files */
p_playlist
=
playlist_Create
(
VLC_OBJECT
(
p_libvlc
)
);
p_playlist
=
playlist_Create
(
VLC_OBJECT
(
p_libvlc
)
);
...
...
src/libvlc.sym
View file @
7f9b7d3e
...
@@ -160,6 +160,7 @@ libvlc_release
...
@@ -160,6 +160,7 @@ libvlc_release
libvlc_retain
libvlc_retain
libvlc_set_fullscreen
libvlc_set_fullscreen
libvlc_set_log_verbosity
libvlc_set_log_verbosity
libvlc_set_user_agent
libvlc_toggle_fullscreen
libvlc_toggle_fullscreen
libvlc_toggle_teletext
libvlc_toggle_teletext
libvlc_track_description_release
libvlc_track_description_release
...
...
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