* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "va_backend.h"
+#include "config.h"
+#include <va/va_backend.h>
#include "dummy_drv_video.h"
#include "assert.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#define ASSERT assert
-#define INIT_DRIVER_DATA struct dummy_driver_data *driver_data = (struct dummy_driver_data *) ctx->pDriverData;
+#define INIT_DRIVER_DATA struct dummy_driver_data * const driver_data = (struct dummy_driver_data *) ctx->pDriverData;
#define CONFIG(id) ((object_config_p) object_heap_lookup( &driver_data->config_heap, id ))
#define CONTEXT(id) ((object_context_p) object_heap_lookup( &driver_data->context_heap, id ))
int *num_profiles /* out */
)
{
- INIT_DRIVER_DATA
int i = 0;
profile_list[i++] = VAProfileMPEG2Simple;
int *num_entrypoints /* out */
)
{
- INIT_DRIVER_DATA
-
switch (profile) {
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
int num_attribs
)
{
- INIT_DRIVER_DATA
-
int i;
/* Other attributes don't seem to be defined */
int *num_formats /* out */
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VAImage *image /* out */
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VAImage *image /* out */
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VAImageID image
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
unsigned char *palette
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VAImageID image
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
-VAStatus dummy_PutImage(
- VADriverContextP ctx,
- VASurfaceID surface,
- VAImageID image,
- int src_x,
- int src_y,
- unsigned int width,
- unsigned int height,
- int dest_x,
- int dest_y
-)
-{
- INIT_DRIVER_DATA
-
- /* TODO */
- return VA_STATUS_SUCCESS;
-}
-VAStatus dummy_PutImage2(
+VAStatus dummy_PutImage(
VADriverContextP ctx,
VASurfaceID surface,
VAImageID image,
unsigned int dest_height
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
unsigned int *num_formats /* out */
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VASubpictureID *subpicture /* out */
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VASubpictureID subpicture
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VAImageID image
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
unsigned char *palette
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
unsigned int chromakey_mask
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
float global_alpha
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
-VAStatus dummy_AssociateSubpicture(
- VADriverContextP ctx,
- VASubpictureID subpicture,
- VASurfaceID *target_surfaces,
- int num_surfaces,
- short src_x, /* upper left offset in subpicture */
- short src_y,
- short dest_x, /* upper left offset in surface */
- short dest_y,
- unsigned short width,
- unsigned short height,
- /*
- * whether to enable chroma-keying or global-alpha
- * see VA_SUBPICTURE_XXX values
- */
- unsigned int flags
-)
-{
- INIT_DRIVER_DATA
-
- /* TODO */
- return VA_STATUS_SUCCESS;
-}
-VAStatus dummy_AssociateSubpicture2(
+VAStatus dummy_AssociateSubpicture(
VADriverContextP ctx,
VASubpictureID subpicture,
VASurfaceID *target_surfaces,
unsigned int flags
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
int num_surfaces
)
{
- INIT_DRIVER_DATA
-
/* TODO */
return VA_STATUS_SUCCESS;
}
VAStatus dummy_SyncSurface(
VADriverContextP ctx,
- VAContextID context,
VASurfaceID render_target
)
{
INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS;
- object_context_p obj_context;
object_surface_p obj_surface;
- obj_context = CONTEXT(context);
- ASSERT(obj_context);
-
obj_surface = SURFACE(render_target);
ASSERT(obj_surface);
- /* Assume that this shouldn't be called before vaEndPicture() */
- ASSERT( obj_context->current_render_target != obj_surface->base.id );
-
return vaStatus;
}
VAStatus dummy_PutSurface(
VADriverContextP ctx,
VASurfaceID surface,
- Drawable draw, /* X Drawable */
+ void *draw, /* X Drawable */
short srcx,
short srcy,
unsigned short srcw,
}
-VAStatus dummy_CopySurfaceToBuffer(
+VAStatus dummy_BufferInfo(
+ VADriverContextP ctx,
+ VABufferID buf_id, /* in */
+ VABufferType *type, /* out */
+ unsigned int *size, /* out */
+ unsigned int *num_elements /* out */
+ )
+{
+ /* TODO */
+ return VA_STATUS_ERROR_UNIMPLEMENTED;
+}
+
+
+
+VAStatus dummy_LockSurface(
VADriverContextP ctx,
VASurfaceID surface,
unsigned int *fourcc, /* following are output argument */
unsigned int *luma_offset,
unsigned int *chroma_u_offset,
unsigned int *chroma_v_offset,
+ unsigned int *buffer_name,
void **buffer
)
{
/* TODO */
- return VA_STATUS_ERROR_UNKNOWN;
+ return VA_STATUS_ERROR_UNIMPLEMENTED;
+}
+
+VAStatus dummy_UnlockSurface(
+ VADriverContextP ctx,
+ VASurfaceID surface
+ )
+{
+ /* TODO */
+ return VA_STATUS_ERROR_UNIMPLEMENTED;
}
VAStatus dummy_Terminate( VADriverContextP ctx )
{
INIT_DRIVER_DATA
object_buffer_p obj_buffer;
- object_surface_p obj_surface;
- object_context_p obj_context;
object_config_p obj_config;
object_heap_iterator iter;
return VA_STATUS_SUCCESS;
}
-VAStatus __vaDriverInit_0_30( VADriverContextP ctx )
+VAStatus VA_DRIVER_INIT_FUNC( VADriverContextP ctx )
{
- object_base_p obj;
+ struct VADriverVTable * const vtable = ctx->vtable;
int result;
struct dummy_driver_data *driver_data;
- int i;
ctx->version_major = VA_MAJOR_VERSION;
ctx->version_minor = VA_MINOR_VERSION;
ctx->max_display_attributes = DUMMY_MAX_DISPLAY_ATTRIBUTES;
ctx->str_vendor = DUMMY_STR_VENDOR;
- ctx->vtable.vaTerminate = dummy_Terminate;
- ctx->vtable.vaQueryConfigEntrypoints = dummy_QueryConfigEntrypoints;
- ctx->vtable.vaQueryConfigProfiles = dummy_QueryConfigProfiles;
- ctx->vtable.vaQueryConfigEntrypoints = dummy_QueryConfigEntrypoints;
- ctx->vtable.vaQueryConfigAttributes = dummy_QueryConfigAttributes;
- ctx->vtable.vaCreateConfig = dummy_CreateConfig;
- ctx->vtable.vaDestroyConfig = dummy_DestroyConfig;
- ctx->vtable.vaGetConfigAttributes = dummy_GetConfigAttributes;
- ctx->vtable.vaCreateSurfaces = dummy_CreateSurfaces;
- ctx->vtable.vaDestroySurfaces = dummy_DestroySurfaces;
- ctx->vtable.vaCreateContext = dummy_CreateContext;
- ctx->vtable.vaDestroyContext = dummy_DestroyContext;
- ctx->vtable.vaCreateBuffer = dummy_CreateBuffer;
- ctx->vtable.vaBufferSetNumElements = dummy_BufferSetNumElements;
- ctx->vtable.vaMapBuffer = dummy_MapBuffer;
- ctx->vtable.vaUnmapBuffer = dummy_UnmapBuffer;
- ctx->vtable.vaDestroyBuffer = dummy_DestroyBuffer;
- ctx->vtable.vaBeginPicture = dummy_BeginPicture;
- ctx->vtable.vaRenderPicture = dummy_RenderPicture;
- ctx->vtable.vaEndPicture = dummy_EndPicture;
- ctx->vtable.vaSyncSurface = dummy_SyncSurface;
- ctx->vtable.vaQuerySurfaceStatus = dummy_QuerySurfaceStatus;
- ctx->vtable.vaPutSurface = dummy_PutSurface;
- ctx->vtable.vaQueryImageFormats = dummy_QueryImageFormats;
- ctx->vtable.vaCreateImage = dummy_CreateImage;
- ctx->vtable.vaDeriveImage = dummy_DeriveImage;
- ctx->vtable.vaDestroyImage = dummy_DestroyImage;
- ctx->vtable.vaSetImagePalette = dummy_SetImagePalette;
- ctx->vtable.vaGetImage = dummy_GetImage;
- ctx->vtable.vaPutImage = dummy_PutImage;
- ctx->vtable.vaPutImage2 = dummy_PutImage2;
- ctx->vtable.vaQuerySubpictureFormats = dummy_QuerySubpictureFormats;
- ctx->vtable.vaCreateSubpicture = dummy_CreateSubpicture;
- ctx->vtable.vaDestroySubpicture = dummy_DestroySubpicture;
- ctx->vtable.vaSetSubpictureImage = dummy_SetSubpictureImage;
- ctx->vtable.vaSetSubpictureChromakey = dummy_SetSubpictureChromakey;
- ctx->vtable.vaSetSubpictureGlobalAlpha = dummy_SetSubpictureGlobalAlpha;
- ctx->vtable.vaAssociateSubpicture = dummy_AssociateSubpicture;
- ctx->vtable.vaAssociateSubpicture2 = dummy_AssociateSubpicture2;
- ctx->vtable.vaDeassociateSubpicture = dummy_DeassociateSubpicture;
- ctx->vtable.vaQueryDisplayAttributes = dummy_QueryDisplayAttributes;
- ctx->vtable.vaGetDisplayAttributes = dummy_GetDisplayAttributes;
- ctx->vtable.vaSetDisplayAttributes = dummy_SetDisplayAttributes;
-
- ctx->vtable.vaCopySurfaceToBuffer = dummy_CopySurfaceToBuffer;
+ vtable->vaTerminate = dummy_Terminate;
+ vtable->vaQueryConfigEntrypoints = dummy_QueryConfigEntrypoints;
+ vtable->vaQueryConfigProfiles = dummy_QueryConfigProfiles;
+ vtable->vaQueryConfigEntrypoints = dummy_QueryConfigEntrypoints;
+ vtable->vaQueryConfigAttributes = dummy_QueryConfigAttributes;
+ vtable->vaCreateConfig = dummy_CreateConfig;
+ vtable->vaDestroyConfig = dummy_DestroyConfig;
+ vtable->vaGetConfigAttributes = dummy_GetConfigAttributes;
+ vtable->vaCreateSurfaces = dummy_CreateSurfaces;
+ vtable->vaDestroySurfaces = dummy_DestroySurfaces;
+ vtable->vaCreateContext = dummy_CreateContext;
+ vtable->vaDestroyContext = dummy_DestroyContext;
+ vtable->vaCreateBuffer = dummy_CreateBuffer;
+ vtable->vaBufferSetNumElements = dummy_BufferSetNumElements;
+ vtable->vaMapBuffer = dummy_MapBuffer;
+ vtable->vaUnmapBuffer = dummy_UnmapBuffer;
+ vtable->vaDestroyBuffer = dummy_DestroyBuffer;
+ vtable->vaBeginPicture = dummy_BeginPicture;
+ vtable->vaRenderPicture = dummy_RenderPicture;
+ vtable->vaEndPicture = dummy_EndPicture;
+ vtable->vaSyncSurface = dummy_SyncSurface;
+ vtable->vaQuerySurfaceStatus = dummy_QuerySurfaceStatus;
+ vtable->vaPutSurface = dummy_PutSurface;
+ vtable->vaQueryImageFormats = dummy_QueryImageFormats;
+ vtable->vaCreateImage = dummy_CreateImage;
+ vtable->vaDeriveImage = dummy_DeriveImage;
+ vtable->vaDestroyImage = dummy_DestroyImage;
+ vtable->vaSetImagePalette = dummy_SetImagePalette;
+ vtable->vaGetImage = dummy_GetImage;
+ vtable->vaPutImage = dummy_PutImage;
+ vtable->vaQuerySubpictureFormats = dummy_QuerySubpictureFormats;
+ vtable->vaCreateSubpicture = dummy_CreateSubpicture;
+ vtable->vaDestroySubpicture = dummy_DestroySubpicture;
+ vtable->vaSetSubpictureImage = dummy_SetSubpictureImage;
+ vtable->vaSetSubpictureChromakey = dummy_SetSubpictureChromakey;
+ vtable->vaSetSubpictureGlobalAlpha = dummy_SetSubpictureGlobalAlpha;
+ vtable->vaAssociateSubpicture = dummy_AssociateSubpicture;
+ vtable->vaDeassociateSubpicture = dummy_DeassociateSubpicture;
+ vtable->vaQueryDisplayAttributes = dummy_QueryDisplayAttributes;
+ vtable->vaGetDisplayAttributes = dummy_GetDisplayAttributes;
+ vtable->vaSetDisplayAttributes = dummy_SetDisplayAttributes;
+ vtable->vaLockSurface = dummy_LockSurface;
+ vtable->vaUnlockSurface = dummy_UnlockSurface;
+ vtable->vaBufferInfo = dummy_BufferInfo;
driver_data = (struct dummy_driver_data *) malloc( sizeof(*driver_data) );
ctx->pDriverData = (void *) driver_data;