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
5a6ee796
Commit
5a6ee796
authored
May 18, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved "sub-filter" from spu_t to vout_thread_t.
parent
ef785d7a
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
64 additions
and
97 deletions
+64
-97
bindings/mediacontrol/mediacontrol_audio_video.c
bindings/mediacontrol/mediacontrol_audio_video.c
+3
-4
include/vlc_spu.h
include/vlc_spu.h
+5
-1
include/vlc_vout.h
include/vlc_vout.h
+0
-9
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+1
-4
modules/stream_out/transcode/osd.c
modules/stream_out/transcode/osd.c
+0
-6
modules/stream_out/transcode/spu.c
modules/stream_out/transcode/spu.c
+0
-3
modules/stream_out/transcode/transcode.c
modules/stream_out/transcode/transcode.c
+5
-12
src/libvlccore.sym
src/libvlccore.sym
+1
-2
src/video_output/control.c
src/video_output/control.c
+1
-0
src/video_output/control.h
src/video_output/control.h
+1
-0
src/video_output/video_output.c
src/video_output/video_output.c
+13
-8
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+1
-0
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+21
-12
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+12
-36
No files found.
bindings/mediacontrol/mediacontrol_audio_video.c
View file @
5a6ee796
...
...
@@ -114,10 +114,9 @@ int mediacontrol_showtext( vout_thread_t *p_vout, int i_channel,
int
i_flags
,
int
i_hmargin
,
int
i_vmargin
,
mtime_t
i_start
,
mtime_t
i_stop
)
{
return
osd_ShowTextAbsolute
(
vout_GetSpu
(
p_vout
),
i_channel
,
psz_string
,
p_style
,
i_flags
,
i_hmargin
,
i_vmargin
,
i_start
,
i_stop
);
(
void
)
p_style
;
(
void
)
i_hmargin
;
(
void
)
i_vmargin
;
vout_OSDText
(
p_vout
,
i_channel
,
i_flags
&
~
SUBPICTURE_ALIGN_MASK
,
i_stop
-
i_start
,
psz_string
);
}
...
...
include/vlc_spu.h
View file @
5a6ee796
...
...
@@ -60,7 +60,6 @@ struct spu_t
VLC_EXPORT
(
spu_t
*
,
spu_Create
,
(
vlc_object_t
*
)
);
#define spu_Create(a) spu_Create(VLC_OBJECT(a))
VLC_EXPORT
(
int
,
spu_Init
,
(
spu_t
*
)
);
VLC_EXPORT
(
void
,
spu_Destroy
,
(
spu_t
*
)
);
void
spu_Attach
(
spu_t
*
,
vlc_object_t
*
,
bool
);
...
...
@@ -97,6 +96,11 @@ VLC_EXPORT( int, spu_RegisterChannel, ( spu_t * ) );
*/
VLC_EXPORT
(
void
,
spu_ClearChannel
,
(
spu_t
*
,
int
)
);
/**
* It changes the sub filters list
*/
VLC_EXPORT
(
void
,
spu_ChangeFilters
,
(
spu_t
*
,
const
char
*
)
);
/** @}*/
#ifdef __cplusplus
...
...
include/vlc_vout.h
View file @
5a6ee796
...
...
@@ -168,15 +168,6 @@ VLC_EXPORT( void, vout_PutSubpicture, ( vout_thread_t *, subpicture_
VLC_EXPORT
(
int
,
vout_RegisterSubpictureChannel
,
(
vout_thread_t
*
)
);
VLC_EXPORT
(
void
,
vout_FlushSubpictureChannel
,
(
vout_thread_t
*
,
int
)
);
/**
* Return the spu_t object associated to a vout_thread_t.
*
* The return object is valid only as long as the vout is. You must not
* release the spu_t object returned.
* It cannot return NULL so no need to check.
*/
VLC_EXPORT
(
spu_t
*
,
vout_GetSpu
,
(
vout_thread_t
*
)
);
VLC_EXPORT
(
void
,
vout_EnableFilter
,
(
vout_thread_t
*
,
const
char
*
,
bool
,
bool
)
);
/**@}*/
...
...
modules/gui/qt4/components/extended_panels.cpp
View file @
5a6ee796
...
...
@@ -370,10 +370,7 @@ void ExtVideo::ChangeVFiltersString( const char *psz_name, bool b_add )
p_vout
=
THEMIM
->
getVout
();
if
(
p_vout
)
{
if
(
!
strcmp
(
psz_filter_type
,
"sub-filter"
)
)
var_SetString
(
vout_GetSpu
(
p_vout
),
psz_filter_type
,
psz_string
);
else
var_SetString
(
p_vout
,
psz_filter_type
,
psz_string
);
var_SetString
(
p_vout
,
psz_filter_type
,
psz_string
);
vlc_object_release
(
p_vout
);
}
...
...
modules/stream_out/transcode/osd.c
View file @
5a6ee796
...
...
@@ -84,10 +84,7 @@ int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_t *id )
}
if
(
!
p_sys
->
p_spu
)
{
p_sys
->
p_spu
=
spu_Create
(
p_stream
);
spu_Init
(
p_sys
->
p_spu
);
}
return
VLC_SUCCESS
;
...
...
@@ -127,10 +124,7 @@ int transcode_osd_process( sout_stream_t *p_stream, sout_stream_id_t *id,
{
msg_Warn
(
p_stream
,
"spu channel not initialized, doing it now"
);
if
(
!
p_sys
->
p_spu
)
{
p_sys
->
p_spu
=
spu_Create
(
p_stream
);
spu_Init
(
p_sys
->
p_spu
);
}
}
if
(
p_subpic
)
...
...
modules/stream_out/transcode/spu.c
View file @
5a6ee796
...
...
@@ -91,10 +91,7 @@ int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_t *id )
}
if
(
!
p_sys
->
p_spu
)
{
p_sys
->
p_spu
=
spu_Create
(
p_stream
);
spu_Init
(
p_sys
->
p_spu
);
}
return
VLC_SUCCESS
;
}
...
...
modules/stream_out/transcode/transcode.c
View file @
5a6ee796
...
...
@@ -450,9 +450,8 @@ static int Open( vlc_object_t *p_this )
if
(
val
.
psz_string
&&
*
val
.
psz_string
)
{
p_sys
->
p_spu
=
spu_Create
(
p_stream
);
var_Create
(
p_sys
->
p_spu
,
"sub-filter"
,
VLC_VAR_STRING
);
var_Set
(
p_sys
->
p_spu
,
"sub-filter"
,
val
);
spu_Init
(
p_sys
->
p_spu
);
if
(
p_sys
->
p_spu
)
spu_ChangeFilters
(
p_sys
->
p_spu
,
val
.
psz_string
);
}
free
(
val
.
psz_string
);
...
...
@@ -465,7 +464,6 @@ static int Open( vlc_object_t *p_this )
var_Get
(
p_stream
,
SOUT_CFG_PREFIX
"osd"
,
&
val
);
if
(
val
.
b_bool
)
{
vlc_value_t
osd_val
;
char
*
psz_next
;
psz_next
=
config_ChainCreate
(
&
p_sys
->
psz_osdenc
,
...
...
@@ -478,18 +476,13 @@ static int Open( vlc_object_t *p_this )
if
(
!
p_sys
->
p_spu
)
{
osd_val
.
psz_string
=
strdup
(
"osdmenu"
);
p_sys
->
p_spu
=
spu_Create
(
p_stream
);
var_Create
(
p_sys
->
p_spu
,
"sub-filter"
,
VLC_VAR_STRING
);
var_Set
(
p_sys
->
p_spu
,
"sub-filter"
,
osd_val
);
spu_Init
(
p_sys
->
p_spu
);
free
(
osd_val
.
psz_string
);
if
(
p_sys
->
p_spu
)
spu_ChangeFilters
(
p_sys
->
p_spu
,
"osdmenu"
);
}
else
{
osd_val
.
psz_string
=
strdup
(
"osdmenu"
);
var_Set
(
p_sys
->
p_spu
,
"sub-filter"
,
osd_val
);
free
(
osd_val
.
psz_string
);
spu_ChangeFilters
(
p_sys
->
p_spu
,
"osdmenu"
);
}
}
...
...
src/libvlccore.sym
View file @
5a6ee796
...
...
@@ -385,7 +385,7 @@ sout_UpdateStatistic
spu_Create
spu_Destroy
spu_DisplaySubpicture
spu_
Init
spu_
ChangeFilters
spu_RenderSubpictures
spu_SortSubpictures
spu_RegisterChannel
...
...
@@ -621,7 +621,6 @@ vout_RegisterSubpictureChannel
vout_FlushSubpictureChannel
vout_EnableFilter
vout_GetSnapshot
vout_GetSpu
vout_OSDIcon
vout_OSDMessage
vout_OSDEpg
...
...
src/video_output/control.c
View file @
5a6ee796
...
...
@@ -40,6 +40,7 @@ void vout_control_cmd_Clean(vout_control_cmd_t *cmd)
switch
(
cmd
->
type
)
{
case
VOUT_CONTROL_OSD_TITLE
:
case
VOUT_CONTROL_CHANGE_FILTERS
:
case
VOUT_CONTROL_CHANGE_SUB_FILTERS
:
free
(
cmd
->
u
.
string
);
break
;
default:
...
...
src/video_output/control.h
View file @
5a6ee796
...
...
@@ -41,6 +41,7 @@ enum {
#endif
VOUT_CONTROL_OSD_TITLE
,
/* string */
VOUT_CONTROL_CHANGE_FILTERS
,
/* string */
VOUT_CONTROL_CHANGE_SUB_FILTERS
,
/* string */
VOUT_CONTROL_PAUSE
,
VOUT_CONTROL_RESET
,
...
...
src/video_output/video_output.c
View file @
5a6ee796
...
...
@@ -177,9 +177,6 @@ vout_thread_t *(vout_Create)(vlc_object_t *object, const video_format_t *fmt)
/* Initialize subpicture unit */
vout
->
p
->
p_spu
=
spu_Create
(
vout
);
/* */
spu_Init
(
vout
->
p
->
p_spu
);
/* Take care of some "interface/control" related initialisations */
vout_IntfInit
(
vout
);
...
...
@@ -362,11 +359,6 @@ void vout_FlushSubpictureChannel( vout_thread_t *vout, int channel )
spu_ClearChannel
(
vout
->
p
->
p_spu
,
channel
);
}
spu_t
*
vout_GetSpu
(
vout_thread_t
*
vout
)
{
return
vout
->
p
->
p_spu
;
}
/* vout_Control* are usable by anyone at anytime */
void
vout_ControlChangeFullscreen
(
vout_thread_t
*
vout
,
bool
fullscreen
)
{
...
...
@@ -429,6 +421,11 @@ void vout_ControlChangeFilters(vout_thread_t *vout, const char *filters)
vout_control_PushString
(
&
vout
->
p
->
control
,
VOUT_CONTROL_CHANGE_FILTERS
,
filters
);
}
void
vout_ControlChangeSubFilters
(
vout_thread_t
*
vout
,
const
char
*
filters
)
{
vout_control_PushString
(
&
vout
->
p
->
control
,
VOUT_CONTROL_CHANGE_SUB_FILTERS
,
filters
);
}
/* */
static
picture_t
*
VoutVideoFilterNewPicture
(
filter_t
*
filter
)
...
...
@@ -689,6 +686,11 @@ static void ThreadChangeFilters(vout_thread_t *vout, const char *filters)
vlc_mutex_unlock
(
&
vout
->
p
->
vfilter_lock
);
}
static
void
ThreadChangeSubFilters
(
vout_thread_t
*
vout
,
const
char
*
filters
)
{
spu_ChangeFilters
(
vout
->
p
->
p_spu
,
filters
);
}
static
void
ThreadChangePause
(
vout_thread_t
*
vout
,
bool
is_paused
,
mtime_t
date
)
{
assert
(
!
vout
->
p
->
pause
.
is_on
||
!
is_paused
);
...
...
@@ -991,6 +993,9 @@ static void *Thread(void *object)
case
VOUT_CONTROL_CHANGE_FILTERS
:
ThreadChangeFilters
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_FILTERS
:
ThreadChangeSubFilters
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_PAUSE
:
ThreadChangePause
(
vout
,
cmd
.
u
.
pause
.
is_on
,
cmd
.
u
.
pause
.
date
);
break
;
...
...
src/video_output/vout_internal.h
View file @
5a6ee796
...
...
@@ -129,6 +129,7 @@ void vout_ControlChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
void
vout_ControlChangeCropWindow
(
vout_thread_t
*
,
int
x
,
int
y
,
int
width
,
int
height
);
void
vout_ControlChangeCropBorder
(
vout_thread_t
*
,
int
left
,
int
top
,
int
right
,
int
bottom
);
void
vout_ControlChangeFilters
(
vout_thread_t
*
,
const
char
*
);
void
vout_ControlChangeSubFilters
(
vout_thread_t
*
,
const
char
*
);
/* */
void
vout_IntfInit
(
vout_thread_t
*
);
...
...
src/video_output/vout_intf.c
View file @
5a6ee796
...
...
@@ -73,6 +73,8 @@ static int VideoFilterCallback( vlc_object_t *, char const *,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
VideoSplitterCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
SubFilterCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
TitleShowCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
...
...
@@ -369,6 +371,12 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Change
(
p_vout
,
"vout-filter"
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
var_AddCallback
(
p_vout
,
"vout-filter"
,
VideoSplitterCallback
,
NULL
);
/* Add a sub-filter variable */
var_Create
(
p_vout
,
"sub-filter"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_vout
,
"sub-filter"
,
SubFilterCallback
,
NULL
);
var_TriggerCallback
(
p_vout
,
"sub-filter"
);
/* Mouse coordinates */
var_Create
(
p_vout
,
"mouse-button-down"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"mouse-moved"
,
VLC_VAR_COORDS
);
...
...
@@ -571,10 +579,7 @@ void vout_EnableFilter( vout_thread_t *p_vout, const char *psz_name,
}
module_release
(
p_obj
);
if
(
!
strcmp
(
psz_filter_type
,
"sub-filter"
)
)
psz_string
=
var_GetString
(
vout_GetSpu
(
p_vout
),
psz_filter_type
);
else
psz_string
=
var_GetString
(
p_vout
,
psz_filter_type
);
psz_string
=
var_GetString
(
p_vout
,
psz_filter_type
);
/* Todo : Use some generic chain manipulation functions */
if
(
!
psz_string
)
psz_string
=
strdup
(
""
);
...
...
@@ -619,16 +624,10 @@ void vout_EnableFilter( vout_thread_t *p_vout, const char *psz_name,
if
(
b_setconfig
)
{
if
(
!
strcmp
(
psz_filter_type
,
"sub-filter"
)
)
config_PutPsz
(
vout_GetSpu
(
p_vout
),
psz_filter_type
,
psz_string
);
else
config_PutPsz
(
p_vout
,
psz_filter_type
,
psz_string
);
config_PutPsz
(
p_vout
,
psz_filter_type
,
psz_string
);
}
if
(
!
strcmp
(
psz_filter_type
,
"sub-filter"
)
)
var_SetString
(
vout_GetSpu
(
p_vout
),
psz_filter_type
,
psz_string
);
else
var_SetString
(
p_vout
,
psz_filter_type
,
psz_string
);
var_SetString
(
p_vout
,
psz_filter_type
,
psz_string
);
free
(
psz_string
);
}
...
...
@@ -781,6 +780,16 @@ static int VideoSplitterCallback( vlc_object_t *p_this, char const *psz_cmd,
return
VLC_SUCCESS
;
}
static
int
SubFilterCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_data
);
vout_ControlChangeSubFilters
(
p_vout
,
newval
.
psz_string
);
return
VLC_SUCCESS
;
}
static
int
TitleShowCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
...
...
src/video_output/vout_subpictures.c
View file @
5a6ee796
...
...
@@ -171,9 +171,6 @@ static picture_t *spu_new_video_buffer( filter_t * );
static
void
spu_del_video_buffer
(
filter_t
*
,
picture_t
*
);
/* Buffer aloccation fir SUB filter */
static
int
SubFilterCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
SubFilterAllocationInit
(
filter_t
*
,
void
*
);
static
void
SubFilterAllocationClean
(
filter_t
*
);
...
...
@@ -238,20 +235,6 @@ spu_t *spu_Create( vlc_object_t *p_this )
return
p_spu
;
}
/**
* Initialise the subpicture unit
*
* \param p_spu the subpicture unit object
*/
int
spu_Init
(
spu_t
*
p_spu
)
{
var_Create
(
p_spu
,
"sub-filter"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_AddCallback
(
p_spu
,
"sub-filter"
,
SubFilterCallback
,
p_spu
);
var_TriggerCallback
(
p_spu
,
"sub-filter"
);
return
VLC_SUCCESS
;
}
/**
* Destroy the subpicture unit
*
...
...
@@ -261,8 +244,6 @@ void spu_Destroy( spu_t *p_spu )
{
spu_private_t
*
p_sys
=
p_spu
->
p
;
var_DelCallback
(
p_spu
,
"sub-filter"
,
SubFilterCallback
,
p_spu
);
if
(
p_sys
->
p_blend
)
filter_DeleteBlend
(
p_sys
->
p_blend
);
...
...
@@ -744,6 +725,18 @@ void spu_ClearChannel( spu_t *p_spu, int i_channel )
vlc_mutex_unlock
(
&
p_sys
->
lock
);
}
void
spu_ChangeFilters
(
spu_t
*
p_spu
,
const
char
*
psz_filters
)
{
spu_private_t
*
p_sys
=
p_spu
->
p
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
free
(
p_sys
->
psz_chain_update
);
p_sys
->
psz_chain_update
=
strdup
(
psz_filters
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
}
/*****************************************************************************
* subpicture_t allocation
*****************************************************************************/
...
...
@@ -1917,20 +1910,3 @@ static void SubFilterAllocationClean( filter_t *p_filter )
free
(
p_filter
->
p_owner
);
}
static
int
SubFilterCallback
(
vlc_object_t
*
p_object
,
char
const
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
spu_t
*
p_spu
=
p_data
;
spu_private_t
*
p_sys
=
p_spu
->
p
;
VLC_UNUSED
(
p_object
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
psz_var
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
free
(
p_sys
->
psz_chain_update
);
p_sys
->
psz_chain_update
=
strdup
(
newval
.
psz_string
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
VLC_SUCCESS
;
}
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