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
228eb670
Commit
228eb670
authored
Feb 02, 2016
by
Timothy Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdl: Remove AVPicture usage
parent
916da13d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
sdl.c
libavdevice/sdl.c
+6
-4
No files found.
libavdevice/sdl.c
View file @
228eb670
...
...
@@ -27,6 +27,7 @@
#include <SDL_thread.h>
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
...
...
@@ -315,22 +316,23 @@ static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
{
SDLContext
*
sdl
=
s
->
priv_data
;
AVCodecContext
*
encctx
=
s
->
streams
[
0
]
->
codec
;
AVPicture
pict
;
uint8_t
*
data
[
4
];
int
linesize
[
4
];
int
i
;
if
(
sdl
->
quit
)
{
sdl_write_trailer
(
s
);
return
AVERROR
(
EIO
);
}
av
picture_fill
(
&
pict
,
pkt
->
data
,
encctx
->
pix_fmt
,
encctx
->
width
,
encctx
->
height
);
av
_image_fill_arrays
(
data
,
linesize
,
pkt
->
data
,
encctx
->
pix_fmt
,
encctx
->
width
,
encctx
->
height
,
1
);
SDL_LockMutex
(
sdl
->
mutex
);
SDL_FillRect
(
sdl
->
surface
,
&
sdl
->
surface
->
clip_rect
,
SDL_MapRGB
(
sdl
->
surface
->
format
,
0
,
0
,
0
));
SDL_LockYUVOverlay
(
sdl
->
overlay
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
sdl
->
overlay
->
pixels
[
i
]
=
pict
.
data
[
i
];
sdl
->
overlay
->
pitches
[
i
]
=
pict
.
linesize
[
i
];
sdl
->
overlay
->
pixels
[
i
]
=
data
[
i
];
sdl
->
overlay
->
pitches
[
i
]
=
linesize
[
i
];
}
SDL_DisplayYUVOverlay
(
sdl
->
overlay
,
&
sdl
->
overlay_rect
);
SDL_UnlockYUVOverlay
(
sdl
->
overlay
);
...
...
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