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
0357e2cf
Commit
0357e2cf
authored
Oct 23, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added decoder_NewSubpicture/decoder_DeleteSubpicture helpers.
parent
b64ada26
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
59 additions
and
33 deletions
+59
-33
include/vlc_codec.h
include/vlc_codec.h
+18
-5
modules/codec/cc.c
modules/codec/cc.c
+2
-2
modules/codec/cmml/cmml.c
modules/codec/cmml/cmml.c
+1
-1
modules/codec/csri.c
modules/codec/csri.c
+3
-3
modules/codec/cvdsub.c
modules/codec/cvdsub.c
+2
-2
modules/codec/dvbsub.c
modules/codec/dvbsub.c
+1
-1
modules/codec/kate.c
modules/codec/kate.c
+3
-3
modules/codec/libass.c
modules/codec/libass.c
+3
-3
modules/codec/spudec/parse.c
modules/codec/spudec/parse.c
+3
-3
modules/codec/subtitles/subsdec.c
modules/codec/subtitles/subsdec.c
+2
-2
modules/codec/subtitles/subsusf.c
modules/codec/subtitles/subsusf.c
+1
-1
modules/codec/svcdsub.c
modules/codec/svcdsub.c
+2
-2
modules/codec/telx.c
modules/codec/telx.c
+2
-2
modules/codec/zvbi.c
modules/codec/zvbi.c
+3
-3
src/input/decoder.c
src/input/decoder.c
+11
-0
src/libvlccore.sym
src/libvlccore.sym
+2
-0
No files found.
include/vlc_codec.h
View file @
0357e2cf
...
...
@@ -95,14 +95,15 @@ struct decoder_t
void
(
*
pf_picture_link
)
(
decoder_t
*
,
picture_t
*
);
void
(
*
pf_picture_unlink
)
(
decoder_t
*
,
picture_t
*
);
/* SPU output callbacks */
subpicture_t
*
(
*
pf_spu_buffer_new
)
(
decoder_t
*
);
void
(
*
pf_spu_buffer_del
)
(
decoder_t
*
,
subpicture_t
*
);
/*
* Owner fields
*/
/* SPU output callbacks
* XXX use decoder_NewSubpicture and decoder_DeleteSubpicture */
subpicture_t
*
(
*
pf_spu_buffer_new
)
(
decoder_t
*
);
void
(
*
pf_spu_buffer_del
)
(
decoder_t
*
,
subpicture_t
*
);
/* Input attachments
* XXX use decoder_GetInputAttachments */
int
(
*
pf_get_attachments
)(
decoder_t
*
p_dec
,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
);
...
...
@@ -163,12 +164,24 @@ struct encoder_t
* @}
*/
/**
* This function will return a new subpicture usable by a decoder as an output
* buffer. You have to release it using decoder_DeleteSubpicture or by returning
* it to the caller as a pf_decode_sub return value.
*/
VLC_EXPORT
(
subpicture_t
*
,
decoder_NewSubpicture
,
(
decoder_t
*
)
);
/**
* This function will release a subpicture create by decoder_NewSubicture.
*/
VLC_EXPORT
(
void
,
decoder_DeleteSubpicture
,
(
decoder_t
*
,
subpicture_t
*
p_subpicture
)
);
/**
* This function gives all input attachments at once.
*
* You MUST release the returned values
*/
VLC_EXPORT
(
int
,
decoder_GetInputAttachments
,
(
decoder_t
*
p_dec
,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
)
);
VLC_EXPORT
(
int
,
decoder_GetInputAttachments
,
(
decoder_t
*
,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
)
);
/**
* This function converts a decoder timestamp into a display date comparable
...
...
modules/codec/cc.c
View file @
0357e2cf
...
...
@@ -329,7 +329,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
EnsureUTF8
(
psz_html
);
/* Create the subpicture unit */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
@@ -350,7 +350,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
free
(
psz_subtitle
);
free
(
psz_html
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
modules/codec/cmml/cmml.c
View file @
0357e2cf
...
...
@@ -159,7 +159,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
* displaying is done in the DisplayAnchor function in intf.c (called from
* DisplayPendingAnchor, which in turn is called from the main RunIntf
* loop). */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Dbg
(
p_dec
,
"couldn't allocate new subpicture"
);
...
...
modules/codec/csri.c
View file @
0357e2cf
...
...
@@ -174,7 +174,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return
NULL
;
}
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
@@ -185,7 +185,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_spu
->
p_sys
=
malloc
(
sizeof
(
subpicture_sys_t
));
if
(
!
p_spu
->
p_sys
)
{
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
block_Release
(
p_block
);
return
NULL
;
}
...
...
@@ -196,7 +196,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
!
p_spu
->
p_sys
->
p_subs_data
)
{
free
(
p_spu
->
p_sys
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
block_Release
(
p_block
);
return
NULL
;
}
...
...
modules/codec/cvdsub.c
View file @
0357e2cf
...
...
@@ -502,7 +502,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
int
i
;
/* Allocate the subpicture internal data. */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
return
NULL
;
p_spu
->
i_start
=
p_data
->
i_pts
;
...
...
@@ -530,7 +530,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
if
(
!
p_region
)
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
modules/codec/dvbsub.c
View file @
0357e2cf
...
...
@@ -1449,7 +1449,7 @@ static subpicture_t *render( decoder_t *p_dec )
int
i_base_y
;
/* Allocate the subpicture internal data. */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
return
NULL
;
...
...
modules/codec/kate.c
View file @
0357e2cf
...
...
@@ -578,7 +578,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
/* we have an event */
/* Get a new spu */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Err
(
p_dec
,
"Failed to allocate spu buffer"
);
...
...
@@ -636,7 +636,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
if
(
!
p_bitmap_region
)
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
@@ -656,7 +656,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
if
(
!
p_spu
->
p_region
)
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
modules/codec/libass.c
View file @
0357e2cf
...
...
@@ -231,7 +231,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return
NULL
;
}
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
@@ -242,7 +242,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_spu
->
p_sys
=
malloc
(
sizeof
(
subpicture_sys_t
));
if
(
!
p_spu
->
p_sys
)
{
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
block_Release
(
p_block
);
return
NULL
;
}
...
...
@@ -252,7 +252,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
!
p_spu
->
p_sys
->
p_subs_data
)
{
free
(
p_spu
->
p_sys
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
block_Release
(
p_block
);
return
NULL
;
}
...
...
modules/codec/spudec/parse.c
View file @
0357e2cf
...
...
@@ -85,7 +85,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
spu_properties_t
spu_properties
;
/* Allocate the subpicture internal data. */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
return
NULL
;
/* Rationale for the "p_spudec->i_rle_size * 4": we are going to
...
...
@@ -118,7 +118,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
if
(
ParseControlSeq
(
p_dec
,
p_spu
,
p_spu_data
,
&
spu_properties
)
)
{
/* There was a parse error, delete the subpicture */
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
@@ -126,7 +126,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
if
(
ParseRLE
(
p_dec
,
p_spu_data
,
&
spu_properties
)
)
{
/* There was a parse error, delete the subpicture */
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
modules/codec/subtitles/subsdec.c
View file @
0357e2cf
...
...
@@ -402,7 +402,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
}
/* Create the subpicture unit */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
@@ -421,7 +421,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
free
(
psz_subtitle
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
modules/codec/subtitles/subsusf.c
View file @
0357e2cf
...
...
@@ -208,7 +208,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
}
/* Create the subpicture unit */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
modules/codec/svcdsub.c
View file @
0357e2cf
...
...
@@ -471,7 +471,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
int
i
;
/* Allocate the subpicture internal data. */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
return
NULL
;
p_spu
->
i_start
=
p_data
->
i_pts
;
...
...
@@ -509,7 +509,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
if
(
!
p_region
)
{
msg_Err
(
p_dec
,
"cannot allocate SVCD subtitle region"
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
modules/codec/telx.c
View file @
0357e2cf
...
...
@@ -692,7 +692,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
strcpy
(
p_sys
->
psz_prev_text
,
psz_text
);
/* Create the subpicture unit */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
@@ -730,7 +730,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
error:
if
(
p_spu
!=
NULL
)
{
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
p_spu
=
NULL
;
}
...
...
modules/codec/zvbi.c
View file @
0357e2cf
...
...
@@ -441,7 +441,7 @@ error:
vbi_unref_page
(
&
p_page
);
if
(
p_spu
!=
NULL
)
{
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
p_spu
=
NULL
;
}
...
...
@@ -459,7 +459,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
/* If there is a page or sub to render, then we do that here */
/* Create the subpicture unit */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
p_spu
=
decoder_NewSubpicture
(
p_dec
);
if
(
!
p_spu
)
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
...
...
@@ -487,7 +487,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
if
(
p_spu
->
p_region
==
NULL
)
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
p_dec
->
pf_spu_buffer_del
(
p_dec
,
p_spu
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
}
...
...
src/input/decoder.c
View file @
0357e2cf
...
...
@@ -161,6 +161,17 @@ struct decoder_owner_sys_t
/*****************************************************************************
* Public functions
*****************************************************************************/
subpicture_t
*
decoder_NewSubpicture
(
decoder_t
*
p_decoder
)
{
subpicture_t
*
p_subpicture
=
p_decoder
->
pf_spu_buffer_new
(
p_decoder
);
if
(
!
p_subpicture
)
msg_Warn
(
p_decoder
,
"can't get output subpicture"
);
return
p_subpicture
;
}
void
decoder_DeleteSubpicture
(
decoder_t
*
p_decoder
,
subpicture_t
*
p_subpicture
)
{
p_decoder
->
pf_spu_buffer_del
(
p_decoder
,
p_subpicture
);
}
/* decoder_GetInputAttachments:
*/
...
...
src/libvlccore.sym
View file @
0357e2cf
...
...
@@ -77,9 +77,11 @@ date_Increment
date_Init
date_Move
date_Set
decoder_DeleteSubpicture
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetInputAttachments
decoder_NewSubpicture
decoder_SynchroChoose
decoder_SynchroDate
decoder_SynchroDecode
...
...
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