Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
45bde93e
Commit
45bde93e
authored
11 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
sunrastenc: use the AVFrame API properly.
parent
fb26d761
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/sunrastenc.c
+11
-2
11 additions, 2 deletions
libavcodec/sunrastenc.c
with
11 additions
and
2 deletions
libavcodec/sunrastenc.c
+
11
−
2
View file @
45bde93e
...
...
@@ -25,7 +25,6 @@
#include
"sunrast.h"
typedef
struct
SUNRASTContext
{
AVFrame
picture
;
PutByteContext
p
;
int
depth
;
///< depth of pixel
int
length
;
///< length (bytes) of image
...
...
@@ -154,7 +153,10 @@ static av_cold int sunrast_encode_init(AVCodecContext *avctx)
return
AVERROR
(
EINVAL
);
}
avctx
->
coded_frame
=
&
s
->
picture
;
avctx
->
coded_frame
=
av_frame_alloc
();
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
avctx
->
coded_frame
->
key_frame
=
1
;
avctx
->
coded_frame
->
pict_type
=
AV_PICTURE_TYPE_I
;
s
->
maptype
=
RMT_NONE
;
...
...
@@ -207,6 +209,12 @@ static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return
0
;
}
static
av_cold
int
sunrast_encode_close
(
AVCodecContext
*
avctx
)
{
av_frame_free
(
&
avctx
->
coded_frame
);
return
0
;
}
static
const
AVCodecDefault
sunrast_defaults
[]
=
{
{
"coder"
,
"rle"
},
{
NULL
},
...
...
@@ -219,6 +227,7 @@ AVCodec ff_sunrast_encoder = {
.
id
=
AV_CODEC_ID_SUNRAST
,
.
priv_data_size
=
sizeof
(
SUNRASTContext
),
.
init
=
sunrast_encode_init
,
.
close
=
sunrast_encode_close
,
.
encode2
=
sunrast_encode_frame
,
.
defaults
=
sunrast_defaults
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_BGR24
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment