blob: f712696f042a090a9206f82d8f4a9572dd7fb753
1 | #include "vdec_v4l2_buffer_ops.h" |
2 | |
3 | int vdec_v4l_get_buffer(struct aml_vcodec_ctx *ctx, |
4 | struct vdec_v4l2_buffer **out) |
5 | { |
6 | int ret = -1; |
7 | |
8 | if (ctx->drv_handle == 0) |
9 | return -EIO; |
10 | |
11 | ret = ctx->dec_if->get_param(ctx->drv_handle, |
12 | GET_PARAM_FREE_FRAME_BUFFER, out); |
13 | |
14 | return ret; |
15 | } |
16 | EXPORT_SYMBOL(vdec_v4l_get_buffer); |
17 | |
18 | int vdec_v4l_set_pic_infos(struct aml_vcodec_ctx *ctx, |
19 | struct aml_vdec_pic_infos *info) |
20 | { |
21 | int ret = 0; |
22 | |
23 | if (ctx->drv_handle == 0) |
24 | return -EIO; |
25 | |
26 | ret = ctx->dec_if->set_param(ctx->drv_handle, |
27 | SET_PARAM_PIC_INFO, info); |
28 | |
29 | return ret; |
30 | } |
31 | EXPORT_SYMBOL(vdec_v4l_set_pic_infos); |
32 | |
33 | int vdec_v4l_set_hdr_infos(struct aml_vcodec_ctx *ctx, |
34 | struct aml_vdec_hdr_infos *hdr) |
35 | { |
36 | int ret = 0; |
37 | |
38 | if (ctx->drv_handle == 0) |
39 | return -EIO; |
40 | |
41 | ret = ctx->dec_if->set_param(ctx->drv_handle, |
42 | SET_PARAM_HDR_INFO, hdr); |
43 | |
44 | return ret; |
45 | } |
46 | EXPORT_SYMBOL(vdec_v4l_set_hdr_infos); |
47 | |
48 | int vdec_v4l_write_frame_sync(struct aml_vcodec_ctx *ctx) |
49 | { |
50 | int ret = 0; |
51 | |
52 | if (ctx->drv_handle == 0) |
53 | return -EIO; |
54 | |
55 | ret = ctx->dec_if->set_param(ctx->drv_handle, |
56 | SET_PARAM_WRITE_FRAME_SYNC, NULL); |
57 | |
58 | return ret; |
59 | } |
60 | EXPORT_SYMBOL(vdec_v4l_write_frame_sync); |
61 | |
62 |