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
4bcf1bae
Commit
4bcf1bae
authored
Jan 15, 2001
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Implemented video_parser bitstream callback for PTS/DTS.
parent
420ec3aa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
52 deletions
+55
-52
src/video_decoder/video_parser.h
src/video_decoder/video_parser.h
+1
-3
src/video_decoder/vpar_headers.h
src/video_decoder/vpar_headers.h
+2
-1
src/video_parser/video_parser.c
src/video_parser/video_parser.c
+23
-6
src/video_parser/vpar_synchro.c
src/video_parser/vpar_synchro.c
+29
-42
No files found.
src/video_decoder/video_parser.h
View file @
4bcf1bae
...
...
@@ -2,7 +2,7 @@
* video_parser.h : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.
3 2001/01/13 12:57:20 sam
Exp $
* $Id: video_parser.h,v 1.
4 2001/01/15 13:25:09 massiot
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -95,8 +95,6 @@ typedef struct vpar_thread_s
decoder_fifo_t
*
p_fifo
;
/* PES input fifo */
bit_stream_t
bit_stream
;
vdec_config_t
*
p_config
;
/* Bitstream context */
mtime_t
next_pts
,
next_dts
;
/* Output properties */
vout_thread_t
*
p_vout
;
/* video output thread */
...
...
src/video_decoder/vpar_headers.h
View file @
4bcf1bae
...
...
@@ -2,7 +2,7 @@
* vpar_headers.h : video parser : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.h,v 1.
1 2000/12/21 17:19:52
massiot Exp $
* $Id: vpar_headers.h,v 1.
2 2001/01/15 13:25:09
massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
...
...
@@ -82,6 +82,7 @@ typedef struct sequence_s
/* Parser context */
picture_t
*
p_forward
;
/* current forward reference frame */
picture_t
*
p_backward
;
/* current backward reference frame */
mtime_t
next_pts
,
next_dts
;
/* Copyright extension */
boolean_t
b_copyright_flag
;
/* Whether the following
...
...
src/video_parser/video_parser.c
View file @
4bcf1bae
...
...
@@ -2,7 +2,7 @@
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.6
6 2001/01/13 12:57:21 sam
Exp $
* $Id: video_parser.c,v 1.6
7 2001/01/15 13:25:09 massiot
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
...
...
@@ -70,7 +70,8 @@ static int InitThread ( vpar_thread_t *p_vpar );
static
void
RunThread
(
vpar_thread_t
*
p_vpar
);
static
void
ErrorThread
(
vpar_thread_t
*
p_vpar
);
static
void
EndThread
(
vpar_thread_t
*
p_vpar
);
static
void
BitstreamCallback
(
bit_stream_t
*
p_bit_stream
);
static
void
BitstreamCallback
(
bit_stream_t
*
p_bit_stream
,
boolean_t
b_new_pes
);
/*****************************************************************************
* vpar_CreateThread: create a generic parser thread
...
...
@@ -150,6 +151,8 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar
->
p_config
->
decoder_config
.
pf_init_bit_stream
(
&
p_vpar
->
bit_stream
,
p_vpar
->
p_config
->
decoder_config
.
p_decoder_fifo
);
p_vpar
->
bit_stream
.
pf_bitstream_callback
=
BitstreamCallback
;
p_vpar
->
bit_stream
.
p_callback_arg
=
(
void
*
)
p_vpar
;
/* Initialize parsing data */
p_vpar
->
sequence
.
p_forward
=
NULL
;
...
...
@@ -158,7 +161,8 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar
->
sequence
.
nonintra_quant
.
b_allocated
=
0
;
p_vpar
->
sequence
.
chroma_intra_quant
.
b_allocated
=
0
;
p_vpar
->
sequence
.
chroma_nonintra_quant
.
b_allocated
=
0
;
/* FIXME : initialize matrix_coefficients, but to what value ? */
p_vpar
->
sequence
.
i_matrix_coefficients
=
1
;
p_vpar
->
sequence
.
next_pts
=
p_vpar
->
sequence
.
next_dts
=
0
;
/* Initialize copyright information */
p_vpar
->
sequence
.
b_copyright_flag
=
0
;
...
...
@@ -205,12 +209,14 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar
->
pp_vdec
[
0
]
->
b_error
=
0
;
p_vpar
->
pp_vdec
[
0
]
->
p_vpar
=
p_vpar
;
# if VDEC_NICE
/* Re-nice ourself */
if
(
nice
(
VDEC_NICE
)
==
-
1
)
{
intf_WarnMsg
(
2
,
"vpar warning : couldn't nice() (%s)"
,
strerror
(
errno
)
);
}
# endif
#endif
/* Initialize lookup tables */
...
...
@@ -436,7 +442,18 @@ static void EndThread( vpar_thread_t *p_vpar )
/*****************************************************************************
* BitstreamCallback: Import parameters from the new data/PES packet
*****************************************************************************
* This function is called when the thread ends after a sucessful
* initialization.
* This function is called by input's NextDataPacket.
*****************************************************************************/
static
void
BitstreamCallback
(
bit_stream_t
*
p_bit_stream
);
static
void
BitstreamCallback
(
bit_stream_t
*
p_bit_stream
,
boolean_t
b_new_pes
)
{
vpar_thread_t
*
p_vpar
=
(
vpar_thread_t
*
)
p_bit_stream
->
p_callback_arg
;
if
(
b_new_pes
)
{
p_vpar
->
sequence
.
next_pts
=
DECODER_FIFO_START
(
*
p_bit_stream
->
p_decoder_fifo
)
->
i_pts
;
p_vpar
->
sequence
.
next_dts
=
DECODER_FIFO_START
(
*
p_bit_stream
->
p_decoder_fifo
)
->
i_dts
;
}
}
src/video_parser/vpar_synchro.c
View file @
4bcf1bae
...
...
@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.c,v 1.7
1 2001/01/13 12:57:21 sam
Exp $
* $Id: vpar_synchro.c,v 1.7
2 2001/01/15 13:25:09 massiot
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
...
...
@@ -421,7 +421,6 @@ mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar )
void
vpar_SynchroNewPicture
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
boolean_t
b_repeat_field
)
{
pes_packet_t
*
p_pes
;
mtime_t
period
=
1000000
/
(
p_vpar
->
sequence
.
i_frame_rate
)
*
1001
;
switch
(
i_coding_type
)
...
...
@@ -470,9 +469,6 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
break
;
}
/* FIXME: use decoder_fifo callback */
p_pes
=
DECODER_FIFO_START
(
*
p_vpar
->
bit_stream
.
p_decoder_fifo
);
if
(
b_repeat_field
)
{
/* MPEG-2 repeat_first_field */
...
...
@@ -487,30 +483,36 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
if
(
i_coding_type
==
B_CODING_TYPE
)
{
if
(
p_
pes
->
i
_pts
)
if
(
p_
vpar
->
sequence
.
next
_pts
)
{
if
(
p_pes
->
i_pts
-
p_vpar
->
synchro
.
current_pts
>
PTS_THRESHOLD
||
p_vpar
->
synchro
.
current_pts
-
p_pes
->
i_pts
>
PTS_THRESHOLD
)
if
(
p_vpar
->
sequence
.
next_pts
-
p_vpar
->
synchro
.
current_pts
>
PTS_THRESHOLD
||
p_vpar
->
synchro
.
current_pts
-
p_vpar
->
sequence
.
next_pts
>
PTS_THRESHOLD
)
{
intf_WarnMsg
(
2
,
"vpar synchro warning: pts != current_date (%lld)"
,
p_vpar
->
synchro
.
current_pts
-
p_pes
->
i_pts
);
p_vpar
->
synchro
.
current_pts
-
p_vpar
->
sequence
.
next_pts
);
}
p_vpar
->
synchro
.
current_pts
=
p_
pes
->
i
_pts
;
p_
pes
->
i
_pts
=
0
;
p_vpar
->
synchro
.
current_pts
=
p_
vpar
->
sequence
.
next
_pts
;
p_
vpar
->
sequence
.
next
_pts
=
0
;
}
}
else
{
if
(
p_vpar
->
synchro
.
backward_pts
)
{
if
(
p_pes
->
i_dts
&&
(
p_pes
->
i_dts
-
p_vpar
->
synchro
.
backward_pts
>
PTS_THRESHOLD
||
p_vpar
->
synchro
.
backward_pts
-
p_pes
->
i_dts
>
PTS_THRESHOLD
)
)
if
(
p_vpar
->
sequence
.
next_dts
&&
(
p_vpar
->
sequence
.
next_dts
-
p_vpar
->
synchro
.
backward_pts
>
PTS_THRESHOLD
||
p_vpar
->
synchro
.
backward_pts
-
p_vpar
->
sequence
.
next_dts
>
PTS_THRESHOLD
)
)
{
intf_WarnMsg
(
2
,
"vpar synchro warning: backward_pts != dts (%lld)"
,
p_vpar
->
synchro
.
backward_pts
-
p_pes
->
i_dts
);
p_vpar
->
synchro
.
backward_pts
-
p_vpar
->
sequence
.
next_dts
);
}
if
(
p_vpar
->
synchro
.
backward_pts
-
p_vpar
->
synchro
.
current_pts
...
...
@@ -525,43 +527,28 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
p_vpar
->
synchro
.
current_pts
=
p_vpar
->
synchro
.
backward_pts
;
p_vpar
->
synchro
.
backward_pts
=
0
;
}
else
if
(
p_
pes
->
i
_dts
)
else
if
(
p_
vpar
->
sequence
.
next
_dts
)
{
if
(
p_pes
->
i_dts
-
p_vpar
->
synchro
.
current_pts
>
PTS_THRESHOLD
||
p_vpar
->
synchro
.
current_pts
-
p_pes
->
i_dts
>
PTS_THRESHOLD
)
if
(
p_vpar
->
sequence
.
next_dts
-
p_vpar
->
synchro
.
current_pts
>
PTS_THRESHOLD
||
p_vpar
->
synchro
.
current_pts
-
p_vpar
->
sequence
.
next_dts
>
PTS_THRESHOLD
)
{
intf_WarnMsg
(
2
,
"vpar synchro warning: dts != current_pts (%lld)"
,
p_vpar
->
synchro
.
current_pts
-
p_pes
->
i_dts
);
p_vpar
->
synchro
.
current_pts
-
p_vpar
->
sequence
.
next_dts
);
}
/* By definition of a DTS. */
p_vpar
->
synchro
.
current_pts
=
p_
pes
->
i
_dts
;
p_
pes
->
i
_dts
=
0
;
p_vpar
->
synchro
.
current_pts
=
p_
vpar
->
sequence
.
next
_dts
;
p_
vpar
->
sequence
.
next
_dts
=
0
;
}
if
(
p_
pes
->
i
_pts
)
if
(
p_
vpar
->
sequence
.
next
_pts
)
{
#if 0
int i_n_b;
#endif
/* Store the PTS for the next time we have to date an I picture. */
p_vpar
->
synchro
.
backward_pts
=
p_pes
->
i_pts
;
p_pes
->
i_pts
=
0
;
/* FIXME : disabled because it conflicts with streams having
* b_repeat_first_field */
#if 0
i_n_b = (p_vpar->synchro.backward_pts
- p_vpar->synchro.current_pts) / period - 1;
if( i_n_b != p_vpar->synchro.i_n_b )
{
intf_WarnMsg( 1,
"Anticipating a stream periodicity change from"
" B[%d] to B[%d]",
p_vpar->synchro.i_n_b, i_n_b );
p_vpar->synchro.i_n_b = i_n_b;
}
#endif
p_vpar
->
synchro
.
backward_pts
=
p_vpar
->
sequence
.
next_pts
;
p_vpar
->
sequence
.
next_pts
=
0
;
}
}
...
...
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