[FFmpeg-cvslog] sdl: Remove AVPicture usage

Timothy Gu git at videolan.org
Wed Feb 3 03:06:31 CET 2016


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Mon Feb  1 17:25:38 2016 -0800| [228eb6708bd708bd778181ae91a7349eb803fed6] | committer: Timothy Gu

sdl: Remove AVPicture usage

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=228eb6708bd708bd778181ae91a7349eb803fed6
---

 libavdevice/sdl.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavdevice/sdl.c b/libavdevice/sdl.c
index b98aae5..4cccfe5 100644
--- a/libavdevice/sdl.c
+++ b/libavdevice/sdl.c
@@ -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);
     }
-    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_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);



More information about the ffmpeg-cvslog mailing list