diff options
author | Richard Li <richardradeon@gmail.com> | 2009-11-19 16:17:13 -0500 |
---|---|---|
committer | Richard Li <richardradeon@gmail.com> | 2009-11-19 16:17:13 -0500 |
commit | 49b3f4a6bc498d964296f7305b490ec983b9fac4 (patch) | |
tree | b56c8899e2db1a9f2a7a97da038ec943a93daed9 /src/gallium/drivers/identity/id_objects.c | |
parent | 6345a7ba447d3e04b939ead6fee44fe9201ec2e3 (diff) | |
parent | 90e69c81e445136b7d14c569cab5b517b8073498 (diff) |
Merge branch 'master' of ssh://richardradeon@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/gallium/drivers/identity/id_objects.c')
-rw-r--r-- | src/gallium/drivers/identity/id_objects.c | 39 |
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 e893e59940..bc9bc7121d 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); +} |