summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/identity/id_objects.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2009-11-19 08:18:58 +0100
committerMichal Krol <[email protected]>2009-11-19 08:25:25 +0100
commitf56b95e40796ea3859b1cb83341730bf74a6f85f (patch)
tree377d7a9548b966550b96f05abb5ff2971a519775 /src/gallium/drivers/identity/id_objects.c
parentc5dc8d7eccab38bf644ac1b9a58d0c5fe4acc4d7 (diff)
identity: Add missing screen methods.
Diffstat (limited to 'src/gallium/drivers/identity/id_objects.c')
-rw-r--r--src/gallium/drivers/identity/id_objects.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c
index e893e599408..bc9bc7121d5 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -180,3 +180,42 @@ identity_transfer_destroy(struct identity_transfer *id_transfer)
screen->tex_transfer_destroy(id_transfer->transfer);
FREE(id_transfer);
}
+
+struct pipe_video_surface *
+identity_video_surface_create(struct identity_screen *id_screen,
+ struct pipe_video_surface *video_surface)
+{
+ struct identity_video_surface *id_video_surface;
+
+ if (!video_surface) {
+ goto error;
+ }
+
+ assert(video_surface->screen == id_screen->screen);
+
+ id_video_surface = CALLOC_STRUCT(identity_video_surface);
+ if (!id_video_surface) {
+ goto error;
+ }
+
+ memcpy(&id_video_surface->base,
+ video_surface,
+ sizeof(struct pipe_video_surface));
+
+ pipe_reference_init(&id_video_surface->base.reference, 1);
+ id_video_surface->base.screen = &id_screen->base;
+ id_video_surface->video_surface = video_surface;
+
+ return &id_video_surface->base;
+
+error:
+ pipe_video_surface_reference(&video_surface, NULL);
+ return NULL;
+}
+
+void
+identity_video_surface_destroy(struct identity_video_surface *id_video_surface)
+{
+ pipe_video_surface_reference(&id_video_surface->video_surface, NULL);
+ FREE(id_video_surface);
+}