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
429b3cd6
Commit
429b3cd6
authored
Oct 29, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mjpeg_parser: add MJPEGParserContext
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
86931dc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
mjpeg_parser.c
libavcodec/mjpeg_parser.c
+9
-4
No files found.
libavcodec/mjpeg_parser.c
View file @
429b3cd6
...
...
@@ -28,12 +28,16 @@
#include "parser.h"
typedef
struct
MJPEGParserContext
{
ParseContext
pc
;
}
MJPEGParserContext
;
/**
* finds the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or -1
*/
static
int
find_frame_end
(
ParseContext
*
pc
,
const
uint8_t
*
buf
,
int
buf_size
){
static
int
find_frame_end
(
MJPEGParserContext
*
m
,
const
uint8_t
*
buf
,
int
buf_size
){
ParseContext
*
pc
=
&
m
->
pc
;
int
vop_found
,
i
;
uint16_t
state
;
...
...
@@ -75,13 +79,14 @@ static int jpeg_parse(AVCodecParserContext *s,
const
uint8_t
**
poutbuf
,
int
*
poutbuf_size
,
const
uint8_t
*
buf
,
int
buf_size
)
{
ParseContext
*
pc
=
s
->
priv_data
;
MJPEGParserContext
*
m
=
s
->
priv_data
;
ParseContext
*
pc
=
&
m
->
pc
;
int
next
;
if
(
s
->
flags
&
PARSER_FLAG_COMPLETE_FRAMES
){
next
=
buf_size
;
}
else
{
next
=
find_frame_end
(
pc
,
buf
,
buf_size
);
next
=
find_frame_end
(
m
,
buf
,
buf_size
);
if
(
ff_combine_frame
(
pc
,
next
,
&
buf
,
&
buf_size
)
<
0
)
{
*
poutbuf
=
NULL
;
...
...
@@ -98,7 +103,7 @@ static int jpeg_parse(AVCodecParserContext *s,
AVCodecParser
ff_mjpeg_parser
=
{
{
CODEC_ID_MJPEG
},
sizeof
(
Parse
Context
),
sizeof
(
MJPEGParser
Context
),
NULL
,
jpeg_parse
,
ff_parse_close
,
...
...
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