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
54e5b4ce
Commit
54e5b4ce
authored
Jul 21, 2002
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all : try to add an option to allow frame droppping (
--enable-hurry-up ). Begin to work.
parent
9697b479
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
7 deletions
+61
-7
plugins/ffmpeg/ffmpeg.c
plugins/ffmpeg/ffmpeg.c
+59
-6
plugins/ffmpeg/ffmpeg.h
plugins/ffmpeg/ffmpeg.h
+2
-1
No files found.
plugins/ffmpeg/ffmpeg.c
View file @
54e5b4ce
...
...
@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.1
7 2002/07/20 18:53:33
fenrir Exp $
* $Id: ffmpeg.c,v 1.1
8 2002/07/21 15:07:39
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -80,7 +80,7 @@ void _M( vdec_getfunctions )( function_list_t * p_function_list )
#define HURRY_UP_LONGTEXT \
"Allow the decoder to partially decode or skip frame(s) " \
"when there not enough time.\n It's usefull with low CPU power " \
"but it could produce broken pictures
(not yet implemented)
"
"but it could produce broken pictures
.
"
MODULE_CONFIG_START
ADD_CATEGORY_HINT
(
N_
(
"Miscellaneous"
),
NULL
)
...
...
@@ -90,14 +90,12 @@ ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
ADD_INTEGER
(
"ffmpeg-workaround-bugs"
,
0
,
NULL
,
"workaround bugs"
,
"0-99, seems to be for msmpeg v3
\n
"
)
#endif
#if LIBAVCODEC_BUILD > 4603
ADD_BOOL
(
"ffmpeg-hurry-up"
,
0
,
NULL
,
"hurry up"
,
HURRY_UP_LONGTEXT
)
#endif
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION
(
"ffmpeg video decoder(
MS-MPEG4,MPEG4,SVQ1,H263,H263.I
)"
)
SET_DESCRIPTION
(
"ffmpeg video decoder(
(MS)MPEG4,SVQ1,H263
)"
)
ADD_CAPABILITY
(
DECODER
,
70
)
MODULE_INIT_STOP
...
...
@@ -768,6 +766,7 @@ static int InitThread( videodec_thread_t *p_vdec )
static
void
DecodeThread
(
videodec_thread_t
*
p_vdec
)
{
int
i_status
;
int
b_drawpicture
;
int
b_gotpicture
;
AVPicture
avpicture
;
/* ffmpeg picture */
picture_t
*
p_pic
;
/* videolan picture */
...
...
@@ -775,6 +774,48 @@ static void DecodeThread( videodec_thread_t *p_vdec )
give it to ffmpeg decoder
and send the image to the output */
/* TODO implement it in a better way */
if
(
(
config_GetInt
(
p_vdec
->
p_fifo
,
"ffmpeg-hurry-up"
)
)
&&
(
p_vdec
->
i_frame_late
>
4
)
)
{
#if LIBAVCODEC_BUILD > 4603
b_drawpicture
=
0
;
if
(
p_vdec
->
i_frame_late
<
8
)
{
p_vdec
->
p_context
->
hurry_up
=
2
;
}
else
{
/* too much late picture, won't decode
but break picture until a new I, and for mpeg4 ...*/
p_vdec
->
i_frame_late
--
;
/* needed else it will never be decrease */
__PES_NEXT
(
p_vdec
->
p_fifo
);
return
;
}
#else
if
(
p_vdec
->
i_frame_late
<
8
)
{
b_drawpicture
=
0
;
/* not really good but .. */
}
else
{
/* too much late picture, won't decode
but break picture until a new I, and for mpeg4 ...*/
p_vdec
->
i_frame_late
--
;
/* needed else it will never be decrease */
__PES_NEXT
(
p_vdec
->
p_fifo
);
return
;
}
#endif
}
else
{
b_drawpicture
=
1
;
#if LIBAVCODEC_BUILD > 4603
p_vdec
->
p_context
->
hurry_up
=
0
;
#endif
}
__GetFrame
(
p_vdec
);
i_status
=
avcodec_decode_video
(
p_vdec
->
p_context
,
...
...
@@ -792,10 +833,22 @@ static void DecodeThread( videodec_thread_t *p_vdec )
p_vdec
->
i_frame_error
++
;
return
;
}
if
(
!
b_gotpicture
||
avpicture
.
linesize
[
0
]
==
0
)
/* Update frame late count*/
/* I don't make statistic on decoding time */
if
(
p_vdec
->
i_pts
<=
mdate
())
{
p_vdec
->
i_frame_late
++
;
}
else
{
p_vdec
->
i_frame_late
=
0
;
}
if
(
!
b_gotpicture
||
avpicture
.
linesize
[
0
]
==
0
||
!
b_drawpicture
)
{
return
;
}
/* Check our vout */
if
(
!
ffmpeg_CheckVout
(
p_vdec
->
p_vout
,
p_vdec
->
p_context
->
width
,
...
...
plugins/ffmpeg/ffmpeg.h
View file @
54e5b4ce
...
...
@@ -2,7 +2,7 @@
* ffmpeg_vdec.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.
5 2002/07/20 18:53:33
fenrir Exp $
* $Id: ffmpeg.h,v 1.
6 2002/07/21 15:07:39
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -106,5 +106,6 @@ typedef struct videodec_thread_s
int
i_frame_error
;
int
i_frame_skip
;
int
i_frame_late
;
/* how may frame decoded are in late */
}
videodec_thread_t
;
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