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
c1094d99
Commit
c1094d99
authored
Jan 31, 2000
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Synchro de base.
parent
2f30d77a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
0 deletions
+151
-0
include/vpar_synchro.h
include/vpar_synchro.h
+13
-0
src/video_parser/video_parser.c
src/video_parser/video_parser.c
+8
-0
src/video_parser/vpar_headers.c
src/video_parser/vpar_headers.c
+12
-0
src/video_parser/vpar_synchro.c
src/video_parser/vpar_synchro.c
+118
-0
No files found.
include/vpar_synchro.h
View file @
c1094d99
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
/*****************************************************************************
/*****************************************************************************
* video_synchro_t and video_synchro_tab_s : timers for the video synchro
* video_synchro_t and video_synchro_tab_s : timers for the video synchro
*****************************************************************************/
*****************************************************************************/
#if 0
typedef struct video_synchro_tab_s
typedef struct video_synchro_tab_s
{
{
double mean;
double mean;
...
@@ -77,6 +78,18 @@ typedef struct video_synchro_s
...
@@ -77,6 +78,18 @@ typedef struct video_synchro_s
double actual_fps;
double actual_fps;
} video_synchro_t;
} video_synchro_t;
#else
typedef
struct
video_synchro_s
{
int
kludge_level
,
kludge_p
,
kludge_b
,
kludge_nbp
,
kludge_nbb
;
int
kludge_nbframes
;
mtime_t
kludge_date
,
kludge_prevdate
;
int
i_coding_type
;
}
video_synchro_t
;
#define SYNC_TOLERATE 10000
/* 10 ms */
#define SYNC_DELAY 100000
#endif
/*****************************************************************************
/*****************************************************************************
* Prototypes
* Prototypes
...
...
src/video_parser/video_parser.c
View file @
c1094d99
...
@@ -245,6 +245,7 @@ static int InitThread( vpar_thread_t *p_vpar )
...
@@ -245,6 +245,7 @@ static int InitThread( vpar_thread_t *p_vpar )
/*
/*
* Initialize the synchro properties
* Initialize the synchro properties
*/
*/
#if 0
p_vpar->synchro.i_last_decode_pts = 0;
p_vpar->synchro.i_last_decode_pts = 0;
p_vpar->synchro.i_last_display_pts = 0;
p_vpar->synchro.i_last_display_pts = 0;
p_vpar->synchro.i_images_since_pts = 0;
p_vpar->synchro.i_images_since_pts = 0;
...
@@ -280,6 +281,13 @@ static int InitThread( vpar_thread_t *p_vpar )
...
@@ -280,6 +281,13 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->synchro.tab_b[i_dummy].mean = 6;
p_vpar->synchro.tab_b[i_dummy].mean = 6;
p_vpar->synchro.tab_b[i_dummy].deviation = .5;
p_vpar->synchro.tab_b[i_dummy].deviation = .5;
}
}
#else
p_vpar
->
synchro
.
kludge_level
=
5
;
p_vpar
->
synchro
.
kludge_nbp
=
p_vpar
->
synchro
.
kludge_p
=
5
;
p_vpar
->
synchro
.
kludge_nbb
=
p_vpar
->
synchro
.
kludge_b
=
6
;
p_vpar
->
synchro
.
kludge_b
=
0
;
p_vpar
->
synchro
.
kludge_prevdate
=
0
;
#endif
/* Mark thread as running and return */
/* Mark thread as running and return */
intf_DbgMsg
(
"vpar debug: InitThread(%p) succeeded
\n
"
,
p_vpar
);
intf_DbgMsg
(
"vpar debug: InitThread(%p) succeeded
\n
"
,
p_vpar
);
...
...
src/video_parser/vpar_headers.c
View file @
c1094d99
...
@@ -156,13 +156,25 @@ static void __inline__ ReferenceUpdate( vpar_thread_t * p_vpar,
...
@@ -156,13 +156,25 @@ static void __inline__ ReferenceUpdate( vpar_thread_t * p_vpar,
vout_UnlinkPicture
(
p_vpar
->
p_vout
,
p_vpar
->
sequence
.
p_forward
);
vout_UnlinkPicture
(
p_vpar
->
p_vout
,
p_vpar
->
sequence
.
p_forward
);
if
(
p_vpar
->
sequence
.
p_backward
!=
NULL
)
if
(
p_vpar
->
sequence
.
p_backward
!=
NULL
)
{
{
#if 0
vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward,
vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward,
vpar_SynchroDate( p_vpar ) );
vpar_SynchroDate( p_vpar ) );
#else
mtime_t
date
;
date
=
vpar_SynchroDate
(
p_vpar
);
vout_DatePicture
(
p_vpar
->
p_vout
,
p_vpar
->
sequence
.
p_backward
,
date
);
if
(
p_vpar
->
synchro
.
i_coding_type
==
I_CODING_TYPE
)
vpar_SynchroKludge
(
p_vpar
,
date
);
#endif
}
}
p_vpar
->
sequence
.
p_forward
=
p_vpar
->
sequence
.
p_backward
;
p_vpar
->
sequence
.
p_forward
=
p_vpar
->
sequence
.
p_backward
;
p_vpar
->
sequence
.
p_backward
=
p_newref
;
p_vpar
->
sequence
.
p_backward
=
p_newref
;
if
(
p_newref
!=
NULL
)
if
(
p_newref
!=
NULL
)
vout_LinkPicture
(
p_vpar
->
p_vout
,
p_newref
);
vout_LinkPicture
(
p_vpar
->
p_vout
,
p_newref
);
#if 1
p_vpar
->
synchro
.
i_coding_type
=
i_coding_type
;
#endif
}
}
else
if
(
p_newref
!=
NULL
)
else
if
(
p_newref
!=
NULL
)
{
{
...
...
src/video_parser/vpar_synchro.c
View file @
c1094d99
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
* Local prototypes
* Local prototypes
*/
*/
#if 0
/*****************************************************************************
/*****************************************************************************
* vpar_SynchroUpdateTab : Update a mean table in the synchro structure
* vpar_SynchroUpdateTab : Update a mean table in the synchro structure
*****************************************************************************/
*****************************************************************************/
...
@@ -398,3 +399,120 @@ mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar )
...
@@ -398,3 +399,120 @@ mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar )
return i_displaydate;
return i_displaydate;
}
}
#else
/* synchro a deux balles backportee du decodeur de reference. NE MARCHE PAS
AVEC LES IMAGES MONOTRAMES */
boolean_t
vpar_SynchroChoose
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
int
i_structure
)
{
switch
(
i_coding_type
)
{
case
B_CODING_TYPE
:
if
((
p_vpar
->
synchro
.
kludge_level
<=
p_vpar
->
synchro
.
kludge_nbp
))
{
p_vpar
->
synchro
.
kludge_b
++
;
return
(
0
);
}
if
(
p_vpar
->
synchro
.
kludge_b
%
(
p_vpar
->
synchro
.
kludge_nbb
/
(
p_vpar
->
synchro
.
kludge_level
-
p_vpar
->
synchro
.
kludge_nbp
)))
{
p_vpar
->
synchro
.
kludge_b
++
;
return
(
0
);
}
p_vpar
->
synchro
.
kludge_b
++
;
return
(
1
);
case
P_CODING_TYPE
:
if
(
p_vpar
->
synchro
.
kludge_p
++
>=
p_vpar
->
synchro
.
kludge_level
)
{
return
(
0
);
}
return
(
1
);
default:
return
(
1
);
}
}
void
vpar_SynchroTrash
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
int
i_structure
)
{
if
(
DECODER_FIFO_START
(
p_vpar
->
fifo
)
->
b_has_pts
)
{
p_vpar
->
synchro
.
kludge_nbframes
=
0
;
p_vpar
->
synchro
.
kludge_date
=
DECODER_FIFO_START
(
p_vpar
->
fifo
)
->
i_pts
;
DECODER_FIFO_START
(
p_vpar
->
fifo
)
->
b_has_pts
=
0
;
}
else
p_vpar
->
synchro
.
kludge_nbframes
++
;
}
void
vpar_SynchroDecode
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
int
i_structure
)
{
if
(
DECODER_FIFO_START
(
p_vpar
->
fifo
)
->
b_has_pts
)
{
p_vpar
->
synchro
.
kludge_nbframes
=
0
;
p_vpar
->
synchro
.
kludge_date
=
DECODER_FIFO_START
(
p_vpar
->
fifo
)
->
i_pts
;
DECODER_FIFO_START
(
p_vpar
->
fifo
)
->
b_has_pts
=
0
;
}
else
p_vpar
->
synchro
.
kludge_nbframes
++
;
}
mtime_t
vpar_SynchroDate
(
vpar_thread_t
*
p_vpar
)
{
return
(
p_vpar
->
synchro
.
kludge_date
+
p_vpar
->
synchro
.
kludge_nbframes
*
1000000
/
(
p_vpar
->
sequence
.
r_frame_rate
)
);
}
void
vpar_SynchroEnd
(
vpar_thread_t
*
p_vpar
)
{
}
void
vpar_SynchroKludge
(
vpar_thread_t
*
p_vpar
,
mtime_t
date
)
{
mtime_t
show_date
;
int
temp
=
p_vpar
->
synchro
.
kludge_level
;
p_vpar
->
synchro
.
kludge_nbp
=
p_vpar
->
synchro
.
kludge_p
?
p_vpar
->
synchro
.
kludge_p
:
5
;
p_vpar
->
synchro
.
kludge_nbb
=
p_vpar
->
synchro
.
kludge_b
?
p_vpar
->
synchro
.
kludge_b
:
6
;
show_date
=
date
-
mdate
();
p_vpar
->
synchro
.
kludge_p
=
0
;
p_vpar
->
synchro
.
kludge_b
=
0
;
if
(
show_date
<
(
SYNC_DELAY
-
SYNC_TOLERATE
)
&&
show_date
<=
p_vpar
->
synchro
.
kludge_prevdate
)
{
p_vpar
->
synchro
.
kludge_level
--
;
if
(
p_vpar
->
synchro
.
kludge_level
<
0
)
p_vpar
->
synchro
.
kludge_level
=
0
;
else
if
(
p_vpar
->
synchro
.
kludge_level
>
p_vpar
->
synchro
.
kludge_nbp
+
p_vpar
->
synchro
.
kludge_nbb
)
p_vpar
->
synchro
.
kludge_level
=
p_vpar
->
synchro
.
kludge_nbp
+
p_vpar
->
synchro
.
kludge_nbb
;
#ifdef DEBUG
if
(
temp
!=
p_vpar
->
synchro
.
kludge_level
)
intf_DbgMsg
(
"vdec debug: Level changed from %d to %d (%Ld)
\n
"
,
temp
,
p_vpar
->
synchro
.
kludge_level
,
show_date
);
#endif
}
else
if
(
show_date
>
(
SYNC_DELAY
+
SYNC_TOLERATE
)
&&
show_date
>=
p_vpar
->
synchro
.
kludge_prevdate
)
{
p_vpar
->
synchro
.
kludge_level
++
;
if
(
p_vpar
->
synchro
.
kludge_level
>
p_vpar
->
synchro
.
kludge_nbp
+
p_vpar
->
synchro
.
kludge_nbb
)
p_vpar
->
synchro
.
kludge_level
=
p_vpar
->
synchro
.
kludge_nbp
+
p_vpar
->
synchro
.
kludge_nbb
;
#ifdef DEBUG
if
(
temp
!=
p_vpar
->
synchro
.
kludge_level
)
intf_DbgMsg
(
"vdec debug: Level changed from %d to %d (%Ld)
\n
"
,
temp
,
p_vpar
->
synchro
.
kludge_level
,
show_date
);
#endif
}
p_vpar
->
synchro
.
kludge_prevdate
=
show_date
;
if
((
p_vpar
->
synchro
.
kludge_level
-
p_vpar
->
synchro
.
kludge_nbp
)
>
p_vpar
->
synchro
.
kludge_nbb
)
p_vpar
->
synchro
.
kludge_level
=
p_vpar
->
synchro
.
kludge_nbb
+
p_vpar
->
synchro
.
kludge_nbp
;
}
#endif
\ No newline at end of file
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