vdpau: get at least the very basic mixer functions working
authorChristian König <deathsimple@vodafone.de>
Fri, 8 Apr 2011 20:13:46 +0000 (22:13 +0200)
committerChristian König <deathsimple@vodafone.de>
Fri, 8 Apr 2011 20:13:46 +0000 (22:13 +0200)
src/gallium/state_trackers/vdpau/mixer.c

index 86ac099a7d8994d7f08e98dfd6035196166c3321..2fe0f1ca6f46bfe804b05348920300462cea67a3 100644 (file)
@@ -111,11 +111,28 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
                                 uint32_t layer_count,
                                 VdpLayer const *layers)
 {
-   if (!(background_source_rect && video_surface_past && video_surface_future &&
-         video_source_rect && destination_rect && destination_video_rect && layers))
-      return VDP_STATUS_INVALID_POINTER;
+   vlVdpVideoMixer *vmixer;
+   vlVdpSurface *surf;
+   vlVdpOutputSurface *dst;
+
+   vmixer = vlGetDataHTAB(mixer);
+   if (!vmixer)
+      return VDP_STATUS_INVALID_HANDLE;
+
+   surf = vlGetDataHTAB(video_surface_current);
+   if (!surf)
+      return VDP_STATUS_INVALID_HANDLE;
+
+   dst = vlGetDataHTAB(destination_surface);
+   if (!dst)
+      return VDP_STATUS_INVALID_HANDLE;
 
-   return VDP_STATUS_NO_IMPLEMENTATION;
+   vmixer->compositor->clear_layers(vmixer->compositor);
+   vmixer->compositor->set_buffer_layer(vmixer->compositor, 0, surf->video_buffer, NULL, NULL);
+   vmixer->compositor->render_picture(vmixer->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME,
+                                      dst->surface, NULL, NULL);
+
+   return VDP_STATUS_OK;
 }
 
 VdpStatus