1 /*
2  * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * Authors:
25  *    tianyang.zhu <tianyang.zhu@intel.com>
26  */
27 
28 #ifndef _PSB_MDS_H_
29 #define _PSB_MDS_H_
30 
31 #ifdef TARGET_HAS_MULTIPLE_DISPLAY
32 #include <display/MultiDisplayService.h>
33 #ifdef PSBVIDEO_MRFL_VPP
34 #include <VPPSetting.h>
35 #endif
36 #endif
37 
38 #ifdef TARGET_HAS_MULTIPLE_DISPLAY
39 enum {
40     MDS_INIT_VALUE = 0,
41     MDS_HDMI_VIDEO_ISPLAYING,
42     MDS_WIDI_VIDEO_ISPLAYING,
43 };
44 #endif
45 
46 namespace android {
47 namespace intel {
48 
49 class psbMultiDisplayListener {
50 private:
51     sp<IMDService>  mMds;
52     sp<IMultiDisplayInfoProvider> mListener;
53 public:
54     psbMultiDisplayListener();
55     ~psbMultiDisplayListener();
checkMode(int value,int bit)56     inline bool checkMode(int value, int bit) {
57         return (value & bit) == bit ? true : false;
58     }
59 
60     int  getMode();
61     // only for WIDI video playback
62     bool getDecoderOutputResolution(
63             int32_t* width, int32_t* height,
64             int32_t* offX, int32_t* offY,
65             int32_t* bufW, int32_t* bufH);
66     bool getVppState();
67 };
68 
69 }; // namespace android
70 }; // namespace intel
71 
72 #endif
73