vdpau: add stups for the missing functions
authorChristian König <deathsimple@vodafone.de>
Mon, 25 Apr 2011 23:49:07 +0000 (01:49 +0200)
committerChristian König <deathsimple@vodafone.de>
Tue, 26 Apr 2011 09:12:59 +0000 (11:12 +0200)
src/gallium/state_trackers/vdpau/decode.c
src/gallium/state_trackers/vdpau/device.c
src/gallium/state_trackers/vdpau/ftab.c
src/gallium/state_trackers/vdpau/mixer.c
src/gallium/state_trackers/vdpau/output.c
src/gallium/state_trackers/vdpau/query.c
src/gallium/state_trackers/vdpau/surface.c
src/gallium/state_trackers/vdpau/vdpau_private.h

index 7905227597aee50298de76df53d14ccf71f6a8cf..12cc6c7b42fc3f22be88a86afea52e9b9709ad4a 100644 (file)
@@ -238,6 +238,15 @@ vlVdpDecoderRenderMpeg2(vlVdpDecoder *vldecoder,
 }
 #endif
 
+VdpStatus
+vlVdpDecoderGetParameters(VdpDecoder decoder,
+                          VdpDecoderProfile *profile,
+                          uint32_t *width,
+                          uint32_t *height)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
 VdpStatus
 vlVdpDecoderRender(VdpDecoder decoder,
                    VdpVideoSurface target,
index b3de0f29305075de82a1cfd166d3b99fb1359a1c..c0bf56edc2ef009bbf1301c3d25be2e3e58302ca 100644 (file)
@@ -176,6 +176,8 @@ vlVdpGetProcAddress(VdpDevice device, VdpFuncId function_id, void **function_poi
    if (!vlGetFuncFTAB(function_id, function_pointer))
       return VDP_STATUS_INVALID_FUNC_ID;
 
+   debug_printf("[VDPAU] Got proc adress %p for id %d\n", *function_pointer, function_id);
+
    return VDP_STATUS_OK;
 }
 
index de08b8102685d9d85556352ee690266a673e3a39..66ed50c329971ca165cfd95aeb2270b589993e4d 100644 (file)
@@ -33,7 +33,7 @@ static void* ftab[67] =
    &vlVdpGetErrorString, /* VDP_FUNC_ID_GET_ERROR_STRING */
    &vlVdpGetProcAddress, /* VDP_FUNC_ID_GET_PROC_ADDRESS */
    &vlVdpGetApiVersion, /* VDP_FUNC_ID_GET_API_VERSION */
-   0x55,                                       /* DUMMY */
+   NULL, /* DUMMY */
    &vlVdpGetInformationString, /* VDP_FUNC_ID_GET_INFORMATION_STRING */
    &vlVdpDeviceDestroy, /* VDP_FUNC_ID_DEVICE_DESTROY */
    &vlVdpGenerateCSCMatrix, /* VDP_FUNC_ID_GENERATE_CSC_MATRIX */
@@ -46,30 +46,30 @@ static void* ftab[67] =
    &vlVdpVideoSurfacePutBitsYCbCr, /* VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR */
    &vlVdpOutputSurfaceQueryCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES */
    &vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES */
-   0x2, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES */
+   &vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES */
    &vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES */
    &vlVdpOutputSurfaceCreate, /* VDP_FUNC_ID_OUTPUT_SURFACE_CREATE */
-   0x3, /* VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY */
-   0x4, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS */
-   0x5, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE */
-   0x6, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE */
-   0x7, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED */
-   0x8, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR */
+   &vlVdpOutputSurfaceDestroy, /* VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY */
+   &vlVdpOutputSurfaceGetParameters, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS */
+   &vlVdpOutputSurfaceGetBitsNative, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE */
+   &vlVdpOutputSurfacePutBitsNative, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE */
+   &vlVdpOutputSurfacePutBitsIndexed, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED */
+   &vlVdpOutputSurfacePutBitsYCbCr, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR */
    &vlVdpBitmapSurfaceQueryCapabilities, /* VDP_FUNC_ID_BITMAP_SURFACE_QUERY_CAPABILITIES */
    &vlVdpBitmapSurfaceCreate, /* VDP_FUNC_ID_BITMAP_SURFACE_CREATE */
    &vlVdpBitmapSurfaceDestroy, /* VDP_FUNC_ID_BITMAP_SURFACE_DESTROY */
    &vlVdpBitmapSurfaceGetParameters, /* VDP_FUNC_ID_BITMAP_SURFACE_GET_PARAMETERS */
    &vlVdpBitmapSurfacePutBitsNative, /* VDP_FUNC_ID_BITMAP_SURFACE_PUT_BITS_NATIVE */
-   0x55,       /* DUMMY */
-   0x55,       /* DUMMY */
-   0x55,       /* DUMMY */
-   0x9, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE */
-   0x10, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE */
-   0x11, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA */
+   NULL, /* DUMMY */
+   NULL, /* DUMMY */
+   NULL, /* DUMMY */
+   &vlVdpOutputSurfaceRenderOutputSurface, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE */
+   &vlVdpOutputSurfaceRenderBitmapSurface, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE */
+   NULL, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA */
    &vlVdpDecoderQueryCapabilities, /* VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES */
    &vlVdpDecoderCreate, /* VDP_FUNC_ID_DECODER_CREATE */
    &vlVdpDecoderDestroy, /* VDP_FUNC_ID_DECODER_DESTROY */
-   0x12, /* VDP_FUNC_ID_DECODER_GET_PARAMETERS */
+   &vlVdpDecoderGetParameters, /* VDP_FUNC_ID_DECODER_GET_PARAMETERS */
    &vlVdpDecoderRender, /* VDP_FUNC_ID_DECODER_RENDER */
    &vlVdpVideoMixerQueryFeatureSupport, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT */
    &vlVdpVideoMixerQueryParameterSupport, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT */
@@ -79,19 +79,19 @@ static void* ftab[67] =
    &vlVdpVideoMixerCreate, /* VDP_FUNC_ID_VIDEO_MIXER_CREATE */
    &vlVdpVideoMixerSetFeatureEnables, /* VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES */
    &vlVdpVideoMixerSetAttributeValues, /* VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES */
-   0x16, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT */
-   0x17, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES */
-   0x18, /* VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES */
-   0x19, /* VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES */
-   0x20, /* VDP_FUNC_ID_VIDEO_MIXER_DESTROY */
+   &vlVdpVideoMixerGetFeatureSupport, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT */
+   &vlVdpVideoMixerGetFeatureEnables, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES */
+   &vlVdpVideoMixerGetParameterValues, /* VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES */
+   &vlVdpVideoMixerGetAttributeValues, /* VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES */
+   &vlVdpVideoMixerDestroy, /* VDP_FUNC_ID_VIDEO_MIXER_DESTROY */
    &vlVdpVideoMixerRender, /* VDP_FUNC_ID_VIDEO_MIXER_RENDER */
    &vlVdpPresentationQueueTargetDestroy, /* VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY */
    &vlVdpPresentationQueueCreate, /* VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE */
    &vlVdpPresentationQueueDestroy, /* VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY */
    &vlVdpPresentationQueueSetBackgroundColor, /* VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR */
    &vlVdpPresentationQueueGetBackgroundColor, /* VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR */
-   0x55,       /* DUMMY */
-   0x55,       /* DUMMY */
+   NULL, /* DUMMY */
+   NULL, /* DUMMY */
    &vlVdpPresentationQueueGetTime, /* VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME */
    &vlVdpPresentationQueueDisplay, /* VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY */
    &vlVdpPresentationQueueBlockUntilSurfaceIdle, /* VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE */
@@ -118,5 +118,5 @@ boolean vlGetFuncFTAB(VdpFuncId function_id, void **func)
         return FALSE;
       *func = ftab_winsys[function_id];
    }
-   return TRUE;
+   return *func != NULL;
 }
index 83cbf8abdb1adcba4a3e86b05c04022a8eb5fab5..bafd84f4c511846789f377e34a44647732a63ac7 100644 (file)
@@ -86,6 +86,12 @@ no_handle:
    return ret;
 }
 
+VdpStatus
+vlVdpVideoMixerDestroy(VdpVideoMixer mixer)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
 VdpStatus
 vlVdpVideoMixerSetFeatureEnables(VdpVideoMixer mixer,
                                  uint32_t feature_count,
@@ -168,3 +174,39 @@ vlVdpVideoMixerSetAttributeValues(VdpVideoMixer mixer,
 
    return VDP_STATUS_OK;
 }
+
+VdpStatus
+vlVdpVideoMixerGetFeatureSupport(VdpVideoMixer mixer,
+                                 uint32_t feature_count,
+                                 VdpVideoMixerFeature const *features,
+                                 VdpBool *feature_supports)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpVideoMixerGetFeatureEnables(VdpVideoMixer mixer,
+                                 uint32_t feature_count,
+                                 VdpVideoMixerFeature const *features,
+                                 VdpBool *feature_enables)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpVideoMixerGetParameterValues(VdpVideoMixer mixer,
+                                  uint32_t parameter_count,
+                                  VdpVideoMixerParameter const *parameters,
+                                  void *const *parameter_values)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpVideoMixerGetAttributeValues(VdpVideoMixer mixer,
+                                  uint32_t attribute_count,
+                                  VdpVideoMixerAttribute const *attributes,
+                                  void *const *attribute_values)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
index e95f333b02a427bf2208538ee0dcfe2b59d5657d..8b85592b4e439ab863dd00bfff531425e1df3cfb 100644 (file)
@@ -104,3 +104,82 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
 
    return VDP_STATUS_OK;
 }
+
+VdpStatus
+vlVdpOutputSurfaceDestroy(VdpOutputSurface surface)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfaceGetParameters(VdpOutputSurface surface,
+                                VdpRGBAFormat *rgba_format,
+                                uint32_t *width, uint32_t *height)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
+                                VdpRect const *source_rect,
+                                void *const *destination_data,
+                                uint32_t const *destination_pitches)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
+                                void const *const *source_data,
+                                uint32_t const *source_pitches,
+                                VdpRect const *destination_rect)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
+                                 VdpIndexedFormat source_indexed_format,
+                                 void const *const *source_data,
+                                 uint32_t const *source_pitch,
+                                 VdpRect const *destination_rect,
+                                 VdpColorTableFormat color_table_format,
+                                 void const *color_table)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfacePutBitsYCbCr(VdpOutputSurface surface,
+                               VdpYCbCrFormat source_ycbcr_format,
+                               void const *const *source_data,
+                               uint32_t const *source_pitches,
+                               VdpRect const *destination_rect,
+                               VdpCSCMatrix const *csc_matrix)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
+                                      VdpRect const *destination_rect,
+                                      VdpOutputSurface source_surface,
+                                      VdpRect const *source_rect,
+                                      VdpColor const *colors,
+                                      VdpOutputSurfaceRenderBlendState const *blend_state,
+                                      uint32_t flags)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
+                                      VdpRect const *destination_rect,
+                                      VdpBitmapSurface source_surface,
+                                      VdpRect const *source_rect,
+                                      VdpColor const *colors,
+                                      VdpOutputSurfaceRenderBlendState const *blend_state,
+                                      uint32_t flags)
+{
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
index e971b6dc02ed39a9146903206be7b8588dab58f7..97522057a10568b4eb0fd9d40ee158bbf1284a87 100644 (file)
@@ -206,6 +206,21 @@ vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities(VdpDevice device, VdpRGBAFor
    return VDP_STATUS_NO_IMPLEMENTATION;
 }
 
+VdpStatus
+vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities(VdpDevice device,
+                                                  VdpRGBAFormat surface_rgba_format,
+                                                  VdpIndexedFormat bits_indexed_format,
+                                                  VdpColorTableFormat color_table_format,
+                                                  VdpBool *is_supported)
+{
+   debug_printf("[VDPAU] Querying output surfaces get put indexed cap\n");
+
+   if (!is_supported)
+      return VDP_STATUS_INVALID_POINTER;
+
+   return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
 VdpStatus
 vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format,
                                                 VdpYCbCrFormat bits_ycbcr_format,
index c30cd07f4349c28ea44c10df8a3740acffff6638..dcbc6e619164c7637af393f9263fbd14f0a17bbb 100644 (file)
@@ -56,7 +56,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
       goto no_htab;
    }
 
-   p_surf = CALLOC(1, sizeof(p_surf));
+   p_surf = CALLOC(1, sizeof(vlVdpSurface));
    if (!p_surf) {
       ret = VDP_STATUS_RESOURCES;
       goto no_res;
@@ -69,10 +69,13 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
    }
 
    p_surf->device = dev;
-   p_surf->video_buffer = dev->context->vpipe->create_buffer(dev->context->vpipe,
-                                                             PIPE_FORMAT_YV12, // most common used
-                                                             ChromaToPipe(chroma_type),
-                                                             width, height);
+   p_surf->video_buffer = dev->context->vpipe->create_buffer
+   (
+      dev->context->vpipe,
+      PIPE_FORMAT_YV12, // most common used
+      ChromaToPipe(chroma_type),
+      width, height
+   );
 
    *surface = vlAddDataHTAB(p_surf);
    if (*surface == 0) {
index ac1f9ccef99c38bf9fdd3ce9fdca3f628fee6d2a..40d26511cf71c0c3b849c00c8f5841a51983a5b9 100644 (file)
@@ -241,6 +241,7 @@ VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities vlVdpVideoSurfaceQueryGetPutBits
 VdpDecoderQueryCapabilities vlVdpDecoderQueryCapabilities;
 VdpOutputSurfaceQueryCapabilities vlVdpOutputSurfaceQueryCapabilities;
 VdpOutputSurfaceQueryGetPutBitsNativeCapabilities vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities;
+VdpOutputSurfaceQueryPutBitsIndexedCapabilities vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities;
 VdpOutputSurfaceQueryPutBitsYCbCrCapabilities vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities;
 VdpBitmapSurfaceQueryCapabilities vlVdpBitmapSurfaceQueryCapabilities;
 VdpVideoMixerQueryFeatureSupport vlVdpVideoMixerQueryFeatureSupport;
@@ -255,8 +256,17 @@ VdpVideoSurfaceGetBitsYCbCr vlVdpVideoSurfaceGetBitsYCbCr;
 VdpVideoSurfacePutBitsYCbCr vlVdpVideoSurfacePutBitsYCbCr;
 VdpDecoderCreate vlVdpDecoderCreate;
 VdpDecoderDestroy vlVdpDecoderDestroy;
+VdpDecoderGetParameters vlVdpDecoderGetParameters;
 VdpDecoderRender vlVdpDecoderRender;
 VdpOutputSurfaceCreate vlVdpOutputSurfaceCreate;
+VdpOutputSurfaceDestroy vlVdpOutputSurfaceDestroy;
+VdpOutputSurfaceGetParameters vlVdpOutputSurfaceGetParameters;
+VdpOutputSurfaceGetBitsNative vlVdpOutputSurfaceGetBitsNative;
+VdpOutputSurfacePutBitsNative vlVdpOutputSurfacePutBitsNative;
+VdpOutputSurfacePutBitsIndexed vlVdpOutputSurfacePutBitsIndexed;
+VdpOutputSurfacePutBitsYCbCr vlVdpOutputSurfacePutBitsYCbCr;
+VdpOutputSurfaceRenderOutputSurface vlVdpOutputSurfaceRenderOutputSurface;
+VdpOutputSurfaceRenderBitmapSurface vlVdpOutputSurfaceRenderBitmapSurface;
 VdpBitmapSurfaceCreate vlVdpBitmapSurfaceCreate;
 VdpBitmapSurfaceDestroy vlVdpBitmapSurfaceDestroy;
 VdpBitmapSurfaceGetParameters vlVdpBitmapSurfaceGetParameters;
@@ -276,6 +286,11 @@ VdpVideoMixerSetFeatureEnables vlVdpVideoMixerSetFeatureEnables;
 VdpVideoMixerCreate vlVdpVideoMixerCreate;
 VdpVideoMixerRender vlVdpVideoMixerRender;
 VdpVideoMixerSetAttributeValues vlVdpVideoMixerSetAttributeValues;
+VdpVideoMixerGetFeatureSupport vlVdpVideoMixerGetFeatureSupport;
+VdpVideoMixerGetFeatureEnables vlVdpVideoMixerGetFeatureEnables;
+VdpVideoMixerGetParameterValues vlVdpVideoMixerGetParameterValues;
+VdpVideoMixerGetAttributeValues vlVdpVideoMixerGetAttributeValues;
+VdpVideoMixerDestroy vlVdpVideoMixerDestroy;
 VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix;
 
 #endif // VDPAU_PRIVATE_H