blob: 19be6247a3e704da419169fb6fb6896eb5e44831
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_ps_infos(struct aml_vcodec_ctx *ctx, |
19 | struct aml_vdec_ps_infos *ps) |
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_PS_INFO, ps); |
28 | |
29 | return ret; |
30 | } |
31 | EXPORT_SYMBOL(vdec_v4l_set_ps_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_post_evet(struct aml_vcodec_ctx *ctx, u32 event) |
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_POST_EVENT, &event); |
57 | |
58 | return ret; |
59 | } |
60 | EXPORT_SYMBOL(vdec_v4l_post_evet); |
61 | |
62 | int vdec_v4l_write_frame_sync(struct aml_vcodec_ctx *ctx) |
63 | { |
64 | int ret = 0; |
65 | |
66 | if (ctx->drv_handle == 0) |
67 | return -EIO; |
68 | |
69 | ret = ctx->dec_if->set_param(ctx->drv_handle, |
70 | SET_PARAM_WRITE_FRAME_SYNC, NULL); |
71 | |
72 | return ret; |
73 | } |
74 | EXPORT_SYMBOL(vdec_v4l_write_frame_sync); |
75 | |
76 |