g3dvl: Rework the decoder interface part 4/5
authorChristian König <deathsimple@vodafone.de>
Thu, 11 Aug 2011 14:11:36 +0000 (16:11 +0200)
committerChristian König <deathsimple@vodafone.de>
Fri, 26 Aug 2011 10:10:34 +0000 (12:10 +0200)
Make the picture_structure enum spec complient.
Also remove it from the compositor.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_compositor.h
src/gallium/include/pipe/p_video_state.h
src/gallium/state_trackers/vdpau/mixer.c
src/gallium/state_trackers/vdpau/presentation.c
src/gallium/state_trackers/xorg/xvmc/surface.c

index faca96dc55b0768f7c85fdf9e819e40c693f47a9..c73f976944683eb9078c21b239aecdfad1f5aaa8 100644 (file)
@@ -673,7 +673,6 @@ vl_compositor_set_rgba_layer(struct vl_compositor *c,
 
 void
 vl_compositor_render(struct vl_compositor *c,
-                     enum pipe_mpeg12_picture_type picture_type,
                      struct pipe_surface           *dst_surface,
                      struct pipe_video_rect        *dst_area,
                      struct pipe_video_rect        *dst_clip)
index 0a9a7411a61ea7bf997f8b1a4358fc8a556120fb..207510092a02d0387509c1b4b193721a196eff2f 100644 (file)
@@ -156,7 +156,6 @@ vl_compositor_set_rgba_layer(struct vl_compositor *compositor,
  */
 void
 vl_compositor_render(struct vl_compositor          *compositor,
-                     enum pipe_mpeg12_picture_type picture_type,
                      struct pipe_surface           *dst_surface,
                      struct pipe_video_rect        *dst_area,
                      struct pipe_video_rect        *dst_clip);
index 9463af2fbe59619c4bfbde9c3901368f5841a785..8e68f27cbdbaf69410b56e6626aec15ab8945e10 100644 (file)
@@ -43,11 +43,15 @@ struct pipe_video_rect
    unsigned x, y, w, h;
 };
 
-enum pipe_mpeg12_picture_type
+/*
+ * see table 6-14 in the spec
+ */
+enum pipe_mpeg12_picture_structure
 {
-   PIPE_MPEG12_PICTURE_TYPE_FIELD_TOP,
-   PIPE_MPEG12_PICTURE_TYPE_FIELD_BOTTOM,
-   PIPE_MPEG12_PICTURE_TYPE_FRAME
+   PIPE_MPEG12_PICTURE_STRUCTURE_RESERVED = 0x00,
+   PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_TOP = 0x01,
+   PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_BOTTOM = 0x02,
+   PIPE_MPEG12_PICTURE_STRUCTURE_FRAME = 0x03
 };
 
 /*
index d5187006bfc1da5b9dd3318426c11d3960fd130e..fbd24a29414e17bf03783bcfc128f005af55b7fd 100644 (file)
@@ -157,8 +157,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
 
    vl_compositor_clear_layers(&vmixer->compositor);
    vl_compositor_set_buffer_layer(&vmixer->compositor, 0, surf->video_buffer, NULL, NULL);
-   vl_compositor_render(&vmixer->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME,
-                        dst->surface, NULL, NULL);
+   vl_compositor_render(&vmixer->compositor, dst->surface, NULL, NULL);
 
    return VDP_STATUS_OK;
 }
index 1176c7a30b764487d4ab2833ada0cf0130511790..7e324db5589bd0a39d7bee4888f62e6aeeae68cc 100644 (file)
@@ -169,8 +169,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
 
    vl_compositor_clear_layers(&pq->compositor);
    vl_compositor_set_rgba_layer(&pq->compositor, 0, surf->sampler_view, NULL, NULL);
-   vl_compositor_render(&pq->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME,
-                        drawable_surface, NULL, NULL);
+   vl_compositor_render(&pq->compositor, drawable_surface, NULL, NULL);
 
    pq->device->context->pipe->screen->flush_frontbuffer
    (
index a4a27cc5b96cb17cd87785a2d82f4622154f4332..fd7d228c996ea2f082c2a55a8b494b4b343275e0 100644 (file)
 
 #include "xvmc_private.h"
 
-static enum pipe_mpeg12_picture_type PictureToPipe(int xvmc_pic)
-{
-   switch (xvmc_pic) {
-      case XVMC_TOP_FIELD:
-         return PIPE_MPEG12_PICTURE_TYPE_FIELD_TOP;
-      case XVMC_BOTTOM_FIELD:
-         return PIPE_MPEG12_PICTURE_TYPE_FIELD_BOTTOM;
-      case XVMC_FRAME_PICTURE:
-         return PIPE_MPEG12_PICTURE_TYPE_FRAME;
-      default:
-         assert(0);
-   }
-
-   XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized picture type 0x%08X.\n", xvmc_pic);
-
-   return -1;
-}
-
 static void
 MacroBlocksToPipe(XvMCContextPrivate *context,
                   XvMCSurfacePrivate *surface,
@@ -447,7 +429,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
    // Workaround for r600g, there seems to be a bug in the fence refcounting code
    pipe->screen->fence_reference(pipe->screen, &surface_priv->fence, NULL);
 
-   vl_compositor_render(compositor, PictureToPipe(flags), context_priv->drawable_surface, &dst_rect, NULL);
+   vl_compositor_render(compositor, context_priv->drawable_surface, &dst_rect, NULL);
                         
    pipe->flush(pipe, &surface_priv->fence);