codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2008, The Android Open Source Project |
| 4 | ** Copyright 2010, Samsung Electronics Co. LTD |
| 5 | ** |
| 6 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | ** you may not use this file except in compliance with the License. |
| 8 | ** You may obtain a copy of the License at |
| 9 | ** |
| 10 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | ** |
| 12 | ** Unless required by applicable law or agreed to in writing, software |
| 13 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | ** See the License for the specific language governing permissions and |
| 16 | ** limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | /* |
| 20 | ** |
| 21 | ** @author Taikyung, Yu(taikyung.yu@samsung.com) |
| 22 | ** @date 2011-07-06 |
| 23 | */ |
| 24 | |
| 25 | #include <stdint.h> |
| 26 | #include <sys/types.h> |
| 27 | #include <binder/Parcel.h> |
| 28 | #include <utils/Log.h> |
| 29 | #include "ISecTVOut.h" |
| 30 | |
| 31 | namespace android { |
| 32 | |
| 33 | enum { |
| 34 | SET_HDMI_STATUS = IBinder::FIRST_CALL_TRANSACTION, |
| 35 | SET_HDMI_MODE, |
| 36 | SET_HDMI_RESOLUTION, |
| 37 | SET_HDMI_HDCP, |
| 38 | SET_HDMI_ROTATE, |
| 39 | SET_HDMI_HWCLAYER, |
| 40 | BLIT_2_HDMI |
| 41 | }; |
| 42 | |
| 43 | void BpSecTVOut::setHdmiCableStatus(uint32_t status) |
| 44 | { |
| 45 | Parcel data, reply; |
| 46 | data.writeInt32(status); |
| 47 | remote()->transact(SET_HDMI_STATUS, data, &reply); |
| 48 | } |
| 49 | |
| 50 | void BpSecTVOut::setHdmiMode(uint32_t mode) |
| 51 | { |
| 52 | Parcel data, reply; |
| 53 | data.writeInt32(mode); |
| 54 | remote()->transact(SET_HDMI_MODE, data, &reply); |
| 55 | } |
| 56 | |
| 57 | void BpSecTVOut::setHdmiResolution(uint32_t resolution) |
| 58 | { |
| 59 | Parcel data, reply; |
| 60 | data.writeInt32(resolution); |
| 61 | remote()->transact(SET_HDMI_RESOLUTION, data, &reply); |
| 62 | } |
| 63 | |
| 64 | void BpSecTVOut::setHdmiHdcp(uint32_t resolution) |
| 65 | { |
| 66 | Parcel data, reply; |
| 67 | data.writeInt32(resolution); |
| 68 | remote()->transact(SET_HDMI_HDCP, data, &reply); |
| 69 | } |
| 70 | |
| 71 | void BpSecTVOut::setHdmiRotate(uint32_t rotVal, uint32_t hwcLayer) |
| 72 | { |
| 73 | Parcel data, reply; |
| 74 | data.writeInt32(rotVal); |
| 75 | data.writeInt32(hwcLayer); |
| 76 | remote()->transact(SET_HDMI_ROTATE, data, &reply); |
| 77 | } |
| 78 | |
| 79 | void BpSecTVOut::setHdmiHwcLayer(uint32_t hwcLayer) |
| 80 | { |
| 81 | Parcel data, reply; |
| 82 | data.writeInt32(hwcLayer); |
| 83 | remote()->transact(SET_HDMI_HWCLAYER, data, &reply); |
| 84 | } |
| 85 | |
| 86 | void BpSecTVOut::blit2Hdmi(uint32_t w, uint32_t h, |
| 87 | uint32_t colorFormat, |
| 88 | uint32_t physYAddr, |
| 89 | uint32_t physCbAddr, |
| 90 | uint32_t physCrAddr, |
| 91 | uint32_t dstX, |
| 92 | uint32_t dstY, |
| 93 | uint32_t hdmiLayer, |
| 94 | uint32_t num_of_hwc_layer) |
| 95 | { |
| 96 | Parcel data, reply; |
| 97 | data.writeInt32(w); |
| 98 | data.writeInt32(h); |
| 99 | data.writeInt32(colorFormat); |
| 100 | data.writeInt32(physYAddr); |
| 101 | data.writeInt32(physCbAddr); |
| 102 | data.writeInt32(physCrAddr); |
| 103 | data.writeInt32(dstX); |
| 104 | data.writeInt32(dstY); |
| 105 | data.writeInt32(hdmiLayer); |
| 106 | data.writeInt32(num_of_hwc_layer); |
| 107 | remote()->transact(BLIT_2_HDMI, data, &reply); |
| 108 | } |
| 109 | |
| 110 | IMPLEMENT_META_INTERFACE(SecTVOut, "android.os.ISecTVOut"); |
| 111 | }; |