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
a82db287
Commit
a82db287
authored
Jul 31, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified vout_window_t to be completly independant of vout.
parent
8d58d014
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
235 additions
and
85 deletions
+235
-85
include/vlc_vout_window.h
include/vlc_vout_window.h
+150
-0
src/Makefile.am
src/Makefile.am
+2
-1
src/libvlccore.sym
src/libvlccore.sym
+3
-3
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+0
-81
src/video_output/window.c
src/video_output/window.c
+80
-0
No files found.
include/vlc_vout_window.h
0 → 100644
View file @
a82db287
/*****************************************************************************
* vlc_vout_window.h: vout_window_t definitions
*****************************************************************************
* Copyright (C) 2008 Rémi Denis-Courmont
* Copyright (C) 2009 Laurent Aimar
* $Id$
*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ 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.
*****************************************************************************/
#ifndef VLC_VOUT_WINDOW_H
#define VLC_VOUT_WINDOW_H 1
/**
* \file
* This file defines vout windows structures and functions in vlc
*/
#include <vlc_common.h>
/* */
typedef
struct
vout_window_t
vout_window_t
;
typedef
struct
vout_window_sys_t
vout_window_sys_t
;
/**
* Window handle type
*/
enum
{
VOUT_WINDOW_TYPE_XWINDOW
,
VOUT_WINDOW_TYPE_HWND
,
};
/**
* Control query for vout_window_t
*/
enum
{
VOUT_WINDOW_SET_ON_TOP
,
/* int b_on_top */
VOUT_WINDOW_SET_SIZE
,
/* int i_width, int i_height */
};
typedef
struct
{
/* If true, a standalone window is requested */
bool
is_standalone
;
/* Window handle type */
int
type
;
/* Window position hint */
int
x
;
int
y
;
/* Windows size int */
int
width
;
int
height
;
}
vout_window_cfg_t
;
/**
* FIXME do we need an event system in the window too ?
* or the window user will take care of it ?
*/
struct
vout_window_t
{
VLC_COMMON_MEMBERS
/* Module */
module_t
*
module
;
/* Initial state (reserved).
* Once the open function is called, it will be set to NULL
*/
const
vout_window_cfg_t
*
cfg
;
/* window handle (mandatory)
*
* It must be filled in the open function.
*/
union
{
void
*
hwnd
;
/* Win32 window handle */
uint32_t
xid
;
/* X11 windows ID */
}
handle
;
/* Control on the module (mandatory)
*
* Do not use it directly but use vout_window_Control.
*/
int
(
*
control
)(
vout_window_t
*
,
int
query
,
va_list
);
/* Private place holder for the vout_window_t module (optional)
*
* A module is free to used it as it wishes.
*/
vout_window_sys_t
*
sys
;
};
/**
* It creates a new window.
*
* XXX If you are inside a "vout display", you must use
* vout_display_New/DeleteWindow when possible to allow window recycling.
*/
VLC_EXPORT
(
vout_window_t
*
,
vout_window_New
,
(
vlc_object_t
*
,
const
char
*
module
,
const
vout_window_cfg_t
*
)
);
/**
* It deletes a window created by vout_window_New.
*
* XXX See vout_window_New about window recycling.
*/
VLC_EXPORT
(
void
,
vout_window_Delete
,
(
vout_window_t
*
)
);
/**
* It allows configuring a window.
*
* XXX you must own the windows, and vout_window_t are not thread safe.
* You must not use it directly but prefer the vout_window_* wrappers.
*/
VLC_EXPORT
(
int
,
vout_window_Control
,
(
vout_window_t
*
,
int
query
,
...)
);
/**
* Configure the "On Top" properties of a windows.
*/
static
inline
int
vout_window_SetOnTop
(
vout_window_t
*
window
,
bool
is_on_top
)
{
return
vout_window_Control
(
window
,
VOUT_WINDOW_SET_ON_TOP
,
is_on_top
);
}
/**
* Configure the windows display size.
*/
static
inline
int
vout_window_SetSize
(
vout_window_t
*
window
,
int
width
,
int
height
)
{
return
vout_window_Control
(
window
,
VOUT_WINDOW_SET_SIZE
,
width
,
height
);
}
#endif
/* VLC_VOUT_WINDOW_H */
src/Makefile.am
View file @
a82db287
...
...
@@ -95,7 +95,7 @@ pluginsinclude_HEADERS = \
../include/vlc_vlm.h
\
../include/vlc_video_splitter.h
\
../include/vlc_vout.h
\
../include/vlc_window.h
\
../include/vlc_
vout_
window.h
\
../include/vlc_xml.h
\
$(NULL)
...
...
@@ -350,6 +350,7 @@ SOURCES_libvlc_common = \
video_output/video_text.c
\
video_output/video_widgets.c
\
video_output/vout_subpictures.c
\
video_output/window.c
\
video_output/vout_intf.c
\
video_output/vout_internal.h
\
video_output/vout_control.h
\
...
...
src/libvlccore.sym
View file @
a82db287
...
...
@@ -560,7 +560,6 @@ __vlm_New
__vout_AllocatePicture
vout_ChromaCmp
vout_Close
vout_ControlWindow
__vout_Create
vout_CreatePicture
vout_DestroyPicture
...
...
@@ -573,11 +572,12 @@ vout_OSDIcon
__vout_OSDMessage
vout_OSDSlider
vout_PlacePicture
vout_ReleaseWindow
__vout_Request
vout_RequestWindow
vout_ShowTextAbsolute
vout_ShowTextRelative
vout_UnlinkPicture
vout_window_New
vout_window_Control
vout_window_Delete
__xml_Create
xml_Delete
src/video_output/vout_intf.c
View file @
a82db287
...
...
@@ -43,7 +43,6 @@
#include <vlc_playlist.h>
#include <vlc_vout.h>
#include <vlc_window.h>
#include <vlc_image.h>
#include <vlc_osd.h>
#include <vlc_charset.h>
...
...
@@ -81,86 +80,6 @@ static int TitleTimeoutCallback( vlc_object_t *, char const *,
static
int
TitlePositionCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
/**
* Creates a video output window.
* On Unix systems, this is an X11 drawable (handle).
* On Windows, this is a Win32 window (handle).
* Video output plugins are supposed to called this function and display the
* video within the resulting window, while in windowed mode.
*
* @param p_vout video output thread to create a window for
* @param psz_cap VLC module capability (window system type)
* @param pi_x_hint pointer to store the recommended horizontal position [OUT]
* @param pi_y_hint pointer to store the recommended vertical position [OUT]
* @param pi_width_hint pointer to store the recommended width [OUT]
* @param pi_height_hint pointer to store the recommended height [OUT]
*
* @return a vout_window_t object, or NULL in case of failure.
* The window is released with vout_ReleaseWindow().
*/
vout_window_t
*
vout_RequestWindow
(
vout_thread_t
*
p_vout
,
const
char
*
psz_cap
,
int
*
pi_x_hint
,
int
*
pi_y_hint
,
unsigned
int
*
pi_width_hint
,
unsigned
int
*
pi_height_hint
)
{
/* Get requested coordinates */
*
pi_x_hint
=
var_GetInteger
(
p_vout
,
"video-x"
);
*
pi_y_hint
=
var_GetInteger
(
p_vout
,
"video-y"
);
*
pi_width_hint
=
p_vout
->
i_window_width
;
*
pi_height_hint
=
p_vout
->
i_window_height
;
vout_window_t
*
wnd
=
vlc_custom_create
(
VLC_OBJECT
(
p_vout
),
sizeof
(
*
wnd
),
VLC_OBJECT_GENERIC
,
"window"
);
if
(
wnd
==
NULL
)
return
NULL
;
wnd
->
vout
=
p_vout
;
wnd
->
width
=
*
pi_width_hint
;
wnd
->
height
=
*
pi_height_hint
;
wnd
->
pos_x
=
*
pi_x_hint
;
wnd
->
pos_y
=
*
pi_y_hint
;
vlc_object_attach
(
wnd
,
p_vout
);
wnd
->
module
=
module_need
(
wnd
,
psz_cap
,
NULL
,
false
);
if
(
wnd
->
module
==
NULL
)
{
msg_Dbg
(
wnd
,
"no
\"
%s
\"
window provider available"
,
psz_cap
);
vlc_object_release
(
wnd
);
return
NULL
;
}
*
pi_width_hint
=
wnd
->
width
;
*
pi_height_hint
=
wnd
->
height
;
*
pi_x_hint
=
wnd
->
pos_x
;
*
pi_y_hint
=
wnd
->
pos_y
;
return
wnd
;
}
/**
* Releases a window handle obtained with vout_RequestWindow().
* @param p_vout video output thread that allocated the window
* (if this is NULL; this fnction is a no-op).
*/
void
vout_ReleaseWindow
(
vout_window_t
*
wnd
)
{
if
(
wnd
==
NULL
)
return
;
assert
(
wnd
->
module
);
module_unneed
(
wnd
,
wnd
->
module
);
vlc_object_release
(
wnd
);
}
int
vout_ControlWindow
(
vout_window_t
*
wnd
,
int
i_query
,
va_list
args
)
{
if
(
wnd
==
NULL
)
return
VLC_EGENERIC
;
assert
(
wnd
->
control
);
return
wnd
->
control
(
wnd
,
i_query
,
args
);
}
/*****************************************************************************
* vout_IntfInit: called during the vout creation to initialise misc things.
*****************************************************************************/
...
...
include/vlc_window.h
→
src/video_output/window.c
View file @
a82db287
/*****************************************************************************
*
vlc_window.h: Embedded video output window
*
window.c: "vout window" managment
*****************************************************************************
* Copyright (C) 2008 Rémi Denis-Courmont
* Copyright (C) 2009 Laurent Aimar
* $Id$
*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ 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
...
...
@@ -18,56 +21,60 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef LIBVLCCORE_WINDOW_H
# define LIBVLCCORE_WINDOW_H 1
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
/**
* \file
* This file defines functions and structures for output windows
*/
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout_window.h>
# include <stdarg.h>
vout_window_t
*
vout_window_New
(
vlc_object_t
*
obj
,
const
char
*
module
,
const
vout_window_cfg_t
*
cfg
)
{
vout_window_t
*
window
=
vlc_object_create
(
obj
,
sizeof
(
*
window
));
typedef
struct
vout_window_t
vout_window_t
;
typedef
struct
vout_window_sys_t
vout_window_sys_t
;
window
->
cfg
=
cfg
;
memset
(
&
window
->
handle
,
0
,
sizeof
(
window
->
handle
));
window
->
control
=
NULL
;
window
->
sys
=
NULL
;
struct
vout_window_t
{
VLC_COMMON_MEMBERS
vlc_object_attach
(
window
,
obj
);
module_t
*
module
;
vout_thread_t
*
vout
;
union
{
void
*
hwnd
;
/* Win32 window handle */
uint32_t
xid
;
/* X11 window ID */
}
handle
;
vout_window_sys_t
*
p_sys
;
/* window provider private data */
window
->
module
=
module_need
(
window
,
"vout window"
,
module
,
module
&&
*
module
!=
'\0'
);
if
(
!
window
->
module
)
{
vlc_object_detach
(
window
);
vlc_object_release
(
window
);
return
NULL
;
}
return
window
;
}
unsigned
width
;
/* pixels width */
unsigned
height
;
/* pixels height */
i
nt
pos_x
;
/* horizontal position hint */
int
pos_y
;
/* vertical position hint */
void
vout_window_Delete
(
vout_window_t
*
window
)
{
i
f
(
!
window
)
return
;
int
(
*
control
)
(
struct
vout_window_t
*
,
int
,
va_list
);
};
vlc_object_detach
(
window
);
VLC_EXPORT
(
vout_window_t
*
,
vout_RequestWindow
,
(
vout_thread_t
*
,
const
char
*
,
int
*
,
int
*
,
unsigned
int
*
,
unsigned
int
*
)
);
VLC_EXPORT
(
void
,
vout_ReleaseWindow
,
(
vout_window_t
*
)
);
VLC_EXPORT
(
int
,
vout_ControlWindow
,
(
vout_window_t
*
,
int
,
va_list
)
);
module_unneed
(
window
,
window
->
module
);
static
inline
vout_window_t
*
vout_RequestXWindow
(
vout_thread_t
*
vout
,
int
*
x
,
int
*
y
,
unsigned
*
w
,
unsigned
*
h
)
{
return
vout_RequestWindow
(
vout
,
"xwindow"
,
x
,
y
,
w
,
h
);
vlc_object_release
(
window
);
}
static
inline
vout_window_t
*
vout_RequestHWND
(
vout_thread_t
*
vout
,
int
*
x
,
int
*
y
,
unsigned
*
w
,
unsigned
*
h
)
int
vout_window_Control
(
vout_window_t
*
window
,
int
query
,
...)
{
return
vout_RequestWindow
(
vout
,
"hwnd"
,
x
,
y
,
w
,
h
);
va_list
args
;
va_start
(
args
,
query
);
int
ret
=
window
->
control
(
window
,
query
,
args
);
va_end
(
args
);
return
ret
;
}
#endif
/* !LIBVLCCORE_WINDOW_H */
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