summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Balling Sørensen <tball@tball-laptop.(none)>2010-09-30 15:58:57 +0200
committerThomas Balling Sørensen <tball@tball-laptop.(none)>2010-09-30 15:58:57 +0200
commitcac5e60fd3fa7b756bcd4174db8096335c70e145 (patch)
treeb1ab2889627740b9174a5d0232bd2a2f37c6a756 /src
parent8291db1cdb9d8e8d02a9c1a7ce34e6a23b8238ff (diff)
vl: moved some functions to more appropriate places
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/vdpau/Makefile1
-rw-r--r--src/gallium/state_trackers/vdpau/decode.c24
-rw-r--r--src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.c42
-rw-r--r--src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h8
4 files changed, 58 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/vdpau/Makefile b/src/gallium/state_trackers/vdpau/Makefile
index ae54ae6a7ef..ad37676b95e 100644
--- a/src/gallium/state_trackers/vdpau/Makefile
+++ b/src/gallium/state_trackers/vdpau/Makefile
@@ -19,6 +19,7 @@ C_SOURCES = htab.c \
decode.c \
presentation.c \
bitmap.c \
+ mpeg2_bitstream_parser.c \
output.c
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index e03bc35ed68..3e7cb4a3cab 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -26,6 +26,7 @@
**************************************************************************/
#include "vdpau_private.h"
+#include "mpeg2_bitstream_parser.h"
#include <util/u_memory.h>
#include <util/u_math.h>
#include <pipe/p_video_context.h>
@@ -165,15 +166,6 @@ vlVdpCreateSurfaceTarget (vlVdpDecoder *vldecoder,
return VDP_STATUS_OK;
}
-static void
-vlVdpBitstreamToMacroblocks(struct pipe_screen *screen,
- VdpBitstreamBuffer const *bitstream_buffers,
- unsigned int num_macroblocks,
- struct pipe_mpeg12_macroblock *pipe_macroblocks)
-{
- debug_printf("NAF!\n");
-}
-
VdpStatus
vlVdpDecoderRenderMpeg2 (vlVdpDecoder *vldecoder,
vlVdpSurface *vlsurf,
@@ -190,6 +182,7 @@ vlVdpDecoderRenderMpeg2 (vlVdpDecoder *vldecoder,
struct pipe_surface *p_surf;
struct pipe_surface *f_surf;
uint32_t num_macroblocks;
+ struct pipe_mpeg12_macroblock *pipe_macroblocks;
VdpStatus ret;
@@ -217,15 +210,12 @@ vlVdpDecoderRenderMpeg2 (vlVdpDecoder *vldecoder,
if (f_vdp_surf == VDP_INVALID_HANDLE) f_vdp_surf = NULL;
ret = vlVdpCreateSurfaceTarget(vldecoder,t_vdp_surf);
-
- num_macroblocks = bitstream_buffer_count;
- struct pipe_mpeg12_macroblock pipe_macroblocks[num_macroblocks];
-
- vlVdpBitstreamToMacroblocks(vpipe->screen, bitstream_buffers,
- num_macroblocks, pipe_macroblocks);
+
+ vlVdpBitstreamToMacroblock(vpipe->screen, bitstream_buffers,
+ &num_macroblocks, &pipe_macroblocks);
vpipe->set_decode_target(vpipe,t_surf);
- vpipe->decode_macroblocks(vpipe, p_surf, f_surf, num_macroblocks, &pipe_macroblocks->base, NULL);
+ vpipe->decode_macroblocks(vpipe, p_surf, f_surf, num_macroblocks, pipe_macroblocks, NULL);
return ret;
}
@@ -284,4 +274,4 @@ vlVdpDecoderRender (VdpDecoder decoder,
assert(0);
return ret;
-} \ No newline at end of file
+}
diff --git a/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.c b/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.c
index e69de29bb2d..c6d5846be52 100644
--- a/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.c
+++ b/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.c
@@ -0,0 +1,42 @@
+/**************************************************************************
+ *
+ * Copyright 2010 Thomas Balling Sørensen.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "mpeg2_bitstream_parser.h"
+
+void
+vlVdpBitstreamToMacroblock (
+ struct pipe_screen *screen,
+ VdpBitstreamBuffer const *bitstream_buffers,
+ unsigned int *num_macroblocks,
+ struct pipe_mpeg12_macroblock **pipe_macroblocks)
+{
+ debug_printf("[VDPAU] BitstreamToMacroblock not implemented yet");
+ assert(0);
+
+ return;
+}
+
diff --git a/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h b/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h
index 85a4b2fdf01..534503df53f 100644
--- a/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h
+++ b/src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h
@@ -28,6 +28,14 @@
#ifndef MPEG2_BITSTREAM_PARSER_H
#define MPEG2_BITSTREAM_PARSER_H
+#include <vdpau/vdpau.h>
+#include <pipe/p_video_state.h>
+#include "vdpau_private.h"
+void
+vlVdpBitstreamToMacroblock(struct pipe_screen *screen,
+ VdpBitstreamBuffer const *bitstream_buffers,
+ unsigned int *num_macroblocks,
+ struct pipe_mpeg12_macroblock **pipe_macroblocks);
#endif // MPEG2_BITSTREAM_PARSER_H