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
5f6c5900
Commit
5f6c5900
authored
Feb 06, 2001
by
Damien Lucas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
. Fixed a FIXME in SDL: p_vout->p_sys is no more used in intf_sdl.c
. Used instead p_vout->i_changes like in x11
parent
d04b152b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
126 deletions
+111
-126
include/video_output.h
include/video_output.h
+3
-1
plugins/sdl/intf_sdl.c
plugins/sdl/intf_sdl.c
+50
-95
plugins/sdl/vout_sdl.c
plugins/sdl/vout_sdl.c
+54
-27
src/video_output/video_output.c
src/video_output/video_output.c
+4
-3
No files found.
include/video_output.h
View file @
5f6c5900
...
@@ -219,9 +219,11 @@ typedef struct vout_thread_s
...
@@ -219,9 +219,11 @@ typedef struct vout_thread_s
#define VOUT_GRAYSCALE_CHANGE 0x0002
/* b_grayscale changed */
#define VOUT_GRAYSCALE_CHANGE 0x0002
/* b_grayscale changed */
#define VOUT_INTF_CHANGE 0x0004
/* b_interface changed */
#define VOUT_INTF_CHANGE 0x0004
/* b_interface changed */
#define VOUT_SCALE_CHANGE 0x0008
/* b_scale changed */
#define VOUT_SCALE_CHANGE 0x0008
/* b_scale changed */
#define VOUT_GAMMA_CHANGE 0x0010
/* gamma changed */
#define VOUT_CURSOR_CHANGE 0x0020
/* b_cursor changed */
#define VOUT_FULLSCREEN_CHANGE 0x0040
/* b_fullscreen changed */
#define VOUT_SIZE_CHANGE 0x0200
/* size changed */
#define VOUT_SIZE_CHANGE 0x0200
/* size changed */
#define VOUT_DEPTH_CHANGE 0x0400
/* depth changed */
#define VOUT_DEPTH_CHANGE 0x0400
/* depth changed */
#define VOUT_GAMMA_CHANGE 0x0010
/* gamma changed */
#define VOUT_YUV_CHANGE 0x0800
/* change yuv tables */
#define VOUT_YUV_CHANGE 0x0800
/* change yuv tables */
/* Disabled for thread deadlocks issues --Meuuh */
/* Disabled for thread deadlocks issues --Meuuh */
...
...
plugins/sdl/intf_sdl.c
View file @
5f6c5900
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* intf_sdl.c: SDL interface plugin
* intf_sdl.c: SDL interface plugin
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_sdl.c,v 1.2
5 2001/02/05 15:50:57
nitrox Exp $
* $Id: intf_sdl.c,v 1.2
6 2001/02/06 00:56:55
nitrox Exp $
*
*
* Authors:
* Authors:
*
*
...
@@ -50,30 +50,8 @@
...
@@ -50,30 +50,8 @@
#include "main.h"
#include "main.h"
/* FIXME: SOME CLUELESS MORON DEFINED THIS STRUCTURE IN VOUT_SDL.C AS WELL */
typedef
struct
vout_sys_s
{
int
i_width
;
int
i_height
;
SDL_Surface
*
p_display
;
/* display device */
SDL_Overlay
*
p_overlay
;
boolean_t
b_fullscreen
;
boolean_t
b_overlay
;
boolean_t
b_cursor
;
/* 1 if hide 0 else */
boolean_t
b_reopen_display
;
boolean_t
b_toggle_fullscreen
;
boolean_t
b_hide_cursor
;
Uint8
*
p_buffer
[
2
];
/* Buffers informations */
}
vout_sys_t
;
/* local prototype */
/* local prototype */
void
intf_SDL_Keymap
(
intf_thread_t
*
p_intf
);
void
intf_SDL_Keymap
(
intf_thread_t
*
p_intf
);
void
intf_SDL_Resize
(
intf_thread_t
*
p_intf
,
int
width
,
int
height
);
void
intf_SDL_Fullscreen
(
intf_thread_t
*
p_intf
);
void
intf_SDL_YUVSwitch
(
intf_thread_t
*
p_intf
);
void
intf_SDL_Hidecursor
(
intf_thread_t
*
p_intf
);
/*****************************************************************************
/*****************************************************************************
* intf_SDLCreate: initialize and create SDL interface
* intf_SDLCreate: initialize and create SDL interface
...
@@ -133,87 +111,65 @@ void intf_SDLManage( intf_thread_t *p_intf )
...
@@ -133,87 +111,65 @@ void intf_SDLManage( intf_thread_t *p_intf )
SDL_Event
event
;
/* SDL event */
SDL_Event
event
;
/* SDL event */
Uint8
i_key
;
Uint8
i_key
;
if
(
p_intf
->
p_vout
->
p_sys
->
b_overlay
)
{
intf_SDL_YUVSwitch
(
p_intf
);
p_intf
->
p_vout
->
p_sys
->
b_overlay
=
0
;
}
while
(
SDL_PollEvent
(
&
event
)
)
while
(
SDL_PollEvent
(
&
event
)
)
{
{
switch
(
event
.
type
)
{
switch
(
event
.
type
)
case
SDL_VIDEORESIZE
:
/* Resizing of window */
{
intf_SDL_Resize
(
p_intf
,
event
.
resize
.
w
,
event
.
resize
.
h
);
case
SDL_VIDEORESIZE
:
/* Resizing of window */
break
;
intf_Msg
(
"intf: video display resized (%dx%d)"
,
event
.
resize
.
w
case
SDL_KEYDOWN
:
/* if a key is pressed */
,
event
.
resize
.
h
);
i_key
=
event
.
key
.
keysym
.
sym
;
/* forward it */
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
switch
(
i_key
)
{
p_intf
->
p_vout
->
i_width
=
event
.
resize
.
w
;
/* switch to fullscreen */
p_intf
->
p_vout
->
i_height
=
event
.
resize
.
h
;
case
SDLK_f
:
p_intf
->
p_vout
->
i_changes
|=
VOUT_SIZE_CHANGE
;
intf_SDL_Fullscreen
(
p_intf
);
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
break
;
break
;
case
SDLK_y
:
intf_SDL_YUVSwitch
(
p_intf
);
break
;
default
:
if
(
intf_ProcessKey
(
p_intf
,
(
char
)
i_key
)
)
{
intf_DbgMsg
(
"unhandled key '%c' (%i)"
,
(
char
)
i_key
,
i_key
);
}
break
;
}
break
;
case
SDL_MOUSEBUTTONDOWN
:
case
SDL_KEYDOWN
:
/* if a key is pressed */
if
(
event
.
button
.
button
==
SDL_BUTTON_MIDDLE
)
i_key
=
event
.
key
.
keysym
.
sym
;
{
intf_SDL_Hidecursor
(
p_intf
);
switch
(
i_key
)
}
{
case
SDLK_f
:
/* switch to fullscreen */
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
i_changes
|=
VOUT_FULLSCREEN_CHANGE
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
break
;
break
;
case
SDL_QUIT
:
case
SDLK_y
:
/* switch to hard YUV */
intf_ProcessKey
(
p_intf
,
SDLK_q
);
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
break
;
p_intf
->
p_vout
->
i_changes
|=
VOUT_YUV_CHANGE
;
default:
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
break
;
default:
if
(
intf_ProcessKey
(
p_intf
,
(
char
)
i_key
)
)
{
intf_DbgMsg
(
"unhandled key '%c' (%i)"
,
(
char
)
i_key
,
i_key
);
}
break
;
break
;
}
break
;
case
SDL_MOUSEBUTTONDOWN
:
if
(
event
.
button
.
button
==
SDL_BUTTON_MIDDLE
)
{
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
i_changes
|=
VOUT_CURSOR_CHANGE
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
break
;
case
SDL_QUIT
:
intf_ProcessKey
(
p_intf
,
SDLK_q
);
break
;
default:
break
;
}
}
}
}
}
}
void
intf_SDL_Resize
(
intf_thread_t
*
p_intf
,
int
width
,
int
height
)
{
intf_Msg
(
"intf: video display resized (%dx%d)"
,
width
,
height
);
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
p_sys
->
i_width
=
width
;
p_intf
->
p_vout
->
p_sys
->
i_height
=
height
;
p_intf
->
p_vout
->
p_sys
->
b_reopen_display
=
1
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
void
intf_SDL_YUVSwitch
(
intf_thread_t
*
p_intf
)
{
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
b_need_render
=
1
-
p_intf
->
p_vout
->
b_need_render
;
p_intf
->
p_vout
->
p_sys
->
b_reopen_display
=
1
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
void
intf_SDL_Fullscreen
(
intf_thread_t
*
p_intf
)
{
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
p_sys
->
b_fullscreen
=
1
-
p_intf
->
p_vout
->
p_sys
->
b_fullscreen
;
p_intf
->
p_vout
->
p_sys
->
b_toggle_fullscreen
=
1
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
void
intf_SDL_Hidecursor
(
intf_thread_t
*
p_intf
)
{
vlc_mutex_lock
(
&
p_intf
->
p_vout
->
change_lock
);
p_intf
->
p_vout
->
p_sys
->
b_cursor
=
1
-
p_intf
->
p_vout
->
p_sys
->
b_cursor
;
p_intf
->
p_vout
->
p_sys
->
b_hide_cursor
=
1
;
vlc_mutex_unlock
(
&
p_intf
->
p_vout
->
change_lock
);
}
void
intf_SDL_Keymap
(
intf_thread_t
*
p_intf
)
void
intf_SDL_Keymap
(
intf_thread_t
*
p_intf
)
{
{
/* p_intf->p_intf_getKey = intf_getKey; */
/* p_intf->p_intf_getKey = intf_getKey; */
...
@@ -242,4 +198,3 @@ void intf_SDL_Keymap(intf_thread_t * p_intf )
...
@@ -242,4 +198,3 @@ void intf_SDL_Keymap(intf_thread_t * p_intf )
intf_AssignKey
(
p_intf
,
SDLK_s
,
INTF_KEY_TOGGLE_SCALING
,
0
);
intf_AssignKey
(
p_intf
,
SDLK_s
,
INTF_KEY_TOGGLE_SCALING
,
0
);
}
}
plugins/sdl/vout_sdl.c
View file @
5f6c5900
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
* This structure is part of the video output thread descriptor.
* This structure is part of the video output thread descriptor.
* It describes the SDL specific properties of an output thread.
* It describes the SDL specific properties of an output thread.
*****************************************************************************/
*****************************************************************************/
/* FIXME: SOME CLUELESS MORON DEFINED THIS STRUCTURE IN INTF_SDL.C AS WELL */
/* FIXME: SOME CLUELESS MORON DEFINED THIS STRUCTURE IN INTF_SDL.C AS WELL
*/
typedef
struct
vout_sys_s
typedef
struct
vout_sys_s
{
{
int
i_width
;
int
i_width
;
...
@@ -60,8 +60,6 @@ typedef struct vout_sys_s
...
@@ -60,8 +60,6 @@ typedef struct vout_sys_s
boolean_t
b_overlay
;
boolean_t
b_overlay
;
boolean_t
b_cursor
;
boolean_t
b_cursor
;
boolean_t
b_reopen_display
;
boolean_t
b_reopen_display
;
boolean_t
b_toggle_fullscreen
;
boolean_t
b_hide_cursor
;
Uint8
*
p_buffer
[
2
];
Uint8
*
p_buffer
[
2
];
/* Buffers informations */
/* Buffers informations */
}
vout_sys_t
;
}
vout_sys_t
;
...
@@ -72,7 +70,7 @@ typedef struct vout_sys_s
...
@@ -72,7 +70,7 @@ typedef struct vout_sys_s
static
int
SDLOpenDisplay
(
vout_thread_t
*
p_vout
);
static
int
SDLOpenDisplay
(
vout_thread_t
*
p_vout
);
static
void
SDLCloseDisplay
(
vout_thread_t
*
p_vout
);
static
void
SDLCloseDisplay
(
vout_thread_t
*
p_vout
);
static
void
SDLToggleFullScreen
(
vout_thread_t
*
p_vout
);
static
void
SDLToggleFullScreen
(
vout_thread_t
*
p_vout
);
static
void
SDL
HideCursor
(
vout_thread_t
*
p_vout
);
static
void
SDL
TogglePointer
(
vout_thread_t
*
p_vout
);
/*****************************************************************************
/*****************************************************************************
* vout_SDLCreate: allocate SDL video thread output method
* vout_SDLCreate: allocate SDL video thread output method
*****************************************************************************
*****************************************************************************
...
@@ -124,11 +122,10 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
...
@@ -124,11 +122,10 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
{
{
intf_ErrMsg
(
"error: can't initialize SDL library: %s"
,
intf_ErrMsg
(
"error: can't initialize SDL library: %s"
,
SDL_GetError
()
);
SDL_GetError
()
);
free
(
p_vout
->
p_sys
);
return
(
1
);
return
(
1
);
}
}
p_vout
->
p_sys
->
b_toggle_fullscreen
=
0
;
p_vout
->
p_sys
->
b_hide_cursor
=
0
;
return
(
0
);
return
(
0
);
}
}
...
@@ -171,28 +168,61 @@ void vout_SDLDestroy( vout_thread_t *p_vout )
...
@@ -171,28 +168,61 @@ void vout_SDLDestroy( vout_thread_t *p_vout )
*****************************************************************************/
*****************************************************************************/
int
vout_SDLManage
(
vout_thread_t
*
p_vout
)
int
vout_SDLManage
(
vout_thread_t
*
p_vout
)
{
{
/* If the display has to be reopened we do so */
if
(
p_vout
->
p_sys
->
b_reopen_display
)
/*
* Size Change
*/
if
(
p_vout
->
i_changes
&
VOUT_SIZE_CHANGE
)
{
{
SDLCloseDisplay
(
p_vout
);
p_vout
->
p_sys
->
i_width
=
p_vout
->
i_width
;
p_vout
->
p_sys
->
i_height
=
p_vout
->
i_height
;
if
(
SDLOpenDisplay
(
p_vout
)
)
/* Need to reopen display */
SDLCloseDisplay
(
p_vout
);
if
(
SDLOpenDisplay
(
p_vout
)
)
{
{
intf_ErrMsg
(
"error: can't open DISPLAY default display"
);
intf_ErrMsg
(
"error: can't open DISPLAY default display"
);
return
(
1
);
return
(
1
);
}
}
p_vout
->
i_changes
&=
~
VOUT_SIZE_CHANGE
;
}
}
/* if fullscreen has to be toggled we do so */
/*
if
(
p_vout
->
p_sys
->
b_toggle_fullscreen
)
* YUV Change
*/
if
(
p_vout
->
i_changes
&
VOUT_YUV_CHANGE
)
{
p_vout
->
b_need_render
=
1
-
p_vout
->
b_need_render
;
/* Need to reopen display */
SDLCloseDisplay
(
p_vout
);
if
(
SDLOpenDisplay
(
p_vout
)
)
{
intf_ErrMsg
(
"error: can't open DISPLAY default display"
);
return
(
1
);
}
p_vout
->
i_changes
&=
~
VOUT_YUV_CHANGE
;
}
/*
* Fullscreen change
*/
if
(
p_vout
->
i_changes
&
VOUT_FULLSCREEN_CHANGE
)
{
{
SDLToggleFullScreen
(
p_vout
);
p_vout
->
p_sys
->
b_fullscreen
=
1
-
p_vout
->
p_sys
->
b_fullscreen
;
SDLToggleFullScreen
(
p_vout
);
p_vout
->
i_changes
&=
~
VOUT_FULLSCREEN_CHANGE
;
}
}
/* if pointer has to be hidden/shown we do so */
if
(
p_vout
->
p_sys
->
b_hide_cursor
)
/*
* Pointer change
*/
if
(
p_vout
->
i_changes
&
VOUT_CURSOR_CHANGE
)
{
{
SDLHideCursor
(
p_vout
);
p_vout
->
p_sys
->
b_cursor
=
1
-
p_vout
->
p_sys
->
b_cursor
;
SDLTogglePointer
(
p_vout
);
}
}
return
(
0
);
return
(
0
);
...
@@ -205,7 +235,8 @@ int vout_SDLManage( vout_thread_t *p_vout )
...
@@ -205,7 +235,8 @@ int vout_SDLManage( vout_thread_t *p_vout )
* anything, but could later send information on which colors it was unable
* anything, but could later send information on which colors it was unable
* to set.
* to set.
*****************************************************************************/
*****************************************************************************/
void
vout_SDLSetPalette
(
p_vout_thread_t
p_vout
,
u16
*
red
,
u16
*
green
,
u16
*
blue
,
u16
*
transp
)
void
vout_SDLSetPalette
(
p_vout_thread_t
p_vout
,
u16
*
red
,
u16
*
green
,
u16
*
blue
,
u16
*
transp
)
{
{
/* Create a display surface with a grayscale palette */
/* Create a display surface with a grayscale palette */
SDL_Color
colors
[
256
];
SDL_Color
colors
[
256
];
...
@@ -401,8 +432,6 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
...
@@ -401,8 +432,6 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
p_vout
->
p_sys
->
p_buffer
[
1
]
);
p_vout
->
p_sys
->
p_buffer
[
1
]
);
}
}
p_vout
->
i_changes
|=
VOUT_YUV_CHANGE
;
p_vout
->
p_sys
->
b_reopen_display
=
0
;
p_vout
->
p_sys
->
b_reopen_display
=
0
;
return
(
0
);
return
(
0
);
...
@@ -449,16 +478,15 @@ static void SDLToggleFullScreen( vout_thread_t *p_vout )
...
@@ -449,16 +478,15 @@ static void SDLToggleFullScreen( vout_thread_t *p_vout )
p_vout
->
p_sys
->
b_cursor
=
0
;
p_vout
->
p_sys
->
b_cursor
=
0
;
}
}
p_vout
->
p_sys
->
b_toggle_fullscreen
=
0
;
SDLTogglePointer
(
p_vout
);
SDLHideCursor
(
p_vout
);
}
}
/*****************************************************************************
/*****************************************************************************
* SDL
HideCurso
r: Hide/Show mouse pointer
* SDL
TogglePointe
r: Hide/Show mouse pointer
*****************************************************************************
*****************************************************************************
* This function hides/shows the mouse pointer inside the main window.
* This function hides/shows the mouse pointer inside the main window.
*****************************************************************************/
*****************************************************************************/
static
void
SDL
HideCurso
r
(
vout_thread_t
*
p_vout
)
static
void
SDL
TogglePointe
r
(
vout_thread_t
*
p_vout
)
{
{
if
(
p_vout
->
p_sys
->
b_cursor
==
1
)
if
(
p_vout
->
p_sys
->
b_cursor
==
1
)
{
{
...
@@ -468,5 +496,4 @@ static void SDLHideCursor( vout_thread_t *p_vout )
...
@@ -468,5 +496,4 @@ static void SDLHideCursor( vout_thread_t *p_vout )
{
{
SDL_ShowCursor
(
1
);
SDL_ShowCursor
(
1
);
}
}
p_vout
->
p_sys
->
b_hide_cursor
=
0
;
}
}
src/video_output/video_output.c
View file @
5f6c5900
...
@@ -2068,9 +2068,10 @@ static int Manage( vout_thread_t *p_vout )
...
@@ -2068,9 +2068,10 @@ static int Manage( vout_thread_t *p_vout )
/* Clear changes flags which does not need management or have been
/* Clear changes flags which does not need management or have been
* handled */
* handled */
p_vout
->
i_changes
&=
~
(
VOUT_GAMMA_CHANGE
|
VOUT_GRAYSCALE_CHANGE
|
p_vout
->
i_changes
&=
~
(
VOUT_GAMMA_CHANGE
|
VOUT_GRAYSCALE_CHANGE
|
VOUT_YUV_CHANGE
|
VOUT_INFO_CHANGE
|
VOUT_YUV_CHANGE
|
VOUT_INFO_CHANGE
|
VOUT_INTF_CHANGE
|
VOUT_SCALE_CHANGE
);
VOUT_INTF_CHANGE
|
VOUT_SCALE_CHANGE
|
VOUT_CURSOR_CHANGE
|
VOUT_FULLSCREEN_CHANGE
);
/* Detect unauthorized changes */
/* Detect unauthorized changes */
if
(
p_vout
->
i_changes
)
if
(
p_vout
->
i_changes
)
...
...
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