blob: 82db25892e0771086addd2dfa33ad1bd6733a354
1 | /* |
2 | * Copyright (c) 2014 Amlogic, Inc. All rights reserved. |
3 | * |
4 | * This source code is subject to the terms and conditions defined in the |
5 | * file 'LICENSE' which is part of this source code package. |
6 | * |
7 | * Description: |
8 | */ |
9 | |
10 | |
11 | #ifndef COMMON_CTL_H |
12 | #define COMMON_CTL_H |
13 | |
14 | #include <stdio.h> |
15 | #include <stdlib.h> |
16 | #include <fcntl.h> |
17 | #include <string.h> |
18 | #include <unistd.h> |
19 | #include <sys/ioctl.h> |
20 | #include <errno.h> |
21 | #include <cutils/log.h> |
22 | #include <../mediaconfig/media_config.h> |
23 | #include <amports/amstream.h> |
24 | |
25 | #ifdef __cplusplus |
26 | extern "C" { |
27 | #endif |
28 | |
29 | #define UnSupport 0xFFFF |
30 | //#define CTRL_PRINT ALOGD |
31 | #define CTRL_PRINT |
32 | int media_open(const char *path, int flags); |
33 | int media_close(int fd); |
34 | int media_control(int fd, int cmd, unsigned long paramter); |
35 | int media_set_ctl(const char * path,int setval); |
36 | int media_get_ctl(const char * path); |
37 | int media_set_ctl_str(const char * path,char* setval); |
38 | int media_get_ctl_str(const char * path, char* buf, int size); |
39 | int media_sync_set_ctl(const char * path,int setval); |
40 | int media_sync_get_ctl(const char * path); |
41 | int media_sync_set_ctl_str(const char * path,char* setval); |
42 | int media_sync_get_ctl_str(const char * path, char* buf, int size); |
43 | int media_video_set_ctl(const char * path,int setval); |
44 | int media_video_get_ctl(const char * path); |
45 | int media_video_set_ctl_str(const char * path,char* setval); |
46 | int media_video_get_ctl_str(const char * path, char* buf, int size); |
47 | int media_decoder_set_ctl(const char * path,int setval); |
48 | int media_decoder_get_ctl(const char * path); |
49 | int media_decoder_set_ctl_str(const char * path,char* setval); |
50 | int media_decoder_get_ctl_str(const char * path, char* buf, int size); |
51 | int media_video_get_int(int cmd); |
52 | int media_video_set_int(int cmd, int para); |
53 | int media_vfm_get_ulong(int cmd); |
54 | int media_vfm_set_ulong(int cmd, unsigned long para); |
55 | int media_codec_mm_set_ctl_str(const char * path,char* setval); |
56 | int media_codec_mm_get_ctl_str(const char * path, char* buf, int size); |
57 | int media_get_vfm_map_str(char* val,int size); |
58 | int media_set_vfm_map_str(const char* val); |
59 | int media_rm_vfm_map_str(const char* name,const char* val); |
60 | int media_add_vfm_map_str(const char* name,const char* val); |
61 | int media_sub_getinfo(int type); |
62 | int media_sub_setinfo(int type, int info); |
63 | struct vfmctl{ |
64 | char name[10]; |
65 | char val[300]; |
66 | }; |
67 | |
68 | #define VFM_IOC_MAGIC 'V' |
69 | #define VFM_IOCTL_CMD_ADD _IOW((VFM_IOC_MAGIC), 0x00, struct vfmctl) |
70 | #define VFM_IOCTL_CMD_RM _IOW((VFM_IOC_MAGIC), 0x01, struct vfmctl) |
71 | #define VFM_IOCTL_CMD_DUMP _IOW((VFM_IOC_MAGIC), 0x02, struct vfmctl) |
72 | #define VFM_IOCTL_CMD_ADDDUMMY _IOW((VFM_IOC_MAGIC), 0x03, struct vfmctl) |
73 | #define VFM_IOCTL_CMD_SET _IOW(VFM_IOC_MAGIC, 0x04, struct vfmctl) |
74 | #define VFM_IOCTL_CMD_GET _IOWR(VFM_IOC_MAGIC, 0x05, struct vfmctl) |
75 | |
76 | |
77 | enum subinfo_para_e { |
78 | SUB_NULL = -1, |
79 | SUB_ENABLE = 0, |
80 | SUB_TOTAL, |
81 | SUB_WIDTH, |
82 | SUB_HEIGHT, |
83 | SUB_TYPE, |
84 | SUB_CURRENT, |
85 | SUB_INDEX, |
86 | SUB_WRITE_POS, |
87 | SUB_START_PTS, |
88 | SUB_FPS, |
89 | SUB_SUBTYPE, |
90 | SUB_RESET, |
91 | SUB_DATA_T_SIZE, |
92 | SUB_DATA_T_DATA |
93 | }; |
94 | |
95 | struct subinfo_para_s { |
96 | enum subinfo_para_e subinfo_type; |
97 | int subtitle_info; |
98 | char *data; |
99 | }; |
100 | |
101 | #ifdef __cplusplus |
102 | } |
103 | #endif |
104 | |
105 | #endif |
106 |