Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
32639eac
Commit
32639eac
authored
Dec 08, 2003
by
Yoann Peronneau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improves OSD sytem
The last OSD message is now deleted before printing new one.
parent
b4160df3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
26 deletions
+41
-26
include/osd.h
include/osd.h
+2
-2
include/video_output.h
include/video_output.h
+4
-2
modules/misc/dummy/renderer.c
modules/misc/dummy/renderer.c
+3
-3
modules/misc/freetype.c
modules/misc/freetype.c
+8
-8
src/video_output/video_text.c
src/video_output/video_text.c
+18
-10
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+6
-1
No files found.
include/osd.h
View file @
32639eac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* osd.h : Constants for use with osd modules
* osd.h : Constants for use with osd modules
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: osd.h,v 1.
5 2003/10/30 22:34:48 hartma
n Exp $
* $Id: osd.h,v 1.
6 2003/12/08 17:48:13 yoan
n Exp $
*
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*
...
@@ -45,6 +45,6 @@ struct text_style_t
...
@@ -45,6 +45,6 @@ struct text_style_t
};
};
static
const
text_style_t
default_text_style
=
{
22
,
0xffffff
,
VLC_FALSE
,
VLC_FALSE
,
VLC_FALSE
};
static
const
text_style_t
default_text_style
=
{
22
,
0xffffff
,
VLC_FALSE
,
VLC_FALSE
,
VLC_FALSE
};
VLC_EXPORT
(
void
,
vout_ShowTextRelative
,
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
)
);
VLC_EXPORT
(
subpicture_t
*
,
vout_ShowTextRelative
,
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
)
);
VLC_EXPORT
(
void
,
vout_ShowTextAbsolute
,
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
)
);
VLC_EXPORT
(
void
,
vout_ShowTextAbsolute
,
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
)
);
VLC_EXPORT
(
void
,
vout_OSDMessage
,
(
vlc_object_t
*
,
char
*
)
);
VLC_EXPORT
(
void
,
vout_OSDMessage
,
(
vlc_object_t
*
,
char
*
)
);
include/video_output.h
View file @
32639eac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* video_output.h : video output thread
* video_output.h : video output thread
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.10
4 2003/12/07 19:09:37 jpsama
n Exp $
* $Id: video_output.h,v 1.10
5 2003/12/08 17:48:13 yoan
n Exp $
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
...
@@ -122,6 +122,8 @@ struct vout_thread_t
...
@@ -122,6 +122,8 @@ struct vout_thread_t
picture_t
p_picture
[
2
*
VOUT_MAX_PICTURES
];
/**< pictures */
picture_t
p_picture
[
2
*
VOUT_MAX_PICTURES
];
/**< pictures */
subpicture_t
p_subpicture
[
VOUT_MAX_PICTURES
];
/**< subpictures */
subpicture_t
p_subpicture
[
VOUT_MAX_PICTURES
];
/**< subpictures */
subpicture_t
*
last_osd_message
;
/* Statistics */
/* Statistics */
count_t
c_loops
;
count_t
c_loops
;
count_t
c_pictures
,
c_late_pictures
;
count_t
c_pictures
,
c_late_pictures
;
...
@@ -141,7 +143,7 @@ struct vout_thread_t
...
@@ -141,7 +143,7 @@ struct vout_thread_t
the text renderer */
the text renderer */
module_t
*
p_text_renderer_module
;
/**< text renderer module */
module_t
*
p_text_renderer_module
;
/**< text renderer module */
/** callback used when a new string needs to be shown on the vout */
/** callback used when a new string needs to be shown on the vout */
int
(
*
pf_add_string
)
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
subpicture_t
*
(
*
pf_add_string
)
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
);
int
,
int
,
mtime_t
,
mtime_t
);
};
};
...
...
modules/misc/dummy/renderer.c
View file @
32639eac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* renderer.c : dummy text rendering functions
* renderer.c : dummy text rendering functions
*****************************************************************************
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* Copyright (C) 2000, 2001 VideoLAN
* $Id: renderer.c,v 1.
3 2003/12/07 19:09:37 jpsama
n Exp $
* $Id: renderer.c,v 1.
4 2003/12/08 17:48:13 yoan
n Exp $
*
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/vout.h>
static
int
AddText
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
static
subpicture_t
*
AddText
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
);
int
,
int
,
mtime_t
,
mtime_t
);
int
E_
(
OpenRenderer
)(
vlc_object_t
*
p_this
)
int
E_
(
OpenRenderer
)(
vlc_object_t
*
p_this
)
...
@@ -34,7 +34,7 @@ int E_(OpenRenderer)( vlc_object_t *p_this )
...
@@ -34,7 +34,7 @@ int E_(OpenRenderer)( vlc_object_t *p_this )
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
static
int
AddText
(
vout_thread_t
*
p_vout
,
char
*
psz_string
,
static
subpicture_t
*
AddText
(
vout_thread_t
*
p_vout
,
char
*
psz_string
,
text_style_t
*
p_style
,
int
i_flags
,
int
i_x_margin
,
text_style_t
*
p_style
,
int
i_flags
,
int
i_x_margin
,
int
i_y_margin
,
mtime_t
i_start
,
mtime_t
i_stop
)
int
i_y_margin
,
mtime_t
i_start
,
mtime_t
i_stop
)
{
{
...
...
modules/misc/freetype.c
View file @
32639eac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* freetype.c : Put text on the video, using freetype2
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
* Copyright (C) 2002, 2003 VideoLAN
* $Id: freetype.c,v 1.3
7 2003/12/07 19:00:33 jpsama
n Exp $
* $Id: freetype.c,v 1.3
8 2003/12/08 17:48:13 yoan
n Exp $
*
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*
...
@@ -77,8 +77,8 @@ static void RenderYUY2( vout_thread_t *, picture_t *,
...
@@ -77,8 +77,8 @@ static void RenderYUY2( vout_thread_t *, picture_t *,
const
subpicture_t
*
);
const
subpicture_t
*
);
static
void
RenderRV32
(
vout_thread_t
*
,
picture_t
*
,
static
void
RenderRV32
(
vout_thread_t
*
,
picture_t
*
,
const
subpicture_t
*
);
const
subpicture_t
*
);
static
int
AddText
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
static
subpicture_t
*
AddText
(
vout_thread_t
*
,
char
*
,
text_style_t
*
,
int
,
int
,
int
,
mtime_t
,
mtime_t
);
int
,
int
,
mtime_t
,
mtime_t
);
static
void
FreeString
(
subpicture_t
*
);
static
void
FreeString
(
subpicture_t
*
);
...
@@ -634,7 +634,7 @@ static void RenderRV32( vout_thread_t *p_vout, picture_t *p_pic,
...
@@ -634,7 +634,7 @@ static void RenderRV32( vout_thread_t *p_vout, picture_t *p_pic,
* needed glyphs into memory. It is used as pf_add_string callback in
* needed glyphs into memory. It is used as pf_add_string callback in
* the vout method by this module
* the vout method by this module
*/
*/
static
int
AddText
(
vout_thread_t
*
p_vout
,
char
*
psz_string
,
static
subpicture_t
*
AddText
(
vout_thread_t
*
p_vout
,
char
*
psz_string
,
text_style_t
*
p_style
,
int
i_flags
,
int
i_hmargin
,
text_style_t
*
p_style
,
int
i_flags
,
int
i_hmargin
,
int
i_vmargin
,
mtime_t
i_start
,
mtime_t
i_stop
)
int
i_vmargin
,
mtime_t
i_start
,
mtime_t
i_stop
)
{
{
...
@@ -654,7 +654,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
...
@@ -654,7 +654,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
/* Sanity check */
/* Sanity check */
if
(
!
psz_string
||
!*
psz_string
)
if
(
!
psz_string
||
!*
psz_string
)
{
{
return
VLC_EGENERIC
;
return
NULL
;
}
}
result
.
x
=
0
;
result
.
x
=
0
;
...
@@ -672,7 +672,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
...
@@ -672,7 +672,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
p_subpic
=
vout_CreateSubPicture
(
p_vout
,
MEMORY_SUBPICTURE
);
p_subpic
=
vout_CreateSubPicture
(
p_vout
,
MEMORY_SUBPICTURE
);
if
(
p_subpic
==
NULL
)
if
(
p_subpic
==
NULL
)
{
{
return
VLC_EGENERIC
;
return
NULL
;
}
}
p_subpic
->
p_sys
=
0
;
p_subpic
->
p_sys
=
0
;
p_subpic
->
pf_render
=
Render
;
p_subpic
->
pf_render
=
Render
;
...
@@ -851,7 +851,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
...
@@ -851,7 +851,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
p_string
->
i_height
=
result
.
y
;
p_string
->
i_height
=
result
.
y
;
p_string
->
i_width
=
result
.
x
;
p_string
->
i_width
=
result
.
x
;
vout_DisplaySubPicture
(
p_vout
,
p_subpic
);
vout_DisplaySubPicture
(
p_vout
,
p_subpic
);
return
VLC_SUCCESS
;
return
p_subpic
;
#undef face
#undef face
#undef glyph
#undef glyph
...
@@ -859,7 +859,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
...
@@ -859,7 +859,7 @@ static int AddText ( vout_thread_t *p_vout, char *psz_string,
error:
error:
FreeString
(
p_subpic
);
FreeString
(
p_subpic
);
vout_DestroySubPicture
(
p_vout
,
p_subpic
);
vout_DestroySubPicture
(
p_vout
,
p_subpic
);
return
VLC_EGENERIC
;
return
NULL
;
}
}
static
void
FreeString
(
subpicture_t
*
p_subpic
)
static
void
FreeString
(
subpicture_t
*
p_subpic
)
...
...
src/video_output/video_text.c
View file @
32639eac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* video_text.c : text manipulation functions
* video_text.c : text manipulation functions
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: video_text.c,v 1.4
6 2003/10/30 22:34:48 hartma
n Exp $
* $Id: video_text.c,v 1.4
7 2003/12/08 17:48:13 yoan
n Exp $
*
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*
...
@@ -33,21 +33,25 @@
...
@@ -33,21 +33,25 @@
* \param i_vmargin vertical margin in pixels
* \param i_vmargin vertical margin in pixels
* \param i_duration Amount of time the text is to be shown.
* \param i_duration Amount of time the text is to be shown.
*/
*/
void
vout_ShowTextRelative
(
vout_thread_t
*
p_vout
,
char
*
psz_string
,
subpicture_t
*
vout_ShowTextRelative
(
vout_thread_t
*
p_vout
,
char
*
psz_string
,
text_style_t
*
p_style
,
int
i_flags
,
text_style_t
*
p_style
,
int
i_flags
,
int
i_hmargin
,
int
i_vmargin
,
int
i_hmargin
,
int
i_vmargin
,
mtime_t
i_duration
)
mtime_t
i_duration
)
{
{
subpicture_t
*
p_subpic
=
NULL
;
mtime_t
i_now
=
mdate
();
mtime_t
i_now
=
mdate
();
if
(
p_vout
->
pf_add_string
)
if
(
p_vout
->
pf_add_string
)
{
{
p_vout
->
pf_add_string
(
p_vout
,
psz_string
,
p_style
,
i_flags
,
i_hmargin
,
p_subpic
=
p_vout
->
pf_add_string
(
p_vout
,
psz_string
,
p_style
,
i_flags
,
i_vmargin
,
i_now
,
i_now
+
i_duration
);
i_hmargin
,
i_vmargin
,
i_now
,
i_now
+
i_duration
);
}
}
else
else
{
{
msg_Warn
(
p_vout
,
"No text renderer found"
);
msg_Warn
(
p_vout
,
"No text renderer found"
);
}
}
return
p_subpic
;
}
}
/**
/**
...
@@ -70,12 +74,12 @@ void vout_ShowTextAbsolute( vout_thread_t *p_vout, char *psz_string,
...
@@ -70,12 +74,12 @@ void vout_ShowTextAbsolute( vout_thread_t *p_vout, char *psz_string,
{
{
if
(
p_vout
->
pf_add_string
)
if
(
p_vout
->
pf_add_string
)
{
{
p_vout
->
pf_add_string
(
p_vout
,
psz_string
,
p_style
,
i_flags
,
i_hmargin
,
p_vout
->
pf_add_string
(
p_vout
,
psz_string
,
p_style
,
i_flags
,
i_hmargin
,
i_vmargin
,
i_start
,
i_stop
);
i_vmargin
,
i_start
,
i_stop
);
}
}
else
else
{
{
msg_Warn
(
p_vout
,
"No text renderer found"
);
msg_Warn
(
p_vout
,
"No text renderer found"
);
}
}
}
}
...
@@ -96,9 +100,13 @@ void vout_OSDMessage( vlc_object_t *p_caller, char *psz_string )
...
@@ -96,9 +100,13 @@ void vout_OSDMessage( vlc_object_t *p_caller, char *psz_string )
if
(
p_vout
)
if
(
p_vout
)
{
{
vout_ShowTextRelative
(
p_vout
,
psz_string
,
NULL
,
if
(
p_vout
->
last_osd_message
)
OSD_ALIGN_TOP
|
OSD_ALIGN_RIGHT
,
{
30
,
20
,
1000000
);
vout_DestroySubPicture
(
p_vout
,
p_vout
->
last_osd_message
);
p_vout
->
last_osd_message
=
NULL
;
}
p_vout
->
last_osd_message
=
vout_ShowTextRelative
(
p_vout
,
psz_string
,
NULL
,
OSD_ALIGN_TOP
|
OSD_ALIGN_RIGHT
,
30
,
20
,
1000000
);
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
}
}
}
...
...
src/video_output/vout_subpictures.c
View file @
32639eac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* vout_subpictures.c : subpicture management functions
* vout_subpictures.c : subpicture management functions
*****************************************************************************
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* Copyright (C) 2000 VideoLAN
* $Id: vout_subpictures.c,v 1.2
1 2003/07/15 18:12:05 sigmunau
Exp $
* $Id: vout_subpictures.c,v 1.2
2 2003/12/08 17:48:13 yoann
Exp $
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -163,6 +163,11 @@ void vout_DestroySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
...
@@ -163,6 +163,11 @@ void vout_DestroySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
p_subpic
->
pf_destroy
(
p_subpic
);
p_subpic
->
pf_destroy
(
p_subpic
);
}
}
if
(
p_subpic
==
p_vout
->
last_osd_message
)
{
p_vout
->
last_osd_message
=
NULL
;
}
p_subpic
->
i_status
=
FREE_SUBPICTURE
;
p_subpic
->
i_status
=
FREE_SUBPICTURE
;
vlc_mutex_unlock
(
&
p_vout
->
subpicture_lock
);
vlc_mutex_unlock
(
&
p_vout
->
subpicture_lock
);
...
...
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