Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
400378b7
Commit
400378b7
authored
Apr 03, 2017
by
Matthieu Bouron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/examples/extract_mvs: re-indent after previous commit
parent
1cf93196
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
extract_mvs.c
doc/examples/extract_mvs.c
+28
-28
No files found.
doc/examples/extract_mvs.c
View file @
400378b7
...
...
@@ -35,40 +35,40 @@ static int video_frame_count = 0;
static
int
decode_packet
(
const
AVPacket
*
pkt
)
{
int
ret
=
avcodec_send_packet
(
video_dec_ctx
,
pkt
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error while sending a packet to the decoder: %s
\n
"
,
av_err2str
(
ret
));
int
ret
=
avcodec_send_packet
(
video_dec_ctx
,
pkt
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error while sending a packet to the decoder: %s
\n
"
,
av_err2str
(
ret
));
return
ret
;
}
while
(
ret
>=
0
)
{
ret
=
avcodec_receive_frame
(
video_dec_ctx
,
frame
);
if
(
ret
==
AVERROR
(
EAGAIN
)
||
ret
==
AVERROR_EOF
)
{
break
;
}
else
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error while receiving a frame from the decoder: %s
\n
"
,
av_err2str
(
ret
));
return
ret
;
}
while
(
ret
>=
0
)
{
ret
=
avcodec_receive_frame
(
video_dec_ctx
,
frame
);
if
(
ret
==
AVERROR
(
EAGAIN
)
||
ret
==
AVERROR_EOF
)
{
break
;
}
else
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error while receiving a frame from the decoder: %s
\n
"
,
av_err2str
(
ret
));
return
ret
;
}
if
(
ret
>=
0
)
{
int
i
;
AVFrameSideData
*
sd
;
video_frame_count
++
;
sd
=
av_frame_get_side_data
(
frame
,
AV_FRAME_DATA_MOTION_VECTORS
);
if
(
sd
)
{
const
AVMotionVector
*
mvs
=
(
const
AVMotionVector
*
)
sd
->
data
;
for
(
i
=
0
;
i
<
sd
->
size
/
sizeof
(
*
mvs
);
i
++
)
{
const
AVMotionVector
*
mv
=
&
mvs
[
i
];
printf
(
"%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"
PRIx64
"
\n
"
,
video_frame_count
,
mv
->
source
,
mv
->
w
,
mv
->
h
,
mv
->
src_x
,
mv
->
src_y
,
mv
->
dst_x
,
mv
->
dst_y
,
mv
->
flags
);
}
if
(
ret
>=
0
)
{
int
i
;
AVFrameSideData
*
sd
;
video_frame_count
++
;
sd
=
av_frame_get_side_data
(
frame
,
AV_FRAME_DATA_MOTION_VECTORS
);
if
(
sd
)
{
const
AVMotionVector
*
mvs
=
(
const
AVMotionVector
*
)
sd
->
data
;
for
(
i
=
0
;
i
<
sd
->
size
/
sizeof
(
*
mvs
);
i
++
)
{
const
AVMotionVector
*
mv
=
&
mvs
[
i
];
printf
(
"%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"
PRIx64
"
\n
"
,
video_frame_count
,
mv
->
source
,
mv
->
w
,
mv
->
h
,
mv
->
src_x
,
mv
->
src_y
,
mv
->
dst_x
,
mv
->
dst_y
,
mv
->
flags
);
}
av_frame_unref
(
frame
);
}
av_frame_unref
(
frame
);
}
}
return
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