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
7b783215
Commit
7b783215
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cook: decode directly to the user-provided AVFrame
parent
cddf8998
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
cook.c
libavcodec/cook.c
+5
-9
No files found.
libavcodec/cook.c
View file @
7b783215
...
...
@@ -123,7 +123,6 @@ typedef struct cook {
AVCodecContext
*
avctx
;
DSPContext
dsp
;
AVFrame
frame
;
GetBitContext
gb
;
/* stream data */
int
num_vectors
;
...
...
@@ -944,6 +943,7 @@ static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
static
int
cook_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
{
AVFrame
*
frame
=
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
COOKContext
*
q
=
avctx
->
priv_data
;
...
...
@@ -957,12 +957,12 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
if
(
q
->
discarded_packets
>=
2
)
{
q
->
frame
.
nb_samples
=
q
->
samples_per_channel
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
q
->
frame
))
<
0
)
{
frame
->
nb_samples
=
q
->
samples_per_channel
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
samples
=
(
float
**
)
q
->
frame
.
extended_data
;
samples
=
(
float
**
)
frame
->
extended_data
;
}
/* estimate subpacket sizes */
...
...
@@ -1003,8 +1003,7 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
return
avctx
->
block_align
;
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
q
->
frame
;
*
got_frame_ptr
=
1
;
return
avctx
->
block_align
;
}
...
...
@@ -1248,9 +1247,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
else
avctx
->
channel_layout
=
(
avctx
->
channels
==
2
)
?
AV_CH_LAYOUT_STEREO
:
AV_CH_LAYOUT_MONO
;
avcodec_get_frame_defaults
(
&
q
->
frame
);
avctx
->
coded_frame
=
&
q
->
frame
;
#ifdef DEBUG
dump_cook_context
(
q
);
#endif
...
...
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