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
6546eb71
Commit
6546eb71
authored
Oct 02, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved vout_synchro to decoder_synchro.
parent
02d8f9e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
94 deletions
+91
-94
include/vlc_codec_synchro.h
include/vlc_codec_synchro.h
+12
-14
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+24
-24
modules/codec/xvmc/xxmc.c
modules/codec/xvmc/xxmc.c
+25
-25
src/Makefile.am
src/Makefile.am
+2
-2
src/input/decoder_synchro.c
src/input/decoder_synchro.c
+28
-29
No files found.
include/vlc_
vout
_synchro.h
→
include/vlc_
codec
_synchro.h
View file @
6546eb71
/*****************************************************************************
* vout_synchro.h: frame-dropping structures
* Only used in libmpeg2 decoder at the moment
* vlc_codec_synchro.h: frame-dropping structures
*****************************************************************************
* Copyright (C) 1999-2005 the VideoLAN team
* $Id$
...
...
@@ -29,9 +28,9 @@
#endif
/*****************************************************************************
*
vout
_synchro_t : timers for the video synchro
*
decoder
_synchro_t : timers for the video synchro
*****************************************************************************/
/* Read the discussion on top of
vout
_synchro.c for more information. */
/* Read the discussion on top of
decoder
_synchro.c for more information. */
/* Pictures types */
#define I_CODING_TYPE 1
#define P_CODING_TYPE 2
...
...
@@ -42,14 +41,13 @@
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define vout_SynchroInit(a,b) __vout_SynchroInit(VLC_OBJECT(a),b)
VLC_EXPORT
(
vout_synchro_t
*
,
__vout_SynchroInit
,
(
vlc_object_t
*
,
int
)
);
VLC_EXPORT
(
void
,
vout_SynchroRelease
,
(
vout_synchro_t
*
)
);
VLC_EXPORT
(
void
,
vout_SynchroReset
,
(
vout_synchro_t
*
)
);
VLC_EXPORT
(
vlc_bool_t
,
vout_SynchroChoose
,
(
vout_synchro_t
*
,
int
,
int
,
vlc_bool_t
)
);
VLC_EXPORT
(
void
,
vout_SynchroTrash
,
(
vout_synchro_t
*
)
);
VLC_EXPORT
(
void
,
vout_SynchroDecode
,
(
vout_synchro_t
*
)
);
VLC_EXPORT
(
void
,
vout_SynchroEnd
,
(
vout_synchro_t
*
,
int
,
vlc_bool_t
)
);
VLC_EXPORT
(
mtime_t
,
vout_SynchroDate
,
(
vout_synchro_t
*
)
);
VLC_EXPORT
(
void
,
vout_SynchroNewPicture
,
(
vout_synchro_t
*
,
int
,
int
,
mtime_t
,
mtime_t
,
int
,
vlc_bool_t
)
);
VLC_EXPORT
(
decoder_synchro_t
*
,
decoder_SynchroInit
,
(
decoder_t
*
,
int
)
);
VLC_EXPORT
(
void
,
decoder_SynchroRelease
,
(
decoder_synchro_t
*
)
);
VLC_EXPORT
(
void
,
decoder_SynchroReset
,
(
decoder_synchro_t
*
)
);
VLC_EXPORT
(
vlc_bool_t
,
decoder_SynchroChoose
,
(
decoder_synchro_t
*
,
int
,
int
,
vlc_bool_t
)
);
VLC_EXPORT
(
void
,
decoder_SynchroTrash
,
(
decoder_synchro_t
*
)
);
VLC_EXPORT
(
void
,
decoder_SynchroDecode
,
(
decoder_synchro_t
*
)
);
VLC_EXPORT
(
void
,
decoder_SynchroEnd
,
(
decoder_synchro_t
*
,
int
,
vlc_bool_t
)
);
VLC_EXPORT
(
mtime_t
,
decoder_SynchroDate
,
(
decoder_synchro_t
*
)
);
VLC_EXPORT
(
void
,
decoder_SynchroNewPicture
,
(
decoder_synchro_t
*
,
int
,
int
,
mtime_t
,
mtime_t
,
int
,
vlc_bool_t
)
);
modules/codec/libmpeg2.c
View file @
6546eb71
...
...
@@ -31,7 +31,7 @@
#include <mpeg2dec/mpeg2.h>
#include <vlc_
vout
_synchro.h>
#include <vlc_
codec
_synchro.h>
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1
/* square pixels */
...
...
@@ -71,7 +71,7 @@ struct decoder_sys_t
/*
* Output properties
*/
vout
_synchro_t
*
p_synchro
;
decoder
_synchro_t
*
p_synchro
;
int
i_aspect
;
int
i_sar_num
;
int
i_sar_den
;
...
...
@@ -228,7 +228,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys
->
p_info
->
sequence
&&
p_sys
->
p_info
->
sequence
->
width
!=
(
unsigned
)
-
1
)
{
vout
_SynchroReset
(
p_sys
->
p_synchro
);
decoder
_SynchroReset
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_info
->
current_fbuf
!=
NULL
&&
p_sys
->
p_info
->
current_fbuf
->
id
!=
NULL
)
{
...
...
@@ -248,11 +248,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_slice_i
)
{
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
}
}
...
...
@@ -264,7 +264,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
p_sys
->
b_preroll
=
VLC_FALSE
;
/* Reset synchro */
vout
_SynchroReset
(
p_sys
->
p_synchro
);
decoder
_SynchroReset
(
p_sys
->
p_synchro
);
}
#ifdef PIC_FLAG_PTS
...
...
@@ -333,9 +333,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
p_synchro
)
{
vout
_SynchroRelease
(
p_sys
->
p_synchro
);
decoder
_SynchroRelease
(
p_sys
->
p_synchro
);
}
p_sys
->
p_synchro
=
vout
_SynchroInit
(
p_dec
,
p_sys
->
p_synchro
=
decoder
_SynchroInit
(
p_dec
,
(
uint32_t
)((
uint64_t
)
1001000000
*
27
/
p_sys
->
p_info
->
sequence
->
frame_period
)
);
p_sys
->
b_after_sequence_header
=
1
;
...
...
@@ -358,11 +358,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
/* Intra-slice refresh. Simulate a blank I picture. */
msg_Dbg
(
p_dec
,
"intra-slice refresh stream"
);
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
p_sys
->
b_slice_i
=
1
;
}
p_sys
->
b_after_sequence_header
=
0
;
...
...
@@ -401,11 +401,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* If nb_fields == 1, it is a field picture, and it will be
* followed by another field picture for which we won't call
*
vout
_SynchroNewPicture() because this would have other
*
decoder
_SynchroNewPicture() because this would have other
* problems, so we take it into account here.
* This kind of sucks, but I didn't think better. --Meuuh
*/
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
p_info
->
current_picture
->
nb_fields
==
1
?
2
:
p_sys
->
p_info
->
current_picture
->
nb_fields
,
i_pts
,
i_dts
,
...
...
@@ -416,7 +416,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
!
(
p_sys
->
b_slice_i
&&
((
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
)
==
P_CODING_TYPE
))
&&
!
vout
_SynchroChoose
(
p_sys
->
p_synchro
,
&&
!
decoder
_SynchroChoose
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
/*p_sys->p_vout->render_time*/
0
/*FIXME*/
,
...
...
@@ -424,14 +424,14 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
1
);
p_sys
->
b_skip
=
1
;
vout
_SynchroTrash
(
p_sys
->
p_synchro
);
decoder
_SynchroTrash
(
p_sys
->
p_synchro
);
mpeg2_set_buf
(
p_sys
->
p_mpeg2dec
,
buf
,
NULL
);
}
else
{
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
0
);
p_sys
->
b_skip
=
0
;
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
if
(
(
p_pic
=
GetNewPicture
(
p_dec
,
buf
))
==
NULL
)
{
...
...
@@ -453,7 +453,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
p_pic
=
(
picture_t
*
)
p_sys
->
p_info
->
display_fbuf
->
id
;
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
display_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
b_garbage_pic
);
...
...
@@ -461,7 +461,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
p_picture_to_destroy
!=
p_pic
)
{
p_pic
->
date
=
vout
_SynchroDate
(
p_sys
->
p_synchro
);
p_pic
->
date
=
decoder
_SynchroDate
(
p_sys
->
p_synchro
);
}
else
{
...
...
@@ -502,7 +502,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
(
(
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
)
!=
B_CODING_TYPE
)
)
{
if
(
p_sys
->
p_synchro
)
vout
_SynchroReset
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_synchro
)
decoder
_SynchroReset
(
p_sys
->
p_synchro
);
}
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
1
);
p_sys
->
b_skip
=
1
;
...
...
@@ -538,11 +538,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_slice_i
)
{
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
}
break
;
}
...
...
@@ -564,7 +564,7 @@ static void CloseDecoder( vlc_object_t *p_this )
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_sys
->
p_synchro
)
vout
_SynchroRelease
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_synchro
)
decoder
_SynchroRelease
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_mpeg2dec
)
mpeg2_close
(
p_sys
->
p_mpeg2dec
);
...
...
modules/codec/xvmc/xxmc.c
View file @
6546eb71
...
...
@@ -28,7 +28,7 @@
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_
vout
_synchro.h>
#include <vlc_
codec
_synchro.h>
#include <unistd.h>
#include <mcheck.h>
...
...
@@ -74,7 +74,7 @@ struct decoder_sys_t
/*
* Output properties
*/
vout
_synchro_t
*
p_synchro
;
decoder
_synchro_t
*
p_synchro
;
int
i_aspect
;
mtime_t
i_last_frame_pts
;
...
...
@@ -251,7 +251,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys
->
p_info
->
sequence
&&
p_sys
->
p_info
->
sequence
->
width
!=
(
unsigned
int
)
-
1
)
{
vout
_SynchroReset
(
p_sys
->
p_synchro
);
decoder
_SynchroReset
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_info
->
current_fbuf
!=
NULL
&&
p_sys
->
p_info
->
current_fbuf
->
id
!=
NULL
)
{
...
...
@@ -270,11 +270,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_slice_i
)
{
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
}
}
...
...
@@ -377,9 +377,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
p_synchro
)
{
vout
_SynchroRelease
(
p_sys
->
p_synchro
);
decoder
_SynchroRelease
(
p_sys
->
p_synchro
);
}
p_sys
->
p_synchro
=
vout
_SynchroInit
(
p_dec
,
p_sys
->
p_synchro
=
decoder
_SynchroInit
(
p_dec
,
(
uint32_t
)((
uint64_t
)
1001000000
*
27
/
p_sys
->
p_info
->
sequence
->
frame_period
)
);
p_sys
->
b_after_sequence_header
=
1
;
...
...
@@ -387,7 +387,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
break
;
case
STATE_PICTURE_2ND
:
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
p_info
->
current_picture
->
nb_fields
,
0
,
0
,
p_sys
->
i_current_rate
,
...
...
@@ -395,11 +395,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_skip
)
{
vout
_SynchroTrash
(
p_sys
->
p_synchro
);
decoder
_SynchroTrash
(
p_sys
->
p_synchro
);
}
else
{
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
}
break
;
...
...
@@ -415,11 +415,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
/* Intra-slice refresh. Simulate a blank I picture. */
msg_Dbg
(
p_dec
,
"intra-slice refresh stream"
);
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
p_sys
->
b_slice_i
=
1
;
}
p_sys
->
b_after_sequence_header
=
0
;
...
...
@@ -448,7 +448,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block
->
i_pts
=
p_block
->
i_dts
=
0
;
/* End hack */
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
p_info
->
current_picture
->
nb_fields
,
i_pts
,
0
,
p_sys
->
i_current_rate
,
...
...
@@ -457,7 +457,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
!
(
p_sys
->
b_slice_i
&&
((
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
)
==
P_CODING_TYPE
))
&&
!
vout
_SynchroChoose
(
p_sys
->
p_synchro
,
&&
!
decoder
_SynchroChoose
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
/*FindVout(p_dec)->render_time*/
0
/*FIXME*/
,
...
...
@@ -465,14 +465,14 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
1
);
p_sys
->
b_skip
=
1
;
vout
_SynchroTrash
(
p_sys
->
p_synchro
);
decoder
_SynchroTrash
(
p_sys
->
p_synchro
);
mpeg2_set_buf
(
p_sys
->
p_mpeg2dec
,
buf
,
NULL
);
}
else
{
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
0
);
p_sys
->
b_skip
=
0
;
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
if
(
(
p_pic
=
GetNewPicture
(
p_dec
,
buf
))
==
NULL
)
{
...
...
@@ -506,7 +506,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
p_pic
=
(
picture_t
*
)
p_sys
->
p_info
->
display_fbuf
->
id
;
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
display_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
b_garbage_pic
);
...
...
@@ -514,7 +514,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
p_picture_to_destroy
!=
p_pic
)
{
p_pic
->
date
=
vout
_SynchroDate
(
p_sys
->
p_synchro
);
p_pic
->
date
=
decoder
_SynchroDate
(
p_sys
->
p_synchro
);
}
else
{
...
...
@@ -553,7 +553,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
(
(
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
)
!=
B_CODING_TYPE
)
)
{
if
(
p_sys
->
p_synchro
)
vout
_SynchroReset
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_synchro
)
decoder
_SynchroReset
(
p_sys
->
p_synchro
);
}
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
1
);
p_sys
->
b_skip
=
1
;
...
...
@@ -588,11 +588,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_slice_i
)
{
vout
_SynchroNewPicture
(
p_sys
->
p_synchro
,
decoder
_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout
_SynchroDecode
(
p_sys
->
p_synchro
);
vout
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
decoder
_SynchroDecode
(
p_sys
->
p_synchro
);
decoder
_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
}
break
;
}
...
...
@@ -613,7 +613,7 @@ static void CloseDecoder( vlc_object_t *p_this )
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
FILE
*
f_wd_dec
;
if
(
p_sys
->
p_synchro
)
vout
_SynchroRelease
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_synchro
)
decoder
_SynchroRelease
(
p_sys
->
p_synchro
);
if
(
p_sys
->
p_mpeg2dec
)
mpeg2_close
(
p_sys
->
p_mpeg2dec
);
f_wd_dec
=
fopen
(
"/vlc/dec_pid"
,
"w"
);
...
...
src/Makefile.am
View file @
6546eb71
...
...
@@ -39,6 +39,7 @@ HEADERS_include = \
../include/vlc_block_helper.h
\
../include/vlc_charset.h
\
../include/vlc_codec.h
\
../include/vlc_codec_synchro.h
\
../include/vlc_codecs.h
\
../include/vlc_common.h
\
../include/vlc_config.h
\
...
...
@@ -82,7 +83,6 @@ HEADERS_include = \
../include/vlc_vlm.h
\
../include/vlc_vod.h
\
../include/vlc_vout.h
\
../include/vlc_vout_synchro.h
\
../include/vlc_xml.h
\
$(NULL)
...
...
@@ -223,6 +223,7 @@ SOURCES_libvlc_common = \
input/clock.c
\
input/control.c
\
input/decoder.c
\
input/decoder_synchro.c
\
input/demux.c
\
input/es_out.c
\
input/input.c
\
...
...
@@ -239,7 +240,6 @@ SOURCES_libvlc_common = \
video_output/video_text.c
\
video_output/video_widgets.c
\
video_output/vout_subpictures.c
\
video_output/vout_synchro.c
\
video_output/vout_intf.c
\
audio_output/aout_internal.h
\
audio_output/common.c
\
...
...
src/
video_output/vout
_synchro.c
→
src/
input/decoder
_synchro.c
View file @
6546eb71
/*****************************************************************************
*
vout
_synchro.c : frame dropping routines
*
decoder
_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999-2005 the VideoLAN team
* $Id$
...
...
@@ -95,9 +95,8 @@
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_input.h>
#include <vlc_
vout
_synchro.h>
#include <vlc_
codec
_synchro.h>
/*
* Local prototypes
...
...
@@ -105,7 +104,7 @@
#define MAX_PIC_AVERAGE 8
struct
vout
_synchro_t
struct
decoder
_synchro_t
{
VLC_COMMON_MEMBERS
...
...
@@ -152,22 +151,22 @@ struct vout_synchro_t
#define DEFAULT_NB_B 1
/*****************************************************************************
*
vout
_SynchroInit : You know what ?
*
decoder
_SynchroInit : You know what ?
*****************************************************************************/
vout_synchro_t
*
__vout_SynchroInit
(
vlc_object_t
*
p_object
,
decoder_synchro_t
*
decoder_SynchroInit
(
decoder_t
*
p_dec
,
int
i_frame_rate
)
{
vout_synchro_t
*
p_synchro
=
vlc_object_create
(
p_object
,
sizeof
(
vout
_synchro_t
)
);
decoder_synchro_t
*
p_synchro
=
vlc_object_create
(
p_dec
,
sizeof
(
decoder
_synchro_t
)
);
if
(
p_synchro
==
NULL
)
{
msg_Err
(
p_
object
,
"out of memory"
);
msg_Err
(
p_
dec
,
"out of memory"
);
return
NULL
;
}
vlc_object_attach
(
p_synchro
,
p_
object
);
vlc_object_attach
(
p_synchro
,
p_
dec
);
p_synchro
->
b_no_skip
=
!
config_GetInt
(
p_
object
,
"skip-frames"
);
p_synchro
->
b_quiet
=
config_GetInt
(
p_
object
,
"quiet-synchro"
);
p_synchro
->
b_no_skip
=
!
config_GetInt
(
p_
dec
,
"skip-frames"
);
p_synchro
->
b_quiet
=
config_GetInt
(
p_
dec
,
"quiet-synchro"
);
/* We use a fake stream pattern, which is often right. */
p_synchro
->
i_n_p
=
p_synchro
->
i_eta_p
=
DEFAULT_NB_P
;
...
...
@@ -188,27 +187,27 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
}
/*****************************************************************************
*
vout
_SynchroRelease : You know what ?
*
decoder
_SynchroRelease : You know what ?
*****************************************************************************/
void
vout_SynchroRelease
(
vout
_synchro_t
*
p_synchro
)
void
decoder_SynchroRelease
(
decoder
_synchro_t
*
p_synchro
)
{
vlc_object_detach
(
p_synchro
);
vlc_object_destroy
(
p_synchro
);
}
/*****************************************************************************
*
vout
_SynchroReset : Reset the reference picture counter
*
decoder
_SynchroReset : Reset the reference picture counter
*****************************************************************************/
void
vout_SynchroReset
(
vout
_synchro_t
*
p_synchro
)
void
decoder_SynchroReset
(
decoder
_synchro_t
*
p_synchro
)
{
p_synchro
->
i_nb_ref
=
0
;
p_synchro
->
i_trash_nb_ref
=
p_synchro
->
i_dec_nb_ref
=
0
;
}
/*****************************************************************************
*
vout
_SynchroChoose : Decide whether we will decode a picture or not
*
decoder
_SynchroChoose : Decide whether we will decode a picture or not
*****************************************************************************/
vlc_bool_t
vout_SynchroChoose
(
vout
_synchro_t
*
p_synchro
,
int
i_coding_type
,
vlc_bool_t
decoder_SynchroChoose
(
decoder
_synchro_t
*
p_synchro
,
int
i_coding_type
,
int
i_render_time
,
vlc_bool_t
b_low_delay
)
{
#define TAU_PRIME( coding_type ) (p_synchro->p_tau[(coding_type)] \
...
...
@@ -335,27 +334,27 @@ vlc_bool_t vout_SynchroChoose( vout_synchro_t * p_synchro, int i_coding_type,
}
/*****************************************************************************
*
vout
_SynchroTrash : Update counters when we trash a picture
*
decoder
_SynchroTrash : Update counters when we trash a picture
*****************************************************************************/
void
vout_SynchroTrash
(
vout
_synchro_t
*
p_synchro
)
void
decoder_SynchroTrash
(
decoder
_synchro_t
*
p_synchro
)
{
p_synchro
->
i_trashed_pic
++
;
p_synchro
->
i_nb_ref
=
p_synchro
->
i_trash_nb_ref
;
}
/*****************************************************************************
*
vout
_SynchroDecode : Update timers when we decide to decode a picture
*
decoder
_SynchroDecode : Update timers when we decide to decode a picture
*****************************************************************************/
void
vout_SynchroDecode
(
vout
_synchro_t
*
p_synchro
)
void
decoder_SynchroDecode
(
decoder
_synchro_t
*
p_synchro
)
{
p_synchro
->
decoding_start
=
mdate
();
p_synchro
->
i_nb_ref
=
p_synchro
->
i_dec_nb_ref
;
}
/*****************************************************************************
*
vout
_SynchroEnd : Called when the image is totally decoded
*
decoder
_SynchroEnd : Called when the image is totally decoded
*****************************************************************************/
void
vout_SynchroEnd
(
vout
_synchro_t
*
p_synchro
,
int
i_coding_type
,
void
decoder_SynchroEnd
(
decoder
_synchro_t
*
p_synchro
,
int
i_coding_type
,
vlc_bool_t
b_garbage
)
{
mtime_t
tau
;
...
...
@@ -384,18 +383,18 @@ void vout_SynchroEnd( vout_synchro_t * p_synchro, int i_coding_type,
}
/*****************************************************************************
*
vout
_SynchroDate : When an image has been decoded, ask for its date
*
decoder
_SynchroDate : When an image has been decoded, ask for its date
*****************************************************************************/
mtime_t
vout_SynchroDate
(
vout
_synchro_t
*
p_synchro
)
mtime_t
decoder_SynchroDate
(
decoder
_synchro_t
*
p_synchro
)
{
/* No need to lock, since PTS are only used by the video parser. */
return
p_synchro
->
current_pts
;
}
/*****************************************************************************
*
vout
_SynchroNewPicture: Update stream structure and PTS
*
decoder
_SynchroNewPicture: Update stream structure and PTS
*****************************************************************************/
void
vout_SynchroNewPicture
(
vout
_synchro_t
*
p_synchro
,
int
i_coding_type
,
void
decoder_SynchroNewPicture
(
decoder
_synchro_t
*
p_synchro
,
int
i_coding_type
,
int
i_repeat_field
,
mtime_t
next_pts
,
mtime_t
next_dts
,
int
i_current_rate
,
vlc_bool_t
b_low_delay
)
...
...
@@ -501,7 +500,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
||
p_synchro
->
current_pts
-
next_pts
>
PTS_THRESHOLD
)
&&
!
p_synchro
->
b_quiet
)
{
msg_Warn
(
p_synchro
,
"
vout
synchro warning: pts != "
msg_Warn
(
p_synchro
,
"
decoder
synchro warning: pts != "
"current_date ("
I64Fd
")"
,
p_synchro
->
current_pts
-
next_pts
);
...
...
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