summaryrefslogtreecommitdiff
path: root/drivers/amvdec_ports/aml_vcodec_adapt.h (plain)
blob: 5a69312995922d639ddfea22435c048da6b9d058
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 int video_type;
42 char *recv_name;
43 int vfm_path;
44};
45
46int video_decoder_init(struct aml_vdec_adapt *ada_ctx);
47
48int video_decoder_release(struct aml_vdec_adapt *ada_ctx);
49
50int vdec_vbuf_write(struct aml_vdec_adapt *ada_ctx,
51 const char *buf, unsigned int count);
52
53int vdec_vframe_write(struct aml_vdec_adapt *ada_ctx,
54 const char *buf, unsigned int count, u64 timestamp);
55
56int is_need_to_buf(struct aml_vdec_adapt *ada_ctx);
57
58void aml_decoder_flush(struct aml_vdec_adapt *ada_ctx);
59
60int aml_codec_reset(struct aml_vdec_adapt *ada_ctx);
61
62extern void dump_write(const char __user *buf, size_t count);
63
64bool is_input_ready(struct aml_vdec_adapt *ada_ctx);
65
66int vdec_frame_number(struct aml_vdec_adapt *ada_ctx);
67
68#endif /* VDEC_ADAPT_H */
69
70