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
62ba2f68
Commit
62ba2f68
authored
Dec 17, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rawvideo: fix regression
parent
0e3f762c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
modules/codec/rawvideo.c
modules/codec/rawvideo.c
+41
-7
No files found.
modules/codec/rawvideo.c
View file @
62ba2f68
...
...
@@ -51,6 +51,12 @@ struct decoder_sys_t
* Common properties
*/
date_t
pts
;
/* stats */
mtime_t
i_pts_start
;
mtime_t
i_pts_end
;
int
i_fps
;
int
i_pics
;
};
/****************************************************************************
...
...
@@ -130,7 +136,7 @@ static int OpenDecoder( vlc_object_t *p_this )
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
(
decoder_sys_t
*
)
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
(
decoder_sys_t
*
)
calloc
(
1
,
sizeof
(
decoder_sys_t
))
)
==
NULL
)
return
VLC_ENOMEM
;
/* Misc init */
p_dec
->
p_sys
->
b_packetizer
=
false
;
...
...
@@ -163,6 +169,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec
->
fmt_out
.
video
.
i_frame_rate_base
);
date_Init
(
&
p_sys
->
pts
,
25
,
1
);
}
p_sys
->
i_fps
=
25
;
/* Find out p_vdec->i_raw_size */
vout_InitFormat
(
&
p_dec
->
fmt_out
.
video
,
p_dec
->
fmt_in
.
i_codec
,
...
...
@@ -198,6 +205,34 @@ static int OpenPacketizer( vlc_object_t *p_this )
return
i_ret
;
}
static
inline
FPSMeasurements
(
decoder_t
*
p_dec
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
p_sys
->
i_pics
++
;
if
(
p_sys
->
i_pics
==
1
)
{
p_sys
->
i_pts_start
=
mdate
();
}
if
(
p_sys
->
i_pics
==
p_sys
->
i_fps
)
{
mtime_t
i_diff
;
/* in us */
double
f_fps
;
p_sys
->
i_pts_end
=
mdate
();
/* in us */
i_diff
=
(
p_sys
->
i_pts_end
-
p_sys
->
i_pts_start
);
f_fps
=
(
double
)((
i_diff
/
(
int64_t
)
p_sys
->
i_pics
));
/* 1 frame per us */
f_fps
=
((
double
)
1
/
f_fps
)
*
(
double
)
1000000
;
msg_Info
(
p_dec
,
"Packetizer: %d frames per %"
PRId64
" micro seconds (%4.2f fps)"
,
p_sys
->
i_pics
,
i_diff
,
f_fps
);
/* reset timers */
p_sys
->
i_pics
=
0
;
p_sys
->
i_pts_start
=
p_sys
->
i_pts_end
=
(
mtime_t
)
0
;
}
}
/****************************************************************************
* DecodeBlock: the whole thing
****************************************************************************
...
...
@@ -256,6 +291,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
date_Increment
(
&
p_sys
->
pts
,
1
);
*
pp_block
=
NULL
;
FPSMeasurements
(
p_dec
);
return
p_buf
;
}
...
...
@@ -267,13 +303,11 @@ static void FillPicture( decoder_t *p_dec, block_t *p_block, picture_t *p_pic )
int
i_plane
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_pic
->
i_type
==
DIRECT
_PICTURE
)
if
(
p_pic
->
i_type
==
MEMORY
_PICTURE
)
{
free
(
p_pic
->
p_data_orig
);
p_pic
->
p_data
=
p_pic
->
p_data_orig
=
p_block
->
p_buffer
;
p_block
->
p_buffer
=
NULL
;
p_block
->
i_buffer
=
0
;
p_pic
->
p_data
=
p_block
->
p_buffer
;
p_pic
->
p_data_orig
=
p_block
;
/* Fill the p_pixels field for each plane */
p_pic
->
p
[
0
].
p_pixels
=
p_pic
->
p_data
;
...
...
@@ -302,6 +336,7 @@ static void FillPicture( decoder_t *p_dec, block_t *p_block, picture_t *p_pic )
p_dst
+=
i_pitch
,
p_src
+=
i_visible_pitch
)
vlc_memcpy
(
p_dst
,
p_src
,
i_visible_pitch
);
}
block_Release
(
p_block
);
}
}
...
...
@@ -326,7 +361,6 @@ static picture_t *DecodeFrame( decoder_t *p_dec, block_t *p_block )
p_pic
->
date
=
date_Get
(
&
p_sys
->
pts
);
p_pic
->
b_progressive
=
true
;
block_Release
(
p_block
);
return
p_pic
;
}
...
...
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