summaryrefslogtreecommitdiff
path: root/tv_input.h (plain)
blob: e48992c7ebef26a1d80081b3a47027209e5ca9c5
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 * @author Tellen Yu
16 * @version 1.0
17 * @date 2018/1/12
18 * @par function description:
19 * - 1 tv input hal
20 */
21
22#ifndef _ANDROID_TV_INPUT_HAL_H_
23#define _ANDROID_TV_INPUT_HAL_H_
24
25#ifdef __cplusplus
26//extern "C" {
27#endif
28
29#include "TvInputIntf.h"
30#include "aml_screen.h"
31
32#define LOGD(...) \
33{ \
34__android_log_print(ANDROID_LOG_DEBUG, "tv_input", __VA_ARGS__); }
35
36#ifndef container_of
37#define container_of(ptr, type, member) \
38 (type *)((char*)(ptr) - offsetof(type, member))
39#endif
40
41class EventCallback : public TvPlayObserver {
42public:
43 EventCallback(void *data) {
44 mPri = data;
45 }
46
47 ~EventCallback() {}
48
49 void onTvEvent (const source_connect_t &scrConnect);
50private:
51 void *mPri;
52};
53
54struct sideband_handle_t {
55 native_handle_t nativeHandle;
56 int identflag;
57 int usage;
58};
59
60typedef struct tv_input_private {
61 tv_input_device_t device;
62 const tv_input_callback_ops_t *callback;
63 void *callback_data;
64 aml_screen_device_t *mDev;
65 TvInputIntf *mpTv;
66 EventCallback *eventCallback;
67} tv_input_private_t;
68
69enum {
70 STREAM_ID_NORMAL = 1,
71 STREAM_ID_FRAME_CAPTURE = 2,
72};
73
74void channelControl(tv_input_private_t *priv, bool opsStart, int device_id);
75int notifyDeviceStatus(tv_input_private_t *priv, tv_source_input_t inputSrc, int type);
76void initTvDevices(tv_input_private_t *priv);
77
78#ifdef __cplusplus
79//}
80#endif
81
82#endif /*_ANDROID_TV_INPUT_HAL_H_*/
83
84