diff options
author | Christian König <[email protected]> | 2011-12-23 16:14:31 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-01-09 12:21:22 +0100 |
commit | 8c2bfa34a0d70ab08de44e3b091b3a097abbad97 (patch) | |
tree | bb5d09aa8b41d759dff310bbd230c32db797d2dc /src/gallium/auxiliary/vl/vl_video_buffer.c | |
parent | 37240d2132d25588ad05ae5394c237f45d8ad881 (diff) |
vl: replace decode_buffers with auxiliary data field
Based on patches from Maarten Lankhorst <[email protected]>
Signed-off-by: Christian König <[email protected]>
Acked-by: Maarten Lankhorst <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_video_buffer.c')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_video_buffer.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c index 6d714d49f4a..8ceb7138479 100644 --- a/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -98,6 +98,34 @@ vl_video_buffer_max_size(struct pipe_screen *screen) return 1 << (max_2d_texture_level-1); } +void +vl_video_buffer_set_associated_data(struct pipe_video_buffer *vbuf, + struct pipe_video_decoder *vdec, + void *associated_data, + void (*destroy_associated_data)(void *)) +{ + vbuf->decoder = vdec; + + if (vbuf->associated_data == associated_data) + return; + + if (vbuf->associated_data) + vbuf->destroy_associated_data(vbuf->associated_data); + + vbuf->associated_data = associated_data; + vbuf->destroy_associated_data = destroy_associated_data; +} + +void * +vl_video_buffer_get_associated_data(struct pipe_video_buffer *vbuf, + struct pipe_video_decoder *vdec) +{ + if (vbuf->decoder == vdec) + return vbuf->associated_data; + else + return NULL; +} + static void vl_video_buffer_destroy(struct pipe_video_buffer *buffer) { @@ -112,6 +140,7 @@ vl_video_buffer_destroy(struct pipe_video_buffer *buffer) pipe_sampler_view_reference(&buf->sampler_view_components[i], NULL); pipe_resource_reference(&buf->resources[i], NULL); } + vl_video_buffer_set_associated_data(buffer, NULL, NULL, NULL); FREE(buffer); } |