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
2f6ad030
Commit
2f6ad030
authored
Feb 07, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* get/set/toggle fullscreen
* Fix a bug in playlist_play (Refs:#457)
parent
de11230f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
5 deletions
+144
-5
Makefile.am
Makefile.am
+1
-0
include/vlc/libvlc.h
include/vlc/libvlc.h
+4
-0
src/control/playlist.c
src/control/playlist.c
+1
-1
src/control/video.c
src/control/video.c
+126
-0
test/libvlc_sample.c
test/libvlc_sample.c
+12
-4
No files found.
Makefile.am
View file @
2f6ad030
...
@@ -476,6 +476,7 @@ SOURCES_libvlc_common = \
...
@@ -476,6 +476,7 @@ SOURCES_libvlc_common = \
src/control/core.c
\
src/control/core.c
\
src/control/playlist.c
\
src/control/playlist.c
\
src/control/input.c
\
src/control/input.c
\
src/control/video.c
\
src/control/mediacontrol_core.c
\
src/control/mediacontrol_core.c
\
src/control/mediacontrol_util.c
\
src/control/mediacontrol_util.c
\
src/control/mediacontrol_audio_video.c
\
src/control/mediacontrol_audio_video.c
\
...
...
include/vlc/libvlc.h
View file @
2f6ad030
...
@@ -229,6 +229,10 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *);
...
@@ -229,6 +229,10 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *);
vlc_int64_t
libvlc_input_get_time
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
vlc_int64_t
libvlc_input_get_time
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
float
libvlc_input_get_position
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
float
libvlc_input_get_position
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
void
libvlc_toggle_fullscreen
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
/** @} */
/** @} */
...
...
src/control/playlist.c
View file @
2f6ad030
...
@@ -37,7 +37,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
...
@@ -37,7 +37,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
libvlc_exception_raise
(
p_exception
,
"Empty playlist"
);
libvlc_exception_raise
(
p_exception
,
"Empty playlist"
);
return
;
return
;
}
}
if
(
i_id
>
=
0
)
if
(
i_id
>
0
)
{
{
/* Always use the current view when using libvlc */
/* Always use the current view when using libvlc */
playlist_view_t
*
p_view
;
playlist_view_t
*
p_view
;
...
...
src/control/video.c
0 → 100644
View file @
2f6ad030
/*****************************************************************************
* video.c: ibvlc new API video functions
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $
*
* Authors: Clment Stenac <zorglub@videolan.org>
*
* 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.
*****************************************************************************/
#include <libvlc_internal.h>
#include <vlc/libvlc.h>
#include <vlc/vout.h>
#include <vlc/intf.h>
static
vout_thread_t
*
GetVout
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_exception
)
{
input_thread_t
*
p_input_thread
;
vout_thread_t
*
p_vout
;
if
(
!
p_input
)
{
libvlc_exception_raise
(
p_exception
,
"Input is NULL"
);
return
NULL
;
}
p_input_thread
=
(
input_thread_t
*
)
vlc_object_get
(
p_input
->
p_instance
->
p_vlc
,
p_input
->
i_input_id
);
if
(
!
p_input_thread
)
{
libvlc_exception_raise
(
p_exception
,
"Input does not exist"
);
return
NULL
;
}
p_vout
=
vlc_object_find
(
p_input_thread
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
if
(
!
p_vout
)
{
libvlc_exception_raise
(
p_exception
,
"No active video output"
);
return
NULL
;
}
return
p_vout
;
}
/**********************************************************************
* Exported functions
**********************************************************************/
void
libvlc_set_fullscreen
(
libvlc_input_t
*
p_input
,
int
b_fullscreen
,
libvlc_exception_t
*
p_e
)
{
/* We only work on the first vout */
vout_thread_t
*
p_vout1
=
GetVout
(
p_input
,
p_e
);
vlc_value_t
val
;
int
i_ret
;
/* GetVout will raise the exception for us */
if
(
!
p_vout1
)
{
fprintf
(
stderr
,
"No vout
\n
"
);
return
;
}
if
(
b_fullscreen
)
val
.
b_bool
=
VLC_TRUE
;
else
val
.
b_bool
=
VLC_FALSE
;
var_Set
(
p_vout1
,
"fullscreen"
,
val
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while setting fullscreen value"
);
}
int
libvlc_get_fullscreen
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_e
)
{
/* We only work on the first vout */
vout_thread_t
*
p_vout1
=
GetVout
(
p_input
,
p_e
);
vlc_value_t
val
;
int
i_ret
;
/* GetVout will raise the exception for us */
if
(
!
p_vout1
)
return
0
;
i_ret
=
var_Get
(
p_vout1
,
"fullscreen"
,
&
val
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while looking up fullscreen value"
);
return
val
.
b_bool
==
VLC_TRUE
?
1
:
0
;
}
void
libvlc_toggle_fullscreen
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_e
)
{
/* We only work on the first vout */
vout_thread_t
*
p_vout1
=
GetVout
(
p_input
,
p_e
);
vlc_value_t
val
;
int
i_ret
;
/* GetVout will raise the exception for us */
if
(
!
p_vout1
)
return
;
i_ret
=
var_Get
(
p_vout1
,
"fullscreen"
,
&
val
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while looking up fullscreen value"
);
val
.
b_bool
=
!
val
.
b_bool
;
i_ret
=
var_Set
(
p_vout1
,
"fullscreen"
,
val
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while setting fullscreen value"
);
}
test/libvlc_sample.c
View file @
2f6ad030
...
@@ -20,7 +20,9 @@ int main(int argc, char **argv)
...
@@ -20,7 +20,9 @@ int main(int argc, char **argv)
return
0
;
return
0
;
}
}
libvlc_playlist_play
(
p_instance1
,
0
,
NULL
,
NULL
);
fprintf
(
stderr
,
"Playing
\n
"
);
libvlc_playlist_play
(
p_instance1
,
0
,
0
,
NULL
,
NULL
);
fprintf
(
stderr
,
"Playback started
\n
"
);
while
(
1
)
while
(
1
)
{
{
...
@@ -40,9 +42,15 @@ int main(int argc, char **argv)
...
@@ -40,9 +42,15 @@ int main(int argc, char **argv)
b_started
=
1
;
b_started
=
1
;
}
}
fprintf
(
stderr
,
"Length %lli - Time %lli
\n
"
,
libvlc_toggle_fullscreen
(
p_input
,
&
exception
);
if
(
libvlc_exception_raised
(
&
exception
)
)
{
fprintf
(
stderr
,
"EX : %s
\n
"
,
libvlc_exception_get_message
(
&
exception
)
);
}
fprintf
(
stderr
,
"Length %lli - Time %lli - Full screen %i
\n
"
,
libvlc_input_get_length
(
p_input
,
NULL
),
libvlc_input_get_length
(
p_input
,
NULL
),
libvlc_input_get_time
(
p_input
,
NULL
)
);
libvlc_input_get_time
(
p_input
,
NULL
),
libvlc_get_fullscreen
(
p_input
,
NULL
)
);
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
}
}
...
...
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