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
a57bfee7
Commit
a57bfee7
authored
Jan 31, 2000
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
. le d�codeur de sous-titres s'appelle maintenant spu_decoder
. auto spawn du spu_decoder (pour le moment �a chie)
parent
b25b4229
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
313 additions
and
86 deletions
+313
-86
Makefile
Makefile
+2
-2
include/input.h
include/input.h
+1
-0
include/spu_decoder.h
include/spu_decoder.h
+6
-6
include/video.h
include/video.h
+17
-17
include/video_output.h
include/video_output.h
+5
-5
include/vlc.h
include/vlc.h
+3
-0
src/input/input.c
src/input/input.c
+11
-0
src/input/input_ctrl.c
src/input/input_ctrl.c
+16
-1
src/input/input_psi.c
src/input/input_psi.c
+9
-0
src/spu_decoder/spu_decoder.c
src/spu_decoder/spu_decoder.c
+188
-0
src/video_output/video_output.c
src/video_output/video_output.c
+55
-55
No files found.
Makefile
View file @
a57bfee7
...
...
@@ -213,7 +213,7 @@ ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
audio_decoder_obj
=
audio_decoder/audio_decoder.o
\
audio_decoder/audio_math.o
s
ubtitle_decoder_obj
=
subtitle_decoder/subtitle
_decoder.o
s
pu_decoder_obj
=
spu_decoder/spu
_decoder.o
#??generic_decoder_obj = generic_decoder/generic_decoder.o
# remeber to add it to OBJ
...
...
@@ -253,7 +253,7 @@ C_OBJ = $(interface_obj) \
$(video_output_obj)
\
$(ac3_decoder_obj)
\
$(audio_decoder_obj)
\
$(s
ubtitle
_decoder_obj)
\
$(s
pu
_decoder_obj)
\
$(generic_decoder_obj)
\
$(video_parser_obj)
\
$(video_decoder_obj)
\
...
...
include/input.h
View file @
a57bfee7
...
...
@@ -148,6 +148,7 @@ typedef struct es_descriptor_t
#define MPEG1_AUDIO_ES 0x03
#define MPEG2_AUDIO_ES 0x04
#define AC3_AUDIO_ES 0x81
#define DVD_SPU_ES 0x82
/* 0x82 might violate the norm */
/******************************************************************************
* program_descriptor_t
...
...
include/s
ubtitle
_decoder.h
→
include/s
pu
_decoder.h
View file @
a57bfee7
/******************************************************************************
* s
ubtitle_decoder.h : subtitle
decoder thread interface
* s
pu_decoder.h : sub picture unit
decoder thread interface
* (c)1999 VideoLAN
******************************************************************************/
/******************************************************************************
* s
ubtdec_thread_t : subtitle
decoder thread descriptor
* s
pudec_thread_t : sub picture unit
decoder thread descriptor
******************************************************************************/
typedef
struct
s
ubt
dec_thread_s
typedef
struct
s
pu
dec_thread_s
{
/*
* Thread properties and locks
...
...
@@ -30,10 +30,10 @@ typedef struct subtdec_thread_s
unsigned
int
total_bits_read
;
/* ... */
}
s
ubt
dec_thread_t
;
}
s
pu
dec_thread_t
;
/******************************************************************************
* Prototypes
******************************************************************************/
s
ubtdec_thread_t
*
subt
dec_CreateThread
(
input_thread_t
*
p_input
);
void
s
ubtdec_DestroyThread
(
subtdec_thread_t
*
p_subt
dec
);
s
pudec_thread_t
*
spu
dec_CreateThread
(
input_thread_t
*
p_input
);
void
s
pudec_DestroyThread
(
spudec_thread_t
*
p_spu
dec
);
include/video.h
View file @
a57bfee7
...
...
@@ -87,35 +87,35 @@ typedef struct picture_s
#define AR_221_1_PICTURE 4
/* 2.21:1 picture (movie) */
/*******************************************************************************
* s
ubtitle_t: video subtitle
* s
pu_t: video sub picture unit
*******************************************************************************
* Any sub
title destined to be displayed by a video output thread should be
* stored in this structure from it's creation to it's effective display.
* Any sub
picture unit destined to be displayed by a video output thread should
*
be
stored in this structure from it's creation to it's effective display.
* Subtitle type and flags should only be modified by the output thread. Note
* that an empty subtitle MUST have its flags set to 0.
*******************************************************************************/
typedef
struct
s
ubtitle
_s
typedef
struct
s
pu
_s
{
/* Type and flags - should NOT be modified except by the vout thread */
int
i_type
;
/* subtitle
type */
int
i_status
;
/* subtitle
flags */
int
i_type
;
/* spu
type */
int
i_status
;
/* spu
flags */
/* Other properties */
mtime_t
begin_date
;
/* beginning of display date */
mtime_t
end_date
;
/* end of display date */
/* Sub
title
data - data can always be freely modified. p_data itself
/* Sub
picture unit
data - data can always be freely modified. p_data itself
* (the pointer) should NEVER be modified. */
void
*
p_data
;
/* subtitle
data */
}
s
ubtitle
_t
;
/* S
ubtitle
types */
#define EMPTY_S
UBTITLE
0
/* subtitle slot is empty and available */
#define RLE_S
UBTITLE
100
/* RLE encoded subtitle */
/* Sub
titl
e status */
#define FREE_S
UBTITLE
0
/* subtitle is free and not allocated */
#define RESERVED_S
UBTITLE
1
/* subtitle is allocated and reserved */
#define READY_S
UBTITLE
2
/* subtitle is ready for display */
#define DESTROYED_S
UBTITLE
3
/* subtitle is allocated but no more used */
void
*
p_data
;
/* spu
data */
}
s
pu
_t
;
/* S
PU
types */
#define EMPTY_S
PU
0
/* subtitle slot is empty and available */
#define RLE_S
PU
100
/* RLE encoded subtitle */
/* Sub
pictur
e status */
#define FREE_S
PU
0
/* subtitle is free and not allocated */
#define RESERVED_S
PU
1
/* subtitle is allocated and reserved */
#define READY_S
PU
2
/* subtitle is ready for display */
#define DESTROYED_S
PU
3
/* subtitle is allocated but no more used */
include/video_output.h
View file @
a57bfee7
...
...
@@ -85,7 +85,7 @@ typedef struct vout_thread_s
boolean_t
b_active
;
/* `active' flag */
vlc_thread_t
thread_id
;
/* id for pthread functions */
vlc_mutex_t
picture_lock
;
/* picture heap lock */
vlc_mutex_t
s
ubtitle_lock
;
/* subtitle heap lock */
vlc_mutex_t
s
pu_lock
;
/* subtitle heap lock */
vlc_mutex_t
change_lock
;
/* thread change lock */
int
*
pi_status
;
/* temporary status flag */
p_vout_sys_t
p_sys
;
/* system output method */
...
...
@@ -123,7 +123,7 @@ typedef struct vout_thread_s
/* Videos heap and translation tables */
picture_t
p_picture
[
VOUT_MAX_PICTURES
];
/* pictures */
s
ubtitle_t
p_subtitle
[
VOUT_MAX_PICTURES
];
/* subtitles */
s
pu_t
p_spu
[
VOUT_MAX_PICTURES
];
/* subtitles */
vout_tables_t
tables
;
/* translation tables */
vout_convert_t
*
p_ConvertYUV420
;
/* YUV 4:2:0 converter */
vout_convert_t
*
p_ConvertYUV422
;
/* YUV 4:2:2 converter */
...
...
@@ -158,9 +158,9 @@ void vout_DisplayPicture ( vout_thread_t *p_vout, picture_t *p_pi
void
vout_DatePicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
,
mtime_t
date
);
void
vout_LinkPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
);
void
vout_UnlinkPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
);
s
ubtitle_t
*
vout_CreateSubtitle
(
vout_thread_t
*
p_vout
,
int
i_type
,
int
i_size
);
void
vout_DestroySub
title
(
vout_thread_t
*
p_vout
,
subtitle_t
*
p_sub
);
void
vout_DisplaySub
title
(
vout_thread_t
*
p_vout
,
subtitle_t
*
p_sub
);
s
pu_t
*
vout_CreateSubPictureUnit
(
vout_thread_t
*
p_vout
,
int
i_type
,
int
i_size
);
void
vout_DestroySub
PictureUnit
(
vout_thread_t
*
p_vout
,
spu_t
*
p_spu
);
void
vout_DisplaySub
PictureUnit
(
vout_thread_t
*
p_vout
,
spu_t
*
p_spu
);
void
vout_ClearBuffer
(
vout_thread_t
*
p_vout
,
vout_buffer_t
*
p_buffer
);
...
...
include/vlc.h
View file @
a57bfee7
...
...
@@ -68,6 +68,9 @@
#include "audio_decoder.h"
#include "ac3_decoder.h"
/* Subtitles */
#include "spu_decoder.h"
/* Video */
#include "video.h"
#include "video_output.h"
...
...
src/input/input.c
View file @
a57bfee7
...
...
@@ -412,6 +412,10 @@ static void EndThread( input_thread_t * p_input )
case
AC3_AUDIO_ES
:
ac3dec_DestroyThread
(
(
ac3dec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_dec
)
);
break
;
case
DVD_SPU_ES
:
fprintf
(
stderr
,
"input.h : destroying spudec
\n
"
);
spudec_DestroyThread
(
(
spudec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_dec
)
);
break
;
case
0
:
/* Special streams for the PSI decoder, PID 0 and 1 */
break
;
...
...
@@ -1064,6 +1068,13 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
p_fifo
=
&
(((
ac3dec_thread_t
*
)(
p_es_descriptor
->
p_dec
))
->
fifo
);
break
;
case
DVD_SPU_ES
:
/* we skip 4 bytes at the beginning of the subpicture payload */
p_ts
->
i_payload_start
+=
4
;
fprintf
(
stderr
,
"input.h : launching spudec
\n
"
);
p_fifo
=
&
(((
spudec_thread_t
*
)(
p_es_descriptor
->
p_dec
))
->
fifo
);
break
;
default:
/* This should never happen */
intf_DbgMsg
(
"Unknown stream type (%d, %d): PES trashed
\n
"
,
...
...
src/input/input_ctrl.c
View file @
a57bfee7
...
...
@@ -112,6 +112,17 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
}
break
;
case
DVD_SPU_ES
:
/* Spawn spu thread */
if
(
((
spudec_thread_t
*
)(
p_input
->
p_es
[
i_es_loop
].
p_dec
)
=
spudec_CreateThread
(
p_input
))
==
NULL
)
{
intf_ErrMsg
(
"Could not start subtitle decoder
\n
"
);
vlc_mutex_unlock
(
&
p_input
->
es_lock
);
return
(
-
1
);
}
break
;
case
MPEG1_AUDIO_ES
:
case
MPEG2_AUDIO_ES
:
/* Spawn audio thread. */
...
...
@@ -156,7 +167,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
/* Initialise the demux */
p_input
->
p_es
[
i_es_loop
].
p_pes_packet
=
NULL
;
p_input
->
p_es
[
i_es_loop
].
i_continuity_counter
=
0x
FF
;
p_input
->
p_es
[
i_es_loop
].
i_continuity_counter
=
0x
ff
;
p_input
->
p_es
[
i_es_loop
].
b_random
=
0
;
/* Mark stream to be demultiplexed. */
...
...
@@ -217,6 +228,10 @@ int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
ac3dec_DestroyThread
(
(
ac3dec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_selected_es_loop
]
->
p_dec
)
);
break
;
case
DVD_SPU_ES
:
spudec_DestroyThread
(
(
spudec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_selected_es_loop
]
->
p_dec
)
);
break
;
case
MPEG1_AUDIO_ES
:
case
MPEG2_AUDIO_ES
:
adec_DestroyThread
(
(
adec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_selected_es_loop
]
->
p_dec
)
);
...
...
src/input/input_psi.c
View file @
a57bfee7
...
...
@@ -649,6 +649,15 @@ static void DecodePgrmMapSection( u8* p_pms, input_thread_t* p_input )
}
break
;
case
DVD_SPU_ES
:
if
(
p_main
->
b_audio
)
{
/* Spawn a spu decoder thread */
input_AddPgrmElem
(
p_input
,
p_input
->
p_es
[
i_es_loop
].
i_id
);
}
break
;
case
MPEG1_AUDIO_ES
:
case
MPEG2_AUDIO_ES
:
if
(
p_main
->
b_audio
)
...
...
src/spu_decoder/spu_decoder.c
0 → 100644
View file @
a57bfee7
/*******************************************************************************
* spu_decoder.c : spu decoder thread
* (c)2000 VideoLAN
*******************************************************************************/
/* repomp sur video_decoder.c
* ?? passer en terminate/destroy avec les signaux supplmentaires */
/*******************************************************************************
* Preamble
*******************************************************************************/
//#include "vlc.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/uio.h>
#include "config.h"
#include "common.h"
#include "mtime.h"
#include "vlc_thread.h"
#include "intf_msg.h"
#include "debug.h"
/* ?? temporaire, requis par netlist.h */
#include "input.h"
#include "input_netlist.h"
#include "decoder_fifo.h"
#include "spu_decoder.h"
/*
* Local prototypes
*/
static
int
InitThread
(
spudec_thread_t
*
p_spudec
);
static
void
RunThread
(
spudec_thread_t
*
p_spudec
);
static
void
ErrorThread
(
spudec_thread_t
*
p_spudec
);
static
void
EndThread
(
spudec_thread_t
*
p_spudec
);
/******************************************************************************
* spudec_CreateThread: create a spu decoder thread
******************************************************************************/
spudec_thread_t
*
spudec_CreateThread
(
input_thread_t
*
p_input
)
{
spudec_thread_t
*
p_spudec
;
intf_DbgMsg
(
"spudec debug: creating spu decoder thread
\n
"
);
fprintf
(
stderr
,
"spudec debug: creating spu decoder thread
\n
"
);
/* Allocate the memory needed to store the thread's structure */
if
(
(
p_spudec
=
(
spudec_thread_t
*
)
malloc
(
sizeof
(
spudec_thread_t
)
))
==
NULL
)
{
intf_ErrMsg
(
"spudec error: not enough memory for spudec_CreateThread() to create the new thread
\n
"
);
return
(
NULL
);
}
/*
* Initialize the thread properties
*/
p_spudec
->
b_die
=
0
;
p_spudec
->
b_error
=
0
;
/* Spawn the spu decoder thread */
if
(
vlc_thread_create
(
&
p_spudec
->
thread_id
,
"spu decoder"
,
(
vlc_thread_func_t
)
RunThread
,
(
void
*
)
p_spudec
)
)
{
intf_ErrMsg
(
"spudec error: can't spawn spu decoder thread
\n
"
);
free
(
p_spudec
);
return
(
NULL
);
}
intf_DbgMsg
(
"spudec debug: spu decoder thread (%p) created
\n
"
,
p_spudec
);
return
(
p_spudec
);
}
/*******************************************************************************
* spudec_DestroyThread: destroy a spu decoder thread
*******************************************************************************
* Destroy and terminate thread. This function will return 0 if the thread could
* be destroyed, and non 0 else. The last case probably means that the thread
* was still active, and another try may succeed.
*******************************************************************************/
void
spudec_DestroyThread
(
spudec_thread_t
*
p_spudec
)
{
intf_DbgMsg
(
"spudec debug: requesting termination of spu decoder thread %p
\n
"
,
p_spudec
);
fprintf
(
stderr
,
"spudec debug: requesting termination of spu decoder thread %p
\n
"
,
p_spudec
);
/* Ask thread to kill itself */
p_spudec
->
b_die
=
1
;
/* Waiting for the decoder thread to exit */
/* Remove this as soon as the "status" flag is implemented */
vlc_thread_join
(
p_spudec
->
thread_id
);
}
/* following functions are local */
/*******************************************************************************
* InitThread: initialize spu decoder thread
*******************************************************************************
* This function is called from RunThread and performs the second step of the
* initialization. It returns 0 on success. Note that the thread's flag are not
* modified inside this function.
*******************************************************************************/
static
int
InitThread
(
spudec_thread_t
*
p_spudec
)
{
intf_DbgMsg
(
"spudec debug: initializing spu decoder thread %p
\n
"
,
p_spudec
);
/* Mark thread as running and return */
intf_DbgMsg
(
"spudec debug: InitThread(%p) succeeded
\n
"
,
p_spudec
);
return
(
0
);
}
/*******************************************************************************
* RunThread: spu decoder thread
*******************************************************************************
* spu decoder thread. This function does only return when the thread is
* terminated.
*******************************************************************************/
static
void
RunThread
(
spudec_thread_t
*
p_spudec
)
{
intf_DbgMsg
(
"spudec debug: running spu decoder thread (%p) (pid == %i)
\n
"
,
p_spudec
,
getpid
());
/*
* Initialize thread and free configuration
*/
p_spudec
->
b_error
=
InitThread
(
p_spudec
);
if
(
p_spudec
->
b_error
)
{
return
;
}
p_spudec
->
b_run
=
1
;
/*
* Main loop - it is not executed if an error occured during
* initialization
*/
while
(
(
!
p_spudec
->
b_die
)
&&
(
!
p_spudec
->
b_error
)
)
{
fprintf
(
stderr
,
"I'm a spu decoder !
\n
"
);
sleep
(
1
);
}
/*
* Error loop
*/
if
(
p_spudec
->
b_error
)
{
ErrorThread
(
p_spudec
);
}
/* End of thread */
EndThread
(
p_spudec
);
p_spudec
->
b_run
=
0
;
}
/*******************************************************************************
* ErrorThread: RunThread() error loop
*******************************************************************************
* This function is called when an error occured during thread main's loop. The
* thread can still receive feed, but must be ready to terminate as soon as
* possible.
*******************************************************************************/
static
void
ErrorThread
(
spudec_thread_t
*
p_spudec
)
{
/* Wait until a `die' order */
while
(
!
p_spudec
->
b_die
)
{
// foo();
}
}
/*******************************************************************************
* EndThread: thread destruction
*******************************************************************************
* This function is called when the thread ends after a sucessfull
* initialization.
*******************************************************************************/
static
void
EndThread
(
spudec_thread_t
*
p_spudec
)
{
intf_DbgMsg
(
"spudec debug: EndThread(%p)
\n
"
,
p_spudec
);
}
src/video_output/video_output.c
View file @
a57bfee7
...
...
@@ -41,7 +41,7 @@ static void SetBufferArea ( vout_thread_t *p_vout, int i_x, int i_
static
void
SetBufferPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
);
static
void
RenderPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
);
static
void
RenderPictureInfo
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
);
static
void
RenderSub
title
(
vout_thread_t
*
p_vout
,
subtitle_t
*
p_sub
);
static
void
RenderSub
PictureUnit
(
vout_thread_t
*
p_vout
,
spu_t
*
p_spu
);
static
void
RenderInterface
(
vout_thread_t
*
p_vout
);
static
void
RenderIdle
(
vout_thread_t
*
p_vout
);
static
void
RenderInfo
(
vout_thread_t
*
p_vout
);
...
...
@@ -112,14 +112,14 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_
/* Initialize buffer index */
p_vout
->
i_buffer_index
=
0
;
/* Initialize pictures and s
ubtitle
s - translation tables and functions
/* Initialize pictures and s
pu
s - translation tables and functions
* will be initialized later in InitThread */
for
(
i_index
=
0
;
i_index
<
VOUT_MAX_PICTURES
;
i_index
++
)
{
p_vout
->
p_picture
[
i_index
].
i_type
=
EMPTY_PICTURE
;
p_vout
->
p_picture
[
i_index
].
i_status
=
FREE_PICTURE
;
p_vout
->
p_s
ubtitle
[
i_index
].
i_type
=
EMPTY_SUBTITLE
;
p_vout
->
p_s
ubtitle
[
i_index
].
i_status
=
FREE_SUBTITLE
;
p_vout
->
p_s
pu
[
i_index
].
i_type
=
EMPTY_SPU
;
p_vout
->
p_s
pu
[
i_index
].
i_status
=
FREE_SPU
;
}
/* Create and initialize system-dependant method - this function issues its
...
...
@@ -153,7 +153,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_
/* Create thread and set locks */
vlc_mutex_init
(
&
p_vout
->
picture_lock
);
vlc_mutex_init
(
&
p_vout
->
s
ubtitle
_lock
);
vlc_mutex_init
(
&
p_vout
->
s
pu
_lock
);
vlc_mutex_init
(
&
p_vout
->
change_lock
);
vlc_mutex_lock
(
&
p_vout
->
change_lock
);
if
(
vlc_thread_create
(
&
p_vout
->
thread_id
,
"video output"
,
(
void
*
)
RunThread
,
(
void
*
)
p_vout
)
)
...
...
@@ -217,13 +217,13 @@ void vout_DestroyThread( vout_thread_t *p_vout, int *pi_status )
}
/******************************************************************************
* vout_DisplaySub
title: display a subtitle
* vout_DisplaySub
PictureUnit: display a sub picture unit
******************************************************************************
* Remove the reservation flag of a
subtitle
, which will cause it to be ready for
* Remove the reservation flag of a
n spu
, which will cause it to be ready for
* display. The picture does not need to be locked, since it is ignored by
* the output thread if is reserved.
******************************************************************************/
void
vout_DisplaySub
title
(
vout_thread_t
*
p_vout
,
subtitle_t
*
p_sub
)
void
vout_DisplaySub
PictureUnit
(
vout_thread_t
*
p_vout
,
spu_t
*
p_spu
)
{
#ifdef DEBUG_VIDEO
char
psz_begin_date
[
MSTRTIME_MAX_SIZE
];
/* buffer for date string */
...
...
@@ -232,59 +232,59 @@ void vout_DisplaySubtitle( vout_thread_t *p_vout, subtitle_t *p_sub )
#ifdef DEBUG
/* Check if status is valid */
if
(
p_s
ub
->
i_status
!=
RESERVED_SUBTITLE
)
if
(
p_s
pu
->
i_status
!=
RESERVED_SPU
)
{
intf_DbgMsg
(
"error: s
ubtitle %p has invalid status %d
\n
"
,
p_sub
,
p_sub
->
i_status
);
intf_DbgMsg
(
"error: s
pu %p has invalid status %d
\n
"
,
p_spu
,
p_spu
->
i_status
);
}
#endif
/* Remove reservation flag */
p_s
ub
->
i_status
=
READY_SUBTITLE
;
p_s
pu
->
i_status
=
READY_SPU
;
#ifdef DEBUG_VIDEO
/* Send sub
titl
e informations */
intf_DbgMsg
(
"s
ubtitle %p: type=%d, begin date=%s, end date=%s
\n
"
,
p_sub
,
p_sub
->
i_type
,
mstrtime
(
psz_begin_date
,
p_s
ub
->
begin_date
),
mstrtime
(
psz_end_date
,
p_s
ub
->
end_date
)
);
/* Send sub
pictur
e informations */
intf_DbgMsg
(
"s
pu %p: type=%d, begin date=%s, end date=%s
\n
"
,
p_spu
,
p_spu
->
i_type
,
mstrtime
(
psz_begin_date
,
p_s
pu
->
begin_date
),
mstrtime
(
psz_end_date
,
p_s
pu
->
end_date
)
);
#endif
}
/******************************************************************************
* vout_CreateSub
title: allocate a subtitle
in the video output heap.
* vout_CreateSub
PictureUnit: allocate an spu
in the video output heap.
******************************************************************************
* This function create a reserved s
ubtitle
in the video output heap.
* This function create a reserved s
pu
in the video output heap.
* A null pointer is returned if the function fails. This method provides an
* already allocated zone of memory in the s
ubtitle
data fields. It needs locking
* already allocated zone of memory in the s
pu
data fields. It needs locking
* since several pictures can be created by several producers threads.
******************************************************************************/
s
ubtitle_t
*
vout_CreateSubtitle
(
vout_thread_t
*
p_vout
,
int
i_type
,
s
pu_t
*
vout_CreateSubPictureUnit
(
vout_thread_t
*
p_vout
,
int
i_type
,
int
i_size
)
{
//??
}
/******************************************************************************
* vout_DestroySub
title: remove a permanent or reserved subtitle
from the heap
* vout_DestroySub
PictureUnit: remove a permanent or reserved spu
from the heap
******************************************************************************
* This function frees a previously reserved s
ubtitle
.
* This function frees a previously reserved s
pu
.
* It is meant to be used when the construction of a picture aborted.
* This function does not need locking since reserved s
ubtitle
s are ignored by
* This function does not need locking since reserved s
pu
s are ignored by
* the output thread.
******************************************************************************/
void
vout_DestroySub
title
(
vout_thread_t
*
p_vout
,
subtitle_t
*
p_sub
)
void
vout_DestroySub
PictureUnit
(
vout_thread_t
*
p_vout
,
spu_t
*
p_spu
)
{
#ifdef DEBUG
/* Check if s
ubtitle
status is valid */
if
(
p_s
ub
->
i_status
!=
RESERVED_SUBTITLE
)
/* Check if s
pu
status is valid */
if
(
p_s
pu
->
i_status
!=
RESERVED_SPU
)
{
intf_DbgMsg
(
"error: s
ubtitle %p has invalid status %d
\n
"
,
p_sub
,
p_sub
->
i_status
);
intf_DbgMsg
(
"error: s
pu %p has invalid status %d
\n
"
,
p_spu
,
p_spu
->
i_status
);
}
#endif
p_s
ub
->
i_status
=
DESTROYED_SUBTITLE
;
p_s
pu
->
i_status
=
DESTROYED_SPU
;
#ifdef DEBUG_VIDEO
intf_DbgMsg
(
"s
ubtitle %p
\n
"
,
p_sub
);
intf_DbgMsg
(
"s
pu %p
\n
"
,
p_spu
);
#endif
}
...
...
@@ -643,7 +643,7 @@ static void RunThread( vout_thread_t *p_vout)
mtime_t
display_date
;
/* display date */
boolean_t
b_display
;
/* display flag */
picture_t
*
p_pic
;
/* picture pointer */
s
ubtitle_t
*
p_sub
;
/* subtitl
e pointer */
s
pu_t
*
p_spu
;
/* subpictur
e pointer */
/*
* Initialize thread
...
...
@@ -664,7 +664,7 @@ static void RunThread( vout_thread_t *p_vout)
{
/* Initialize loop variables */
p_pic
=
NULL
;
p_s
ub
=
NULL
;
p_s
pu
=
NULL
;
display_date
=
0
;
current_date
=
mdate
();
...
...
@@ -711,16 +711,16 @@ static void RunThread( vout_thread_t *p_vout)
}
/*
* Find the sub
titl
e to display - this operation does not need lock, since
* only READY_S
UBTITLE
s are handled. If no picture has been selected,
* display_date will depend on the s
ubtitle
* Find the sub
pictur
e to display - this operation does not need lock, since
* only READY_S
PU
s are handled. If no picture has been selected,
* display_date will depend on the s
pu
*/
//??
/*
* Perform rendering, sleep and display rendered picture
*/
if
(
p_pic
)
/* picture and perhaps s
ubtitle
*/
if
(
p_pic
)
/* picture and perhaps s
pu
*/
{
b_display
=
p_vout
->
b_active
;
...
...
@@ -743,26 +743,26 @@ static void RunThread( vout_thread_t *p_vout)
p_pic
->
i_status
=
p_pic
->
i_refcount
?
DISPLAYED_PICTURE
:
DESTROYED_PICTURE
;
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
/* Render interface and s
ubtitle
s */
/* Render interface and s
pu
s */
if
(
b_display
&&
p_vout
->
b_interface
)
{
RenderInterface
(
p_vout
);
}
if
(
p_s
ub
)
if
(
p_s
pu
)
{
if
(
b_display
)
{
RenderSub
title
(
p_vout
,
p_sub
);
RenderSub
PictureUnit
(
p_vout
,
p_spu
);
}
/* Remove s
ubtitle
from heap */
vlc_mutex_lock
(
&
p_vout
->
s
ubtitle
_lock
);
p_s
ub
->
i_status
=
DESTROYED_SUBTITLE
;
vlc_mutex_unlock
(
&
p_vout
->
s
ubtitle
_lock
);
/* Remove s
pu
from heap */
vlc_mutex_lock
(
&
p_vout
->
s
pu
_lock
);
p_s
pu
->
i_status
=
DESTROYED_SPU
;
vlc_mutex_unlock
(
&
p_vout
->
s
pu
_lock
);
}
}
else
if
(
p_s
ub
)
/* subtitle
alone */
else
if
(
p_s
pu
)
/* spu
alone */
{
b_display
=
p_vout
->
b_active
;
...
...
@@ -771,7 +771,7 @@ static void RunThread( vout_thread_t *p_vout)
/* Clear buffer */
SetBufferPicture
(
p_vout
,
NULL
);
/* Render informations, interface and s
ubtitle
*/
/* Render informations, interface and s
pu
*/
if
(
p_vout
->
b_info
)
{
RenderInfo
(
p_vout
);
...
...
@@ -780,13 +780,13 @@ static void RunThread( vout_thread_t *p_vout)
{
RenderInterface
(
p_vout
);
}
RenderSub
title
(
p_vout
,
p_sub
);
RenderSub
PictureUnit
(
p_vout
,
p_spu
);
}
/* Remove s
ubtitle
from heap */
vlc_mutex_lock
(
&
p_vout
->
s
ubtitle
_lock
);
p_s
ub
->
i_status
=
DESTROYED_SUBTITLE
;
vlc_mutex_unlock
(
&
p_vout
->
s
ubtitle
_lock
);
/* Remove s
pu
from heap */
vlc_mutex_lock
(
&
p_vout
->
s
pu
_lock
);
p_s
pu
->
i_status
=
DESTROYED_SPU
;
vlc_mutex_unlock
(
&
p_vout
->
s
pu
_lock
);
}
else
/* idle screen alone */
{
...
...
@@ -820,7 +820,7 @@ static void RunThread( vout_thread_t *p_vout)
* then swap buffers */
vlc_mutex_lock
(
&
p_vout
->
change_lock
);
#ifdef DEBUG_VIDEO
intf_DbgMsg
(
"picture %p, s
ubtitle %p
\n
"
,
p_pic
,
p_sub
);
intf_DbgMsg
(
"picture %p, s
pu %p
\n
"
,
p_pic
,
p_spu
);
#endif
if
(
b_display
&&
!
(
p_vout
->
i_changes
&
VOUT_NODISPLAY_CHANGE
)
)
{
...
...
@@ -886,16 +886,16 @@ static void EndThread( vout_thread_t *p_vout )
intf_DbgMsg
(
"
\n
"
);
*
p_vout
->
pi_status
=
THREAD_END
;
/* Destroy all remaining pictures and s
ubtitle
s */
/* Destroy all remaining pictures and s
pu
s */
for
(
i_index
=
0
;
i_index
<
VOUT_MAX_PICTURES
;
i_index
++
)
{
if
(
p_vout
->
p_picture
[
i_index
].
i_status
!=
FREE_PICTURE
)
{
free
(
p_vout
->
p_picture
[
i_index
].
p_data
);
}
if
(
p_vout
->
p_s
ubtitle
[
i_index
].
i_status
!=
FREE_SUBTITLE
)
if
(
p_vout
->
p_s
pu
[
i_index
].
i_status
!=
FREE_SPU
)
{
free
(
p_vout
->
p_s
ubtitle
[
i_index
].
p_data
);
free
(
p_vout
->
p_s
pu
[
i_index
].
p_data
);
}
}
...
...
@@ -1445,11 +1445,11 @@ static void RenderInfo( vout_thread_t *p_vout )
}
/*******************************************************************************
* RenderSub
title: render a subtitle
* RenderSub
PictureUnit: render an spu
*******************************************************************************
* This function render a sub
title
.
* This function render a sub
picture unit
.
*******************************************************************************/
static
void
RenderSub
title
(
vout_thread_t
*
p_vout
,
subtitle_t
*
p_sub
)
static
void
RenderSub
PictureUnit
(
vout_thread_t
*
p_vout
,
spu_t
*
p_spu
)
{
//??
}
...
...
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