summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_opengl.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-06-20 16:38:25 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-06-20 16:38:25 +0100
commit3ce0de86ad429962ab581b9af762aa5dc9d3f156 (patch)
tree4640aaa3ece95b03f3ee7ef74e5162005347753a /src/video_out/video_out_opengl.c
parent17c9a01cbafd5ff0e6645f96f8ac084fbf239e4d (diff)
parentf3974e74f2f1548bf07604fddfa60cf75b2fda57 (diff)
downloadxine-lib-3ce0de86ad429962ab581b9af762aa5dc9d3f156.tar.gz
xine-lib-3ce0de86ad429962ab581b9af762aa5dc9d3f156.tar.bz2
Merge the avutil branch; port the "raw" video output plugin.
--HG-- rename : src/combined/ffmpeg/ff_dvaudio_decoder.c => src/audio_dec/ff_dvaudio_decoder.c rename : src/combined/ffmpeg/ffmpeg_encoder.c => src/dxr3/ffmpeg_encoder.c
Diffstat (limited to 'src/video_out/video_out_opengl.c')
-rw-r--r--src/video_out/video_out_opengl.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index de5510c2d..9656f9551 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -47,6 +47,8 @@
#include <ctype.h>
#include <pthread.h>
+#include <mem.h>
+
/* defines for debugging extensions only */
/* #define GL_GLEXT_LEGACY */
#include <GL/gl.h>
@@ -140,7 +142,6 @@ typedef struct {
int width, height, format, flags;
double ratio;
- uint8_t *chunk[4]; /* mem alloc by xmalloc_aligned */
uint8_t *rgb, *rgb_dst;
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */
@@ -1268,10 +1269,10 @@ static void opengl_frame_dispose (vo_frame_t *vo_img) {
frame->yuv2rgb->dispose (frame->yuv2rgb);
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
- free (frame->chunk[3]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
+ av_free (frame->rgb);
free (frame);
}
@@ -1349,26 +1350,23 @@ static void opengl_update_frame_format (vo_driver_t *this_gen,
XLockDisplay (this->display);
/* (re-) allocate render space */
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
- free (frame->chunk[3]);
+ av_freep(&frame->vo_frame.base[0]);
+ av_freep(&frame->vo_frame.base[1]);
+ av_freep(&frame->vo_frame.base[2]);
+ av_freep(&frame->rgb);
if (format == XINE_IMGFMT_YV12) {
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), (void **) &frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), (void **) &frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
} else {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
}
- frame->rgb = xine_xmalloc_aligned (16, BYTES_PER_PIXEL*width*height,
- (void **) &frame->chunk[3]);
+ frame->rgb = av_mallocz(BYTES_PER_PIXEL*width*height);
/* set up colorspace converter */
switch (flags) {