~thopiekar/arm-mali/libvdpau-sunxi

« back to all changes in this revision

Viewing changes to decoder.c

  • Committer: Jens Kuske
  • Date: 2016-02-16 13:12:22 UTC
  • Revision ID: git-v1:685769372a8281bf67046a958883323aaf14d232
Use libcedrus

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <string.h>
 
21
#include <cedrus/cedrus.h>
21
22
#include "vdpau_private.h"
22
 
#include "ve.h"
23
23
 
24
24
VdpStatus vdp_decoder_create(VdpDevice device,
25
25
                             VdpDecoderProfile profile,
44
44
        dec->width = width;
45
45
        dec->height = height;
46
46
 
47
 
        dec->data = ve_malloc(VBV_SIZE);
 
47
        dec->data = cedrus_mem_alloc(dec->device->cedrus, VBV_SIZE);
48
48
        if (!(dec->data))
49
49
                goto err_data;
50
50
 
71
71
                break;
72
72
 
73
73
        case VDP_DECODER_PROFILE_HEVC_MAIN:
74
 
                if (ve_get_version() == 0x1680)
 
74
                if (cedrus_get_ve_version(dec->device->cedrus) == 0x1680)
75
75
                        ret = new_decoder_h265(dec);
76
76
                else
77
77
                        ret = VDP_STATUS_INVALID_DECODER_PROFILE;
88
88
        return VDP_STATUS_OK;
89
89
 
90
90
err_decoder:
91
 
        ve_free(dec->data);
 
91
        cedrus_mem_free(dec->data);
92
92
err_data:
93
93
        handle_destroy(*decoder);
94
94
err_ctx:
104
104
        if (dec->private_free)
105
105
                dec->private_free(dec);
106
106
 
107
 
        ve_free(dec->data);
 
107
        cedrus_mem_free(dec->data);
108
108
 
109
109
        handle_destroy(decoder);
110
110
 
151
151
 
152
152
        for (i = 0; i < bitstream_buffer_count; i++)
153
153
        {
154
 
                memcpy(dec->data->virt + pos, bitstream_buffers[i].bitstream, bitstream_buffers[i].bitstream_bytes);
 
154
                memcpy(cedrus_mem_get_pointer(dec->data) + pos, bitstream_buffers[i].bitstream, bitstream_buffers[i].bitstream_bytes);
155
155
                pos += bitstream_buffers[i].bitstream_bytes;
156
156
        }
157
 
        ve_flush_cache(dec->data);
 
157
        cedrus_mem_flush_cache(dec->data);
158
158
 
159
159
        return dec->decode(dec, picture_info, pos, vid);
160
160
}
204
204
                break;
205
205
        case VDP_DECODER_PROFILE_HEVC_MAIN:
206
206
                *max_level = VDP_DECODER_LEVEL_HEVC_5;
207
 
                if (ve_get_version() == 0x1680)
 
207
                if (cedrus_get_ve_version(dev->cedrus) == 0x1680)
208
208
                        *is_supported = VDP_TRUE;
209
209
                else
210
210
                        *is_supported = VDP_FALSE;