sdl: Remove AVPicture usage
This commit is contained in:
parent
916da13d6d
commit
228eb6708b
@ -27,6 +27,7 @@
|
|||||||
#include <SDL_thread.h>
|
#include <SDL_thread.h>
|
||||||
|
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/parseutils.h"
|
#include "libavutil/parseutils.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
@ -315,22 +316,23 @@ static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
{
|
{
|
||||||
SDLContext *sdl = s->priv_data;
|
SDLContext *sdl = s->priv_data;
|
||||||
AVCodecContext *encctx = s->streams[0]->codec;
|
AVCodecContext *encctx = s->streams[0]->codec;
|
||||||
AVPicture pict;
|
uint8_t *data[4];
|
||||||
|
int linesize[4];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (sdl->quit) {
|
if (sdl->quit) {
|
||||||
sdl_write_trailer(s);
|
sdl_write_trailer(s);
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
}
|
||||||
avpicture_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_LockMutex(sdl->mutex);
|
||||||
SDL_FillRect(sdl->surface, &sdl->surface->clip_rect,
|
SDL_FillRect(sdl->surface, &sdl->surface->clip_rect,
|
||||||
SDL_MapRGB(sdl->surface->format, 0, 0, 0));
|
SDL_MapRGB(sdl->surface->format, 0, 0, 0));
|
||||||
SDL_LockYUVOverlay(sdl->overlay);
|
SDL_LockYUVOverlay(sdl->overlay);
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
sdl->overlay->pixels [i] = pict.data [i];
|
sdl->overlay->pixels [i] = data [i];
|
||||||
sdl->overlay->pitches[i] = pict.linesize[i];
|
sdl->overlay->pitches[i] = linesize[i];
|
||||||
}
|
}
|
||||||
SDL_DisplayYUVOverlay(sdl->overlay, &sdl->overlay_rect);
|
SDL_DisplayYUVOverlay(sdl->overlay, &sdl->overlay_rect);
|
||||||
SDL_UnlockYUVOverlay(sdl->overlay);
|
SDL_UnlockYUVOverlay(sdl->overlay);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user