summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-12-23 16:14:31 +0100
committerChristian König <[email protected]>2012-01-09 12:21:22 +0100
commit8c2bfa34a0d70ab08de44e3b091b3a097abbad97 (patch)
treebb5d09aa8b41d759dff310bbd230c32db797d2dc /src/gallium/state_trackers/vdpau
parent37240d2132d25588ad05ae5394c237f45d8ad881 (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/state_trackers/vdpau')
-rw-r--r--src/gallium/state_trackers/vdpau/decode.c43
-rw-r--r--src/gallium/state_trackers/vdpau/vdpau_private.h3
2 files changed, 2 insertions, 44 deletions
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index a5a01fb21a3..ab7bf113fa6 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -48,7 +48,6 @@ vlVdpDecoderCreate(VdpDevice device,
vlVdpDevice *dev;
vlVdpDecoder *vldecoder;
VdpStatus ret;
- unsigned i;
bool supported;
VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Creating decoder\n");
@@ -90,7 +89,8 @@ vlVdpDecoderCreate(VdpDevice device,
pipe, p_profile,
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
PIPE_VIDEO_CHROMA_FORMAT_420,
- width, height, max_references
+ width, height, max_references,
+ false
);
if (!vldecoder->decoder) {
@@ -98,25 +98,6 @@ vlVdpDecoderCreate(VdpDevice device,
goto error_decoder;
}
- vldecoder->num_buffers = pipe->screen->get_video_param
- (
- pipe->screen, p_profile,
- PIPE_VIDEO_CAP_NUM_BUFFERS_DESIRED
- );
- vldecoder->cur_buffer = 0;
-
- vldecoder->buffers = CALLOC(vldecoder->num_buffers, sizeof(void*));
- if (!vldecoder->buffers)
- goto error_alloc_buffers;
-
- for (i = 0; i < vldecoder->num_buffers; ++i) {
- vldecoder->buffers[i] = vldecoder->decoder->create_buffer(vldecoder->decoder);
- if (!vldecoder->buffers[i]) {
- ret = VDP_STATUS_ERROR;
- goto error_create_buffers;
- }
- }
-
*decoder = vlAddDataHTAB(vldecoder);
if (*decoder == 0) {
ret = VDP_STATUS_ERROR;
@@ -128,15 +109,6 @@ vlVdpDecoderCreate(VdpDevice device,
return VDP_STATUS_OK;
error_handle:
-error_create_buffers:
-
- for (i = 0; i < vldecoder->num_buffers; ++i)
- if (vldecoder->buffers[i])
- vldecoder->decoder->destroy_buffer(vldecoder->decoder, vldecoder->buffers[i]);
-
- FREE(vldecoder->buffers);
-
-error_alloc_buffers:
vldecoder->decoder->destroy(vldecoder->decoder);
@@ -152,7 +124,6 @@ VdpStatus
vlVdpDecoderDestroy(VdpDecoder decoder)
{
vlVdpDecoder *vldecoder;
- unsigned i;
VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Destroying decoder\n");
@@ -160,12 +131,6 @@ vlVdpDecoderDestroy(VdpDecoder decoder)
if (!vldecoder)
return VDP_STATUS_INVALID_HANDLE;
- for (i = 0; i < vldecoder->num_buffers; ++i)
- if (vldecoder->buffers[i])
- vldecoder->decoder->destroy_buffer(vldecoder->decoder, vldecoder->buffers[i]);
-
- FREE(vldecoder->buffers);
-
vldecoder->decoder->destroy(vldecoder->decoder);
FREE(vldecoder);
@@ -413,10 +378,6 @@ vlVdpDecoderRender(VdpDecoder decoder,
// TODO: Recreate decoder with correct chroma
return VDP_STATUS_INVALID_CHROMA_TYPE;
- ++vldecoder->cur_buffer;
- vldecoder->cur_buffer %= vldecoder->num_buffers;
-
- dec->set_decode_buffer(dec, vldecoder->buffers[vldecoder->cur_buffer]);
dec->set_decode_target(dec, vlsurf->video_buffer);
switch (u_reduce_video_profile(dec->profile)) {
diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h
index 84c5b82cacb..1bbbaa9fbea 100644
--- a/src/gallium/state_trackers/vdpau/vdpau_private.h
+++ b/src/gallium/state_trackers/vdpau/vdpau_private.h
@@ -335,9 +335,6 @@ typedef struct
{
vlVdpDevice *device;
struct pipe_video_decoder *decoder;
- unsigned num_buffers;
- void **buffers;
- unsigned cur_buffer;
} vlVdpDecoder;
typedef uint32_t vlHandle;