• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * include/linux/amlogic/media/vfm/vframe_receiver.h
3  *
4  * Copyright (C) 2016 Amlogic, Inc. All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16 */
17 
18 #ifndef VFRAME_RECEIVER_H
19 #define VFRAME_RECEIVER_H
20 
21 /* Standard Linux headers */
22 #include <linux/list.h>
23 
24 /* Amlogic headers */
25 #include <linux/amlogic/media/vfm/vframe.h>
26 
27 #define VFRAME_EVENT_PROVIDER_UNREG                            1
28 #define VFRAME_EVENT_PROVIDER_LIGHT_UNREG                      2
29 #define VFRAME_EVENT_PROVIDER_START                            3
30 #define VFRAME_EVENT_PROVIDER_VFRAME_READY                     4
31 #define VFRAME_EVENT_PROVIDER_QUREY_STATE                      5
32 #define VFRAME_EVENT_PROVIDER_RESET                            6
33 #define VFRAME_EVENT_PROVIDER_FORCE_BLACKOUT		       7
34 #define VFRAME_EVENT_PROVIDER_REG                              8
35 #define VFRAME_EVENT_PROVIDER_LIGHT_UNREG_RETURN_VFRAME        9
36 #define VFRAME_EVENT_PROVIDER_DPBUF_CONFIG                     10
37 #define VFRAME_EVENT_PROVIDER_QUREY_VDIN2NR                    11
38 #define VFRAME_EVENT_PROVIDER_SET_3D_VFRAME_INTERLEAVE         12
39 #define VFRAME_EVENT_PROVIDER_FR_HINT                          13
40 #define VFRAME_EVENT_PROVIDER_FR_END_HINT                      14
41 #define VFRAME_EVENT_PROVIDER_QUREY_DISPLAY_INFO    15
42 #define VFRAME_EVENT_PROVIDER_PROPERTY_CHANGED 16
43 
44 enum receviver_start_e {
45 	RECEIVER_STATE_NULL = -1,
46 	RECEIVER_STATE_NONE = 0,
47 	RECEIVER_INACTIVE,
48 	RECEIVER_ACTIVE
49 };
50 
51 struct vframe_receiver_op_s {
52 	int (*event_cb)(int type, void *data, void *private_data);
53 } /*vframe_receiver_op_t */;
54 
55 struct vframe_receiver_s {
56 	const char *name;
57 	const struct vframe_receiver_op_s *ops;
58 	void *op_arg;
59 	struct list_head list;
60 } /*vframe_receiver_t */;
61 
62 extern struct vframe_receiver_s *vf_receiver_alloc(void);
63 extern void vf_receiver_init(struct vframe_receiver_s *recv,
64 			     const char *name,
65 			     const struct vframe_receiver_op_s *ops,
66 			     void *op_arg);
67 extern void vf_receiver_free(struct vframe_receiver_s *recv);
68 
69 extern int vf_reg_receiver(struct vframe_receiver_s *recv);
70 extern void vf_unreg_receiver(struct vframe_receiver_s *recv);
71 
72 struct vframe_receiver_s *vf_get_receiver(const char *provider_name);
73 
74 int vf_notify_receiver(const char *provider_name, int event_type, void *data);
75 
76 int vf_notify_receiver_by_name(const char *receiver_name, int event_type,
77 	void *data);
78 
79 #endif /* VFRAME_RECEIVER_H */
80