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
8fce3d90
Commit
8fce3d90
authored
Sep 21, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed spu_Create/DestroySubpicture in favor of subpicture_*.
parent
90554602
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
73 deletions
+60
-73
include/vlc_osd.h
include/vlc_osd.h
+11
-3
include/vlc_vout.h
include/vlc_vout.h
+27
-12
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+5
-5
src/input/decoder.c
src/input/decoder.c
+3
-3
src/libvlccore.sym
src/libvlccore.sym
+3
-2
src/osd/osd_text.c
src/osd/osd_text.c
+2
-2
src/osd/osd_widgets.c
src/osd/osd_widgets.c
+3
-1
src/video_output/video_text.c
src/video_output/video_text.c
+2
-2
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+1
-1
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+3
-42
No files found.
include/vlc_osd.h
View file @
8fce3d90
...
...
@@ -99,11 +99,19 @@ VLC_EXPORT( int, spu_Init, ( spu_t * ) );
VLC_EXPORT
(
void
,
spu_Destroy
,
(
spu_t
*
)
);
void
spu_Attach
(
spu_t
*
,
vlc_object_t
*
,
bool
);
VLC_EXPORT
(
subpicture_t
*
,
spu_CreateSubpicture
,
(
spu_t
*
)
);
/* XXX you cannot call spu_DestroySubpicture on a displayed picture */
VLC_EXPORT
(
void
,
spu_DestroySubpicture
,
(
spu_t
*
,
subpicture_t
*
)
);
/**
* This function sends a subpicture to the spu_t core.
*
* You cannot use the provided subpicture anymore. The spu_t core
* will destroy it at its convenience.
*/
VLC_EXPORT
(
void
,
spu_DisplaySubpicture
,
(
spu_t
*
,
subpicture_t
*
)
);
/**
* This function asks the spu_t core a list of subpictures to display.
*
* The returned list can only be used by spu_RenderSubpictures.
*/
VLC_EXPORT
(
subpicture_t
*
,
spu_SortSubpictures
,
(
spu_t
*
,
mtime_t
display_date
,
bool
b_paused
,
bool
b_subtitle_only
)
);
/**
...
...
include/vlc_vout.h
View file @
8fce3d90
...
...
@@ -322,14 +322,23 @@ struct subpicture_region_t
subpicture_region_private_t
*
p_private
;
/**< Private data for spu_t *only* */
};
/* Subpicture region position flags */
#define SUBPICTURE_ALIGN_LEFT 0x1
#define SUBPICTURE_ALIGN_RIGHT 0x2
#define SUBPICTURE_ALIGN_TOP 0x4
#define SUBPICTURE_ALIGN_BOTTOM 0x8
#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \
SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM )
/**
* This function will create a new subpicture.
* You can must use subpicture_region_Delete to destroy it.
* This function will create a new subpicture region.
*
* You must use subpicture_region_Delete to destroy it.
*/
VLC_EXPORT
(
subpicture_region_t
*
,
subpicture_region_New
,
(
const
video_format_t
*
p_fmt
)
);
/**
* This function will destroy a subpicture allocated by
* This function will destroy a subpicture
region
allocated by
* subpicture_region_New.
*
* You may give it NULL.
...
...
@@ -337,7 +346,7 @@ VLC_EXPORT( subpicture_region_t *, subpicture_region_New, ( const video_format_t
VLC_EXPORT
(
void
,
subpicture_region_Delete
,
(
subpicture_region_t
*
p_region
)
);
/**
* This function will destroy a list of subpicture allocated by
* This function will destroy a list of subpicture
regions
allocated by
* subpicture_region_New.
*
* Provided for convenience.
...
...
@@ -404,17 +413,23 @@ struct subpicture_t
subpicture_sys_t
*
p_sys
;
/* subpicture data */
};
/**
* This function create a new empty subpicture.
*
* You must use subpicture_Delete to destroy it.
*/
VLC_EXPORT
(
subpicture_t
*
,
subpicture_New
,
(
void
)
);
/**
* This function delete a subpicture created by subpicture_New.
* You may give it NULL.
*/
VLC_EXPORT
(
void
,
subpicture_Delete
,
(
subpicture_t
*
p_subpic
)
);
/* Default subpicture channel ID */
#define DEFAULT_CHAN 1
/* Subpicture position flags */
#define SUBPICTURE_ALIGN_LEFT 0x1
#define SUBPICTURE_ALIGN_RIGHT 0x2
#define SUBPICTURE_ALIGN_TOP 0x4
#define SUBPICTURE_ALIGN_BOTTOM 0x8
#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \
SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM )
/*****************************************************************************
* Prototypes
*****************************************************************************/
...
...
modules/stream_out/transcode.c
View file @
8fce3d90
...
...
@@ -2419,14 +2419,14 @@ static int transcode_spu_process( sout_stream_t *p_stream,
static
subpicture_t
*
spu_new_buffer
(
decoder_t
*
p_dec
)
{
sout_stream_t
*
p_stream
=
(
sout_stream_t
*
)
p_dec
->
p_owner
;
return
s
pu_CreateSubpicture
(
p_stream
->
p_sys
->
p_spu
);
VLC_UNUSED
(
p_dec
)
;
return
s
ubpicture_New
(
);
}
static
void
spu_del_buffer
(
decoder_t
*
p_dec
,
subpicture_t
*
p_subpic
)
{
sout_stream_t
*
p_stream
=
(
sout_stream_t
*
)
p_dec
->
p_owner
;
s
pu_DestroySubpicture
(
p_stream
->
p_sys
->
p_spu
,
p_subpic
);
VLC_UNUSED
(
p_dec
)
;
s
ubpicture_Delete
(
p_subpic
);
}
/*
...
...
@@ -2542,7 +2542,7 @@ static int transcode_osd_process( sout_stream_t *p_stream,
}
p_block
=
id
->
p_encoder
->
pf_encode_sub
(
id
->
p_encoder
,
p_subpic
);
s
pu_DestroySubpicture
(
p_sys
->
p_spu
,
p_subpic
);
s
ubpicture_Delete
(
p_subpic
);
if
(
p_block
)
{
p_block
->
i_dts
=
p_block
->
i_pts
=
in
->
i_dts
;
...
...
src/input/decoder.c
View file @
8fce3d90
...
...
@@ -1085,7 +1085,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
if
(
p_spu
->
i_start
<
p_dec
->
p_owner
->
i_preroll_end
&&
(
p_spu
->
i_stop
<=
0
||
p_spu
->
i_stop
<
p_dec
->
p_owner
->
i_preroll_end
)
)
{
s
pu_DestroySubpicture
(
p_vout
->
p_spu
,
p_spu
);
s
ubpicture_Delete
(
p_spu
);
}
else
spu_DisplaySubpicture
(
p_vout
->
p_spu
,
p_spu
);
...
...
@@ -1460,7 +1460,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec )
p_sys
->
p_spu_vout
=
p_vout
;
}
p_subpic
=
s
pu_CreateSubpicture
(
p_vout
->
p_spu
);
p_subpic
=
s
ubpicture_New
(
);
if
(
p_subpic
)
{
p_subpic
->
i_channel
=
p_sys
->
i_spu_channel
;
...
...
@@ -1487,7 +1487,7 @@ static void spu_del_buffer( decoder_t *p_dec, subpicture_t *p_subpic )
return
;
}
s
pu_DestroySubpicture
(
p_vout
->
p_spu
,
p_subpic
);
s
ubpicture_Delete
(
p_subpic
);
vlc_object_release
(
p_vout
);
}
...
...
src/libvlccore.sym
View file @
8fce3d90
...
...
@@ -339,9 +339,7 @@ sout_StreamDelete
sout_StreamNew
sout_UpdateStatistic
__spu_Create
spu_CreateSubpicture
spu_Destroy
spu_DestroySubpicture
spu_DisplaySubpicture
spu_Init
spu_RenderSubpictures
...
...
@@ -375,6 +373,9 @@ stream_vaControl
__str_format
__str_format_meta
str_format_time
subpicture_Delete
subpicture_New
subpicture_region_New
subpicture_region_ChainDelete
subpicture_region_Delete
subpicture_region_New
...
...
src/osd/osd_text.c
View file @
8fce3d90
...
...
@@ -78,7 +78,7 @@ int osd_ShowTextAbsolute( spu_t *p_spu_channel, int i_channel,
if
(
!
psz_string
)
return
VLC_EGENERIC
;
p_spu
=
s
pu_CreateSubpicture
(
p_spu_channel
);
p_spu
=
s
ubpicture_New
(
);
if
(
!
p_spu
)
return
VLC_EGENERIC
;
...
...
@@ -98,7 +98,7 @@ int osd_ShowTextAbsolute( spu_t *p_spu_channel, int i_channel,
if
(
!
p_spu
->
p_region
)
{
msg_Err
(
p_spu_channel
,
"cannot allocate SPU region"
);
s
pu_DestroySubpicture
(
p_spu_channel
,
p_spu
);
s
ubpicture_Delete
(
p_spu
);
return
VLC_EGENERIC
;
}
...
...
src/osd/osd_widgets.c
View file @
8fce3d90
...
...
@@ -196,8 +196,10 @@ subpicture_t *osd_CreateWidget( spu_t *p_spu, int i_channel )
subpicture_t
*
p_subpic
;
mtime_t
i_now
=
mdate
();
VLC_UNUSED
(
p_spu
);
/* Create and initialize a subpicture */
p_subpic
=
s
pu_CreateSubpicture
(
p_spu
);
p_subpic
=
s
ubpicture_New
(
);
if
(
p_subpic
==
NULL
)
return
NULL
;
p_subpic
->
i_channel
=
i_channel
;
...
...
src/video_output/video_text.c
View file @
8fce3d90
...
...
@@ -80,7 +80,7 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
if
(
!
psz_string
)
return
VLC_EGENERIC
;
p_spu
=
s
pu_CreateSubpicture
(
p_vout
->
p_spu
);
p_spu
=
s
ubpicture_New
(
);
if
(
!
p_spu
)
return
VLC_EGENERIC
;
...
...
@@ -102,7 +102,7 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
if
(
!
p_spu
->
p_region
)
{
msg_Err
(
p_vout
,
"cannot allocate SPU region"
);
s
pu_DestroySubpicture
(
p_vout
->
p_spu
,
p_spu
);
s
ubpicture_Delete
(
p_spu
);
return
VLC_EGENERIC
;
}
...
...
src/video_output/vout_intf.c
View file @
8fce3d90
...
...
@@ -457,7 +457,7 @@ static int VoutSnapshotPip( vout_thread_t *p_vout, image_handler_t *p_image, pic
if
(
!
p_pip
)
return
VLC_EGENERIC
;
p_subpic
=
s
pu_CreateSubpicture
(
p_vout
->
p_spu
);
p_subpic
=
s
ubpicture_New
(
);
if
(
p_subpic
==
NULL
)
{
picture_Release
(
p_pip
);
...
...
src/video_output/vout_subpictures.c
View file @
8fce3d90
...
...
@@ -48,11 +48,6 @@
#define VLC_FOURCC_RGBA VLC_FOURCC('R','G','B','A')
#define VLC_FOURCC_TEXT VLC_FOURCC('T','E','X','T')
/* TODO export */
static
subpicture_t
*
subpicture_New
(
void
);
static
void
subpicture_Delete
(
subpicture_t
*
p_subpic
);
static
void
SubpictureChain
(
subpicture_t
**
pp_head
,
subpicture_t
*
p_subpic
);
/* */
typedef
struct
{
...
...
@@ -142,6 +137,7 @@ static bool spu_area_overlap( spu_area_t, spu_area_t );
#define SCALE_UNIT (1000)
static
void
SubpictureChain
(
subpicture_t
**
pp_head
,
subpicture_t
*
p_subpic
);
static
int
SubpictureCmp
(
const
void
*
s0
,
const
void
*
s1
);
static
void
SpuRenderRegion
(
spu_t
*
,
...
...
@@ -355,38 +351,6 @@ void spu_DisplaySubpicture( spu_t *p_spu, subpicture_t *p_subpic )
vlc_mutex_unlock
(
&
p_sys
->
lock
);
}
/**
* Allocate a subpicture in the spu heap.
*
* This function create a reserved subpicture in the spu heap.
* A null pointer is returned if the function fails. This method provides an
* already allocated zone of memory in the spu data fields. It needs locking
* since several pictures can be created by several producers threads.
* \param p_spu the subpicture unit in which to create the subpicture
* \return NULL on error, a reserved subpicture otherwise
*/
subpicture_t
*
spu_CreateSubpicture
(
spu_t
*
p_spu
)
{
VLC_UNUSED
(
p_spu
);
return
subpicture_New
();
}
/**
* Remove a subpicture from the heap
*
* This function frees a previously reserved subpicture.
* It is meant to be used when the construction of a picture aborted.
* This function does not need locking since reserved subpictures are ignored
* by the spu.
*/
void
spu_DestroySubpicture
(
spu_t
*
p_spu
,
subpicture_t
*
p_subpic
)
{
VLC_UNUSED
(
p_spu
);
subpicture_Delete
(
p_subpic
);
}
/**
* This function renders all sub picture units in the list.
*/
...
...
@@ -671,10 +635,7 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
/*****************************************************************************
* subpicture_t allocation
*****************************************************************************/
/**
* This function create a new empty subpicture.
*/
static
subpicture_t
*
subpicture_New
(
void
)
subpicture_t
*
subpicture_New
(
void
)
{
subpicture_t
*
p_subpic
=
calloc
(
1
,
sizeof
(
*
p_subpic
)
);
if
(
!
p_subpic
)
...
...
@@ -693,7 +654,7 @@ static subpicture_t *subpicture_New( void )
return
p_subpic
;
}
static
void
subpicture_Delete
(
subpicture_t
*
p_subpic
)
void
subpicture_Delete
(
subpicture_t
*
p_subpic
)
{
subpicture_region_ChainDelete
(
p_subpic
->
p_region
);
p_subpic
->
p_region
=
NULL
;
...
...
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