blob: 107efec532a5a7894636c50f752f6d7432f8174f
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 | if (event == 1) |
55 | ctx->reset_flag = 2; |
56 | ret = ctx->dec_if->set_param(ctx->drv_handle, |
57 | SET_PARAM_POST_EVENT, &event); |
58 | |
59 | return ret; |
60 | } |
61 | EXPORT_SYMBOL(vdec_v4l_post_evet); |
62 | |
63 | int vdec_v4l_write_frame_sync(struct aml_vcodec_ctx *ctx) |
64 | { |
65 | int ret = 0; |
66 | |
67 | if (ctx->drv_handle == 0) |
68 | return -EIO; |
69 | |
70 | ret = ctx->dec_if->set_param(ctx->drv_handle, |
71 | SET_PARAM_WRITE_FRAME_SYNC, NULL); |
72 | |
73 | return ret; |
74 | } |
75 | EXPORT_SYMBOL(vdec_v4l_write_frame_sync); |
76 | |
77 |