summaryrefslogtreecommitdiff
path: root/drivers/amvdec_ports/aml_vcodec_adapt.h (plain)
blob: b5916990ef72cc98c28b3648f32304a276a8023c
1/*
2* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful, but WITHOUT
10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12* more details.
13*
14* You should have received a copy of the GNU General Public License along
15* with this program; if not, write to the Free Software Foundation, Inc.,
16* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*
18* Description:
19*/
20#ifndef VDEC_ADAPT_H
21#define VDEC_ADAPT_H
22
23#include <linux/amlogic/media/utils/vformat.h>
24#include <linux/amlogic/media/utils/amstream.h>
25#include "../stream_input/parser/streambuf.h"
26#include "aml_vcodec_drv.h"
27
28struct aml_vdec_adapt {
29 enum vformat_e format;
30 void *vsi;
31 int32_t failure;
32 uint32_t inst_addr;
33 unsigned int signaled;
34 struct aml_vcodec_ctx *ctx;
35 struct platform_device *dev;
36 wait_queue_head_t wq;
37 struct file *filp;
38 struct vdec_s *vdec;
39 struct stream_port_s port;
40 struct dec_sysinfo dec_prop;
41 struct v4l2_config_parm config;
42 int video_type;
43 char *recv_name;
44 int vfm_path;
45};
46
47int video_decoder_init(struct aml_vdec_adapt *ada_ctx);
48
49int video_decoder_release(struct aml_vdec_adapt *ada_ctx);
50
51int vdec_vbuf_write(struct aml_vdec_adapt *ada_ctx,
52 const char *buf, unsigned int count);
53
54int vdec_vframe_write(struct aml_vdec_adapt *ada_ctx,
55 const char *buf, unsigned int count, u64 timestamp);
56
57int is_need_to_buf(struct aml_vdec_adapt *ada_ctx);
58
59void aml_decoder_flush(struct aml_vdec_adapt *ada_ctx);
60
61int aml_codec_reset(struct aml_vdec_adapt *ada_ctx);
62
63extern void dump_write(const char __user *buf, size_t count);
64
65bool is_input_ready(struct aml_vdec_adapt *ada_ctx);
66
67int vdec_frame_number(struct aml_vdec_adapt *ada_ctx);
68
69#endif /* VDEC_ADAPT_H */
70
71