Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
f57e6b34
Commit
f57e6b34
authored
Mar 05, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- control/video.c: clean up and more error/exception checks
parent
0832b7e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
28 deletions
+42
-28
src/control/video.c
src/control/video.c
+42
-28
No files found.
src/control/video.c
View file @
f57e6b34
...
@@ -29,14 +29,13 @@
...
@@ -29,14 +29,13 @@
#include <vlc_vout.h>
#include <vlc_vout.h>
/*
/*
* Remember to release the returned
vo
ut_thread_t since it is locked at
* Remember to release the returned
inp
ut_thread_t since it is locked at
* the end of this function.
* the end of this function.
*/
*/
static
vout_thread_t
*
GetVout
(
libvlc_input_t
*
p_input
,
static
input_thread_t
*
GetInputThread
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_exception
)
libvlc_exception_t
*
p_exception
)
{
{
input_thread_t
*
p_input_thread
;
input_thread_t
*
p_input_thread
;
vout_thread_t
*
p_vout
;
if
(
!
p_input
)
if
(
!
p_input
)
{
{
...
@@ -53,17 +52,31 @@ static vout_thread_t *GetVout( libvlc_input_t *p_input,
...
@@ -53,17 +52,31 @@ static vout_thread_t *GetVout( libvlc_input_t *p_input,
return
NULL
;
return
NULL
;
}
}
return
p_input_thread
;;
}
/*
* Remember to release the returned vout_thread_t since it is locked at
* the end of this function.
*/
static
vout_thread_t
*
GetVout
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_exception
)
{
input_thread_t
*
p_input_thread
=
GetInputThread
(
p_input
,
p_exception
);
vout_thread_t
*
p_vout
=
NULL
;
if
(
p_input_thread
)
{
p_vout
=
vlc_object_find
(
p_input_thread
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
p_vout
=
vlc_object_find
(
p_input_thread
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
if
(
!
p_vout
)
if
(
!
p_vout
)
{
{
vlc_object_release
(
p_input_thread
);
libvlc_exception_raise
(
p_exception
,
"No active video output"
);
libvlc_exception_raise
(
p_exception
,
"No active video output"
);
return
NULL
;
}
}
vlc_object_release
(
p_input_thread
);
vlc_object_release
(
p_input_thread
);
}
return
p_vout
;
return
p_vout
;
}
}
/**********************************************************************
/**********************************************************************
* Exported functions
* Exported functions
**********************************************************************/
**********************************************************************/
...
@@ -196,20 +209,22 @@ int libvlc_video_get_width( libvlc_input_t *p_input,
...
@@ -196,20 +209,22 @@ int libvlc_video_get_width( libvlc_input_t *p_input,
vlc_bool_t
libvlc_input_has_vout
(
libvlc_input_t
*
p_input
,
vlc_bool_t
libvlc_input_has_vout
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_e
)
libvlc_exception_t
*
p_e
)
{
{
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
input_thread_t
*
p_input_thread
=
GetInputThread
(
p_input
,
p_e
);
if
(
NULL
==
p_vout
)
vlc_bool_t
has_vout
=
VLC_FALSE
;
if
(
p_input_thread
)
{
{
if
(
libvlc_exception_raised
(
p_e
)
vout_thread_t
*
p_vout
;
&&
strcmp
(
"No active video output"
,
libvlc_exception_get_message
(
p_e
)
)
==
0
)
p_vout
=
vlc_object_find
(
p_input_thread
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
if
(
p_vout
)
{
{
libvlc_exception_clear
(
p_e
);
has_vout
=
VLC_TRUE
;
vlc_object_release
(
p_vout
);
}
}
return
VLC_FALSE
;
vlc_object_release
(
p_input_thread
)
;
}
}
return
has_vout
;
vlc_object_release
(
p_vout
);
return
VLC_TRUE
;
}
}
int
libvlc_video_reparent
(
libvlc_input_t
*
p_input
,
libvlc_drawable_t
d
,
int
libvlc_video_reparent
(
libvlc_input_t
*
p_input
,
libvlc_drawable_t
d
,
...
@@ -217,23 +232,22 @@ int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d,
...
@@ -217,23 +232,22 @@ int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d,
{
{
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
if
(
p_vout
==
NULL
)
if
(
p_vout
)
{
{
/// \todo: set exception
return
0
;
}
vout_Control
(
p_vout
,
VOUT_REPARENT
,
d
);
vout_Control
(
p_vout
,
VOUT_REPARENT
,
d
);
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
return
0
;
return
0
;
}
}
void
libvlc_video_resize
(
libvlc_input_t
*
p_input
,
int
width
,
int
height
,
libvlc_exception_t
*
p_e
)
void
libvlc_video_resize
(
libvlc_input_t
*
p_input
,
int
width
,
int
height
,
libvlc_exception_t
*
p_e
)
{
{
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
if
(
p_vout
)
{
vout_Control
(
p_vout
,
VOUT_SET_SIZE
,
width
,
height
);
vout_Control
(
p_vout
,
VOUT_SET_SIZE
,
width
,
height
);
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
}
}
/* global video settings */
/* global video settings */
...
...
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