summaryrefslogtreecommitdiff
path: root/TvPlay.h (plain)
blob: 57493d615fea1a7325ba59009078b78f41e27a76
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
10typedef 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
32typedef enum tv_source_type_e {
33 TYPE_REAL,
34 TYPE_VIRTUAL,
35} tv_source_type_t;
36
37class TvPlayObserver {
38public:
39 TvPlayObserver() {};
40 virtual ~TvPlayObserver() {};
41 virtual void onTvEvent (int32_t msgType, const Parcel &p) = 0;
42};
43
44class TvPlay : public TvListener {
45public:
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
65private:
66 TvPlayObserver *mpObserver;
67 int mHdmiPorts;
68 int max_port_num = 4;
69 int hdmi_port[4];// the length of hdmi_port should be equal to max_port_num
70};
71
72#ifdef __cplusplus
73//}
74#endif
75
76#endif/*_ANDROID_TV_PLAY_H_*/
77