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
14863071
Commit
14863071
authored
Jan 31, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LibVLC audio: take a player object for most functions, remove exceptions
parent
d3472830
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
128 deletions
+112
-128
include/vlc/libvlc_media_player.h
include/vlc/libvlc_media_player.h
+34
-43
src/control/audio.c
src/control/audio.c
+69
-79
src/control/media_player.c
src/control/media_player.c
+5
-0
src/control/mediacontrol_audio_video.c
src/control/mediacontrol_audio_video.c
+4
-6
No files found.
include/vlc/libvlc_media_player.h
View file @
14863071
...
...
@@ -928,12 +928,12 @@ VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
* Set the audio output.
* Change will be applied after stop and play.
*
* \param
p_instance libvlc instance
* \param
mp media player
* \param psz_name name of audio output,
* use psz_name of \see libvlc_audio_output_t
* \return true if function succeded
*/
VLC_PUBLIC_API
int
libvlc_audio_output_set
(
libvlc_
instance
_t
*
,
VLC_PUBLIC_API
int
libvlc_audio_output_set
(
libvlc_
media_player
_t
*
,
const
char
*
);
/**
...
...
@@ -972,13 +972,13 @@ VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
int
);
/**
* Set
device for using
* Set
audio output device. Changes are only effective after stop and play.
*
* \param
p_instance libvlc instance
* \param
mp media player
* \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
* \param psz_device_id device
*/
VLC_PUBLIC_API
void
libvlc_audio_output_device_set
(
libvlc_
instance
_t
*
,
VLC_PUBLIC_API
void
libvlc_audio_output_device_set
(
libvlc_
media_player
_t
*
,
const
char
*
,
const
char
*
);
...
...
@@ -986,124 +986,115 @@ VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
* Get current audio device type. Device type describes something like
* character of output sound - stereo sound, 2.1, 5.1 etc
*
* \param p_instance vlc instance
* \param p_e an initialized exception pointer
* \param mp media player
* \return the audio devices type \see libvlc_audio_output_device_types_t
*/
VLC_PUBLIC_API
int
libvlc_audio_output_get_device_type
(
libvlc_
instance_t
*
,
libvlc_exception
_t
*
);
libvlc_
media_player
_t
*
);
/**
* Set current audio device type.
*
* \param
p_instance
vlc instance
* \param
mp
vlc instance
* \param device_type the audio device type,
according to \see libvlc_audio_output_device_types_t
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API
void
libvlc_audio_output_set_device_type
(
libvlc_instance_t
*
,
int
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
void
libvlc_audio_output_set_device_type
(
libvlc_media_player_t
*
,
int
);
/**
* Toggle mute status.
*
* \param
p_instance libvlc instance
* \param
mp media player
*/
VLC_PUBLIC_API
void
libvlc_audio_toggle_mute
(
libvlc_
instance
_t
*
);
VLC_PUBLIC_API
void
libvlc_audio_toggle_mute
(
libvlc_
media_player
_t
*
);
/**
* Get current mute status.
*
* \param
p_instance libvlc instance
* \param
mp media player
* \return the mute status (boolean)
*/
VLC_PUBLIC_API
int
libvlc_audio_get_mute
(
libvlc_
instance
_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_get_mute
(
libvlc_
media_player
_t
*
);
/**
* Set mute status.
*
* \param
p_instance libvlc instance
* \param
mp media player
* \param status If status is true then mute, otherwise unmute
*/
VLC_PUBLIC_API
void
libvlc_audio_set_mute
(
libvlc_
instance
_t
*
,
int
);
VLC_PUBLIC_API
void
libvlc_audio_set_mute
(
libvlc_
media_player
_t
*
,
int
);
/**
* Get current audio level.
*
* \param
p_instance libvlc instance
* \param
mp media player
* \param p_e an initialized exception pointer
* \return the audio level (int)
*/
VLC_PUBLIC_API
int
libvlc_audio_get_volume
(
libvlc_
instance
_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_get_volume
(
libvlc_
media_player
_t
*
);
/**
* Set current audio level.
*
* \param
p_instance libvlc instance
* \param
mp media player
* \param i_volume the volume (int)
* \
param p_e an initialized exception pointer
* \
return 0 if the volume was set, -1 if it was out of range
*/
VLC_PUBLIC_API
void
libvlc_audio_set_volume
(
libvlc_instance_t
*
,
int
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_set_volume
(
libvlc_media_player_t
*
,
int
);
/**
* Get number of available audio tracks.
*
* \param p_mi media player
* \param p_e an initialized exception
* \return the number of available audio tracks (int)
* \return the number of available audio tracks (int), or -1 if unavailable
*/
VLC_PUBLIC_API
int
libvlc_audio_get_track_count
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_get_track_count
(
libvlc_media_player_t
*
);
/**
* Get the description of available audio tracks.
*
* \param p_mi media player
* \param p_e an initialized exception
* \return list with description of available audio tracks
* \return list with description of available audio tracks, or NULL
*/
VLC_PUBLIC_API
libvlc_track_description_t
*
libvlc_audio_get_track_description
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
libvlc_audio_get_track_description
(
libvlc_media_player_t
*
);
/**
* Get current audio track.
*
* \param p_mi media player
* \param p_e an initialized exception pointer
* \return the audio track (int)
* \return the audio track (int), or -1 if none.
*/
VLC_PUBLIC_API
int
libvlc_audio_get_track
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_get_track
(
libvlc_media_player_t
*
);
/**
* Set current audio track.
*
* \param p_mi media player
* \param i_track the track (int)
* \
param p_e an initialized exception pointe
r
* \
return 0 on success, -1 on erro
r
*/
VLC_PUBLIC_API
void
libvlc_audio_set_track
(
libvlc_media_player_t
*
,
int
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_set_track
(
libvlc_media_player_t
*
,
int
);
/**
* Get current audio channel.
*
* \param p_instance vlc instance
* \param p_e an initialized exception pointer
* \param mp media player
* \return the audio channel \see libvlc_audio_output_channel_t
*/
VLC_PUBLIC_API
int
libvlc_audio_get_channel
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_get_channel
(
libvlc_media_player_t
*
);
/**
* Set current audio channel.
*
* \param p_
instance vlc instance
* \param p_
mi media player
* \param channel the audio channel, \see libvlc_audio_output_channel_t
* \
param p_e an initialized exception pointe
r
* \
return 0 on success, -1 on erro
r
*/
VLC_PUBLIC_API
void
libvlc_audio_set_channel
(
libvlc_instance_t
*
,
int
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
int
libvlc_audio_set_channel
(
libvlc_media_player_t
*
,
int
);
/** @} audio */
...
...
src/control/audio.c
View file @
14863071
This diff is collapsed.
Click to expand it.
src/control/media_player.c
View file @
14863071
...
...
@@ -132,6 +132,8 @@ input_thread_t *libvlc_get_input_thread( libvlc_media_player_t *p_mi )
p_input_thread
=
p_mi
->
p_input_thread
;
if
(
p_input_thread
)
vlc_object_hold
(
p_input_thread
);
else
libvlc_printerr
(
"No active input"
);
unlock
(
p_mi
);
return
p_input_thread
;
...
...
@@ -354,6 +356,9 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_SetBool
(
mp
,
"keyboard-events"
,
true
);
var_Create
(
mp
,
"mouse-events"
,
VLC_VAR_BOOL
);
/* Audio */
var_Create
(
mp
,
"aout"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
mp
->
p_md
=
NULL
;
mp
->
state
=
libvlc_NothingSpecial
;
mp
->
p_libvlc_instance
=
instance
;
...
...
src/control/mediacontrol_audio_video.c
View file @
14863071
...
...
@@ -203,7 +203,8 @@ mediacontrol_sound_get_volume( mediacontrol_Instance *self,
mediacontrol_exception_init
(
exception
);
i_ret
=
libvlc_audio_get_volume
(
self
->
p_instance
);
//i_ret = libvlc_audio_get_volume( self->p_instance );
#warning FIXME: unimplented
/* FIXME: Normalize in [0..100] */
return
(
unsigned
short
)
i_ret
;
}
...
...
@@ -214,13 +215,10 @@ mediacontrol_sound_set_volume( mediacontrol_Instance *self,
mediacontrol_Exception
*
exception
)
{
/* FIXME: Normalize in [0..100] */
libvlc_exception_t
ex
;
mediacontrol_exception_init
(
exception
);
libvlc_exception_init
(
&
ex
);
libvlc_audio_set_volume
(
self
->
p_instance
,
volume
,
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
//libvlc_audio_set_volume( self->p_instance, volume
);
#warning FIXME: unimplented
}
int
mediacontrol_set_visual
(
mediacontrol_Instance
*
self
,
...
...
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