Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 3 | * Copyright (C) 2012, The Linux Foundation. All rights reserved. |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
Naseer Ahmed | 72cf976 | 2012-07-21 12:17:13 -0700 | [diff] [blame] | 18 | #define VIDEO_DEBUG 0 |
| 19 | #include <overlay.h> |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 20 | #include "hwc_video.h" |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 21 | #include "hwc_utils.h" |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 22 | |
| 23 | namespace qhwc { |
| 24 | |
| 25 | #define FINAL_TRANSFORM_MASK 0x000F |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 26 | |
| 27 | //Static Members |
| 28 | ovutils::eOverlayState VideoOverlay::sState = ovutils::OV_CLOSED; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 29 | bool VideoOverlay::sIsModeOn = false; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 30 | |
| 31 | //Cache stats, figure out the state, config overlay |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 32 | bool VideoOverlay::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list, |
| 33 | int dpy) { |
| 34 | int yuvIndex = ctx->listStats[dpy].yuvIndex; |
| 35 | |
Naseer Ahmed | 96c4c95 | 2012-07-25 18:27:14 -0700 | [diff] [blame] | 36 | if(!ctx->mMDP.hasOverlay) { |
Naseer Ahmed | 31da0b1 | 2012-07-31 18:55:33 -0700 | [diff] [blame] | 37 | ALOGD_IF(VIDEO_DEBUG,"%s, this hw doesnt support overlay", __FUNCTION__); |
| 38 | return false; |
| 39 | } |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 40 | if(yuvIndex == -1) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 41 | return false; |
| 42 | } |
Naseer Ahmed | 4c588a2 | 2012-07-31 19:12:17 -0700 | [diff] [blame] | 43 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 44 | //index guaranteed to be not -1 at this point |
| 45 | hwc_layer_1_t *yuvLayer = &list->hwLayers[yuvIndex]; |
| 46 | chooseState(ctx, dpy, yuvLayer); |
| 47 | if(configure(ctx, dpy, yuvLayer)) { |
| 48 | markFlags(yuvLayer); |
| 49 | sIsModeOn = true; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 52 | return sIsModeOn; |
| 53 | } |
| 54 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 55 | void VideoOverlay::chooseState(hwc_context_t *ctx, int dpy, |
| 56 | hwc_layer_1_t *yuvLayer) { |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 57 | ALOGD_IF(VIDEO_DEBUG, "%s: old state = %s", __FUNCTION__, |
| 58 | ovutils::getStateString(sState)); |
| 59 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 60 | private_handle_t *hnd = NULL; |
| 61 | if(yuvLayer) { |
| 62 | hnd = (private_handle_t *)yuvLayer->handle; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 63 | } |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 64 | ovutils::eOverlayState newState = ovutils::OV_CLOSED; |
| 65 | switch(dpy) { |
| 66 | case HWC_DISPLAY_PRIMARY: |
| 67 | if(ctx->listStats[dpy].yuvCount == 1) { |
Saurabh Shah | 86623d7 | 2012-09-25 19:39:17 -0700 | [diff] [blame] | 68 | newState = isExternalActive(ctx) ? |
| 69 | ovutils::OV_2D_VIDEO_ON_PANEL_TV : ovutils::OV_2D_VIDEO_ON_PANEL; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 70 | if(isSkipLayer(yuvLayer) && !isSecureBuffer(hnd)) { |
Saurabh Shah | 86623d7 | 2012-09-25 19:39:17 -0700 | [diff] [blame] | 71 | newState = isExternalActive(ctx) ? |
| 72 | ovutils::OV_2D_VIDEO_ON_TV : ovutils::OV_CLOSED; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 73 | } |
| 74 | } |
| 75 | break; |
| 76 | case HWC_DISPLAY_EXTERNAL: |
| 77 | //TODO needs overlay state change for UI also |
| 78 | newState = sState; //Previously set by HWC_DISPLAY_PRIMARY |
| 79 | /*if(ctx->listStats[dpy].yuvCount == 1 && isExternalActive(ctx)) { |
| 80 | if(!isSkipLayer(yuvLayer) || isSecureBuffer(hnd)) { |
| 81 | switch(sState) { //set by primary chooseState |
| 82 | case ovutils::OV_2D_VIDEO_ON_PANEL: |
| 83 | //upgrade |
| 84 | sState = ovutils::OV_2D_VIDEO_PANEL_TV; |
| 85 | break; |
| 86 | case ovutils::OV_CLOSED: |
| 87 | sState = ovutils::OV_2D_VIDEO_ON_TV; |
| 88 | break; |
| 89 | } |
| 90 | } |
| 91 | }*/ |
| 92 | break; |
| 93 | default: |
| 94 | break; |
| 95 | } |
| 96 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 97 | sState = newState; |
| 98 | ALOGD_IF(VIDEO_DEBUG, "%s: new chosen state = %s", __FUNCTION__, |
| 99 | ovutils::getStateString(sState)); |
| 100 | } |
| 101 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 102 | void VideoOverlay::markFlags(hwc_layer_1_t *yuvLayer) { |
| 103 | if(yuvLayer) { |
| 104 | yuvLayer->compositionType = HWC_OVERLAY; |
| 105 | yuvLayer->hints |= HWC_HINT_CLEAR_FB; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 106 | } |
| 107 | } |
| 108 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 109 | /* Helpers */ |
Naseer Ahmed | 5b6708a | 2012-08-02 13:46:08 -0700 | [diff] [blame] | 110 | bool configPrimVid(hwc_context_t *ctx, hwc_layer_1_t *layer) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 111 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 112 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 113 | ovutils::Whf info(hnd->width, hnd->height, hnd->format, hnd->size); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 114 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 115 | ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_FLAGS_NONE; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 116 | if (isSecureBuffer(hnd)) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 117 | ovutils::setMdpFlags(mdpFlags, |
| 118 | ovutils::OV_MDP_SECURE_OVERLAY_SESSION); |
| 119 | } |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 120 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 121 | ovutils::eIsFg isFgFlag = ovutils::IS_FG_OFF; |
| 122 | if (ctx->numHwLayers == 1) { |
| 123 | isFgFlag = ovutils::IS_FG_SET; |
| 124 | } |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 125 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 126 | ovutils::PipeArgs parg(mdpFlags, |
| 127 | info, |
| 128 | ovutils::ZORDER_0, |
| 129 | isFgFlag, |
| 130 | ovutils::ROT_FLAG_DISABLED); |
| 131 | ovutils::PipeArgs pargs[ovutils::MAX_PIPES] = { parg, parg, parg }; |
| 132 | ov.setSource(pargs, ovutils::OV_PIPE0); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 133 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 134 | hwc_rect_t sourceCrop = layer->sourceCrop; |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 135 | hwc_rect_t displayFrame = layer->displayFrame; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 136 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 137 | //Calculate the rect for primary based on whether the supplied position |
| 138 | //is within or outside bounds. |
| 139 | const int fbWidth = |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 140 | ovutils::FrameBufferInfo::getInstance()->getWidth(); |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 141 | const int fbHeight = |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 142 | ovutils::FrameBufferInfo::getInstance()->getHeight(); |
| 143 | |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 144 | if( displayFrame.left < 0 || |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 145 | displayFrame.top < 0 || |
| 146 | displayFrame.right > fbWidth || |
| 147 | displayFrame.bottom > fbHeight) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 148 | calculate_crop_rects(sourceCrop, displayFrame, fbWidth, fbHeight); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 149 | } |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 150 | |
Saurabh Shah | 1023ce2 | 2012-09-05 18:45:59 -0700 | [diff] [blame] | 151 | // source crop x,y,w,h |
| 152 | ovutils::Dim dcrop(sourceCrop.left, sourceCrop.top, |
| 153 | sourceCrop.right - sourceCrop.left, |
| 154 | sourceCrop.bottom - sourceCrop.top); |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 155 | //Only for Primary |
| 156 | ov.setCrop(dcrop, ovutils::OV_PIPE0); |
| 157 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 158 | int transform = layer->transform; |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 159 | ovutils::eTransform orient = |
| 160 | static_cast<ovutils::eTransform>(transform); |
| 161 | ov.setTransform(orient, ovutils::OV_PIPE0); |
| 162 | |
Saurabh Shah | 1023ce2 | 2012-09-05 18:45:59 -0700 | [diff] [blame] | 163 | // position x,y,w,h |
| 164 | ovutils::Dim dpos(displayFrame.left, |
| 165 | displayFrame.top, |
| 166 | displayFrame.right - displayFrame.left, |
| 167 | displayFrame.bottom - displayFrame.top); |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 168 | ov.setPosition(dpos, ovutils::OV_PIPE0); |
| 169 | |
| 170 | if (!ov.commit(ovutils::OV_PIPE0)) { |
| 171 | ALOGE("%s: commit fails", __FUNCTION__); |
| 172 | return false; |
| 173 | } |
| 174 | return true; |
| 175 | } |
| 176 | |
Naseer Ahmed | 5b6708a | 2012-08-02 13:46:08 -0700 | [diff] [blame] | 177 | bool configExtVid(hwc_context_t *ctx, hwc_layer_1_t *layer) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 178 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 179 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 180 | ovutils::Whf info(hnd->width, hnd->height, hnd->format, hnd->size); |
| 181 | |
| 182 | ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_FLAGS_NONE; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 183 | if (isSecureBuffer(hnd)) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 184 | ovutils::setMdpFlags(mdpFlags, |
| 185 | ovutils::OV_MDP_SECURE_OVERLAY_SESSION); |
| 186 | } |
| 187 | |
| 188 | ovutils::eIsFg isFgFlag = ovutils::IS_FG_OFF; |
| 189 | if (ctx->numHwLayers == 1) { |
| 190 | isFgFlag = ovutils::IS_FG_SET; |
| 191 | } |
| 192 | |
| 193 | ovutils::PipeArgs parg(mdpFlags, |
| 194 | info, |
| 195 | ovutils::ZORDER_0, |
| 196 | isFgFlag, |
| 197 | ovutils::ROT_FLAG_DISABLED); |
| 198 | ovutils::PipeArgs pargs[ovutils::MAX_PIPES] = { parg, parg, parg }; |
| 199 | ov.setSource(pargs, ovutils::OV_PIPE1); |
| 200 | |
| 201 | hwc_rect_t sourceCrop = layer->sourceCrop; |
| 202 | // x,y,w,h |
| 203 | ovutils::Dim dcrop(sourceCrop.left, sourceCrop.top, |
| 204 | sourceCrop.right - sourceCrop.left, |
| 205 | sourceCrop.bottom - sourceCrop.top); |
| 206 | //Only for External |
| 207 | ov.setCrop(dcrop, ovutils::OV_PIPE1); |
| 208 | |
| 209 | // FIXME: Use source orientation for TV when source is portrait |
| 210 | //Only for External |
| 211 | ov.setTransform(0, ovutils::OV_PIPE1); |
| 212 | |
| 213 | ovutils::Dim dpos; |
| 214 | hwc_rect_t displayFrame = layer->displayFrame; |
| 215 | dpos.x = displayFrame.left; |
| 216 | dpos.y = displayFrame.top; |
| 217 | dpos.w = (displayFrame.right - displayFrame.left); |
| 218 | dpos.h = (displayFrame.bottom - displayFrame.top); |
| 219 | |
| 220 | //Only for External |
| 221 | ov.setPosition(dpos, ovutils::OV_PIPE1); |
| 222 | |
| 223 | if (!ov.commit(ovutils::OV_PIPE1)) { |
| 224 | ALOGE("%s: commit fails", __FUNCTION__); |
| 225 | return false; |
| 226 | } |
| 227 | return true; |
| 228 | } |
| 229 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 230 | bool VideoOverlay::configure(hwc_context_t *ctx, int dpy, |
| 231 | hwc_layer_1_t *yuvLayer) { |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 232 | bool ret = true; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 233 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 234 | switch(dpy) { |
| 235 | case HWC_DISPLAY_PRIMARY: |
| 236 | // Set overlay state |
| 237 | ov.setState(sState); |
| 238 | switch(sState) { |
| 239 | case ovutils::OV_2D_VIDEO_ON_PANEL: |
| 240 | ret &= configPrimVid(ctx, yuvLayer); |
| 241 | break; |
Saurabh Shah | 86623d7 | 2012-09-25 19:39:17 -0700 | [diff] [blame] | 242 | case ovutils::OV_2D_VIDEO_ON_PANEL_TV: |
| 243 | ret &= configPrimVid(ctx, yuvLayer); |
| 244 | ret &= configExtVid(ctx, yuvLayer); |
| 245 | break; |
| 246 | case ovutils::OV_2D_VIDEO_ON_TV: |
| 247 | ret &= configExtVid(ctx, yuvLayer); |
| 248 | break; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 249 | default: |
| 250 | return false; |
| 251 | } |
| 252 | break; |
| 253 | case HWC_DISPLAY_EXTERNAL: |
| 254 | ov.setState(sState); |
| 255 | switch(sState) { |
| 256 | case ovutils::OV_2D_VIDEO_ON_PANEL_TV: |
| 257 | case ovutils::OV_2D_VIDEO_ON_TV: |
| 258 | ret = configExtVid(ctx, yuvLayer); |
| 259 | break; |
| 260 | default: |
| 261 | return false; |
| 262 | } |
| 263 | break; |
Naseer Ahmed | 2cc53dd | 2012-07-31 19:11:48 -0700 | [diff] [blame] | 264 | } |
| 265 | return ret; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 266 | } |
| 267 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 268 | bool VideoOverlay::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list, |
| 269 | int dpy) |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 270 | { |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 271 | int yuvIndex = ctx->listStats[dpy].yuvIndex; |
| 272 | if(!sIsModeOn || yuvIndex == -1) { |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 273 | return true; |
| 274 | } |
| 275 | |
Naseer Ahmed | 4c588a2 | 2012-07-31 19:12:17 -0700 | [diff] [blame] | 276 | private_handle_t *hnd = (private_handle_t *) |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 277 | list->hwLayers[yuvIndex].handle; |
Naseer Ahmed | 4c588a2 | 2012-07-31 19:12:17 -0700 | [diff] [blame] | 278 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 279 | bool ret = true; |
| 280 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 281 | ovutils::eOverlayState state = ov.getState(); |
| 282 | |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 283 | switch(dpy) { |
| 284 | case HWC_DISPLAY_PRIMARY: |
| 285 | switch (state) { |
| 286 | case ovutils::OV_2D_VIDEO_ON_PANEL: |
| 287 | // Play primary |
| 288 | if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE0)) { |
| 289 | ALOGE("%s: queueBuffer failed for primary", __FUNCTION__); |
| 290 | ret = false; |
| 291 | } |
| 292 | break; |
Saurabh Shah | 86623d7 | 2012-09-25 19:39:17 -0700 | [diff] [blame] | 293 | case ovutils::OV_2D_VIDEO_ON_PANEL_TV: |
| 294 | if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE0)) { |
| 295 | ALOGE("%s: queueBuffer failed for primary", __FUNCTION__); |
| 296 | ret = false; |
| 297 | } |
| 298 | // Play external |
| 299 | if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE1)) { |
| 300 | ALOGE("%s: queueBuffer failed for external", __FUNCTION__); |
| 301 | ret = false; |
| 302 | } |
| 303 | break; |
| 304 | case ovutils::OV_2D_VIDEO_ON_TV: |
| 305 | // Play external |
| 306 | if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE1)) { |
| 307 | ALOGE("%s: queueBuffer failed for external", __FUNCTION__); |
| 308 | ret = false; |
| 309 | } |
| 310 | break; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 311 | default: |
| 312 | ret = false; |
| 313 | break; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 314 | } |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 315 | break; |
Saurabh Shah | 3e858eb | 2012-09-17 16:53:21 -0700 | [diff] [blame] | 316 | case HWC_DISPLAY_EXTERNAL: |
| 317 | switch(state) { |
| 318 | case ovutils::OV_2D_VIDEO_ON_PANEL_TV: |
| 319 | case ovutils::OV_2D_VIDEO_ON_TV: |
| 320 | // Play external |
| 321 | if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE1)) { |
| 322 | ALOGE("%s: queueBuffer failed for external", __FUNCTION__); |
| 323 | ret = false; |
| 324 | } |
| 325 | break; |
| 326 | default: |
| 327 | ret = false; |
| 328 | break; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 329 | } |
| 330 | break; |
| 331 | } |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 332 | return ret; |
| 333 | } |
| 334 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 335 | }; //namespace qhwc |