blob: 0d6880f33787ac677c6ccbae27eedeb493f8d67f
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_VGA, |
21 | SOURCE_MPEG, |
22 | SOURCE_DTV, |
23 | SOURCE_SVIDEO, |
24 | SOURCE_IPTV, |
25 | SOURCE_DUMMY, |
26 | SOURCE_SPDIF, |
27 | SOURCE_MAX, |
28 | } tv_source_input_t; |
29 | |
30 | class TvPlayObserver { |
31 | public: |
32 | TvPlayObserver() {}; |
33 | virtual ~TvPlayObserver() {}; |
34 | virtual void onTvEvent (int32_t msgType, const Parcel &p) = 0; |
35 | }; |
36 | |
37 | class TvPlay : public TvListener { |
38 | public: |
39 | TvPlay(); |
40 | ~TvPlay(); |
41 | int StartTv(); |
42 | int StopTv(); |
43 | int SwitchSourceInput(tv_source_input_t source_input); |
44 | //type , 1 is instaboot suspend |
45 | int DoSuspend(int type); |
46 | int DoResume(int type); |
47 | int GetSourceConnectStatus(tv_source_input_t source_input); |
48 | int GetCurrentSourceInput(); |
49 | int GetHdmiAvHotplugDetectOnoff(); |
50 | int setTvObserver (TvPlayObserver *ob); |
51 | int getAllTvDevices(int *devices, int *count); |
52 | int getHdmiPorts(); |
53 | int getHdmiPort(tv_source_input_t source_input); |
54 | virtual void notify(int32_t msgType, const Parcel &p); |
55 | |
56 | sp<TvClient> tvSession; |
57 | |
58 | private: |
59 | TvPlayObserver *mpObserver; |
60 | int mHdmiPorts; |
61 | }; |
62 | |
63 | #ifdef __cplusplus |
64 | //} |
65 | #endif |
66 | |
67 | #endif/*_ANDROID_TV_PLAY_H_*/ |
68 |