vl: moved some functions to more appropriate places
authorThomas Balling Sørensen <tball@tball-laptop.(none)>
Thu, 30 Sep 2010 13:58:57 +0000 (15:58 +0200)
committerThomas Balling Sørensen <tball@tball-laptop.(none)>
Thu, 30 Sep 2010 13:58:57 +0000 (15:58 +0200)
src/gallium/state_trackers/vdpau/Makefile
src/gallium/state_trackers/vdpau/decode.c
src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.c
src/gallium/state_trackers/vdpau/mpeg2_bitstream_parser.h

index ae54ae6..ad37676 100644 (file)
@@ -19,6 +19,7 @@ C_SOURCES = htab.c \
            decode.c \
            presentation.c \
            bitmap.c \
+           mpeg2_bitstream_parser.c \
            output.c
 
 
index e03bc35..3e7cb4a 100644 (file)
@@ -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
+}
index e69de29..c6d5846 100644 (file)
@@ -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;
+}
+
index 85a4b2f..534503d 100644 (file)
 #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