blob: 335895e6a5e4503dc296ebf4e5c6557fd2f2598f
1 | #ifndef _ANDROID_TV_PLAY_H_ |
2 | #define _ANDROID_TV_PLAY_H_ |
3 | |
4 | #ifdef __cplusplus |
5 | //extern "C" { |
6 | #endif |
7 | |
8 | #include <TvClient.h> |
9 | |
10 | typedef enum tv_source_input_e { |
11 | SOURCE_INVALID = -1, |
12 | SOURCE_TV = 0, |
13 | SOURCE_AV1, |
14 | SOURCE_AV2, |
15 | SOURCE_YPBPR1, |
16 | SOURCE_YPBPR2, |
17 | SOURCE_HDMI1, |
18 | SOURCE_HDMI2, |
19 | SOURCE_HDMI3, |
20 | SOURCE_HDMI4, |
21 | SOURCE_VGA, |
22 | SOURCE_MPEG, |
23 | SOURCE_DTV, |
24 | SOURCE_SVIDEO, |
25 | SOURCE_IPTV, |
26 | SOURCE_DUMMY, |
27 | SOURCE_SPDIF, |
28 | SOURCE_ADTV, |
29 | SOURCE_MAX, |
30 | } tv_source_input_t; |
31 | |
32 | typedef enum tv_source_type_e { |
33 | TYPE_REAL, |
34 | TYPE_VIRTUAL, |
35 | } tv_source_type_t; |
36 | |
37 | class TvPlayObserver { |
38 | public: |
39 | TvPlayObserver() {}; |
40 | virtual ~TvPlayObserver() {}; |
41 | virtual void onTvEvent (int32_t msgType, const Parcel &p) = 0; |
42 | }; |
43 | |
44 | class TvPlay : public TvListener { |
45 | public: |
46 | TvPlay(); |
47 | ~TvPlay(); |
48 | int StartTv(); |
49 | int StopTv(); |
50 | int SwitchSourceInput(tv_source_input_t source_input); |
51 | //type , 1 is instaboot suspend |
52 | int DoSuspend(int type); |
53 | int DoResume(int type); |
54 | int GetSourceConnectStatus(tv_source_input_t source_input); |
55 | int GetCurrentSourceInput(); |
56 | int GetHdmiAvHotplugDetectOnoff(); |
57 | int setTvObserver (TvPlayObserver *ob); |
58 | int getAllTvDevices(int *devices, int *count); |
59 | int getHdmiPorts(); |
60 | int getHdmiPort(tv_source_input_t source_input); |
61 | virtual void notify(int32_t msgType, const Parcel &p); |
62 | |
63 | sp<TvClient> tvSession; |
64 | |
65 | private: |
66 | TvPlayObserver *mpObserver; |
67 | int mHdmiPorts; |
68 | }; |
69 | |
70 | #ifdef __cplusplus |
71 | //} |
72 | #endif |
73 | |
74 | #endif/*_ANDROID_TV_PLAY_H_*/ |
75 |