Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | */ |
| 16 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 18 | |
| 19 | import android.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | |
| 22 | /** |
| 23 | * Represents attributes of video calls. |
| 24 | */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 25 | public class VideoProfile implements Parcelable { |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 26 | /** |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 27 | * "Unknown" video quality. |
| 28 | * @hide |
| 29 | */ |
| 30 | public static final int QUALITY_UNKNOWN = 0; |
| 31 | /** |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 32 | * "High" video quality. |
| 33 | */ |
| 34 | public static final int QUALITY_HIGH = 1; |
| 35 | |
| 36 | /** |
| 37 | * "Medium" video quality. |
| 38 | */ |
| 39 | public static final int QUALITY_MEDIUM = 2; |
| 40 | |
| 41 | /** |
| 42 | * "Low" video quality. |
| 43 | */ |
| 44 | public static final int QUALITY_LOW = 3; |
| 45 | |
| 46 | /** |
| 47 | * Use default video quality. |
| 48 | */ |
| 49 | public static final int QUALITY_DEFAULT = 4; |
| 50 | |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 51 | /** |
| 52 | * Call is currently in an audio-only mode with no video transmission or receipt. |
| 53 | */ |
| 54 | public static final int STATE_AUDIO_ONLY = 0x0; |
| 55 | |
| 56 | /** |
| 57 | * Video transmission is enabled. |
| 58 | */ |
| 59 | public static final int STATE_TX_ENABLED = 0x1; |
| 60 | |
| 61 | /** |
| 62 | * Video reception is enabled. |
| 63 | */ |
| 64 | public static final int STATE_RX_ENABLED = 0x2; |
| 65 | |
| 66 | /** |
| 67 | * Video signal is bi-directional. |
| 68 | */ |
| 69 | public static final int STATE_BIDIRECTIONAL = STATE_TX_ENABLED | STATE_RX_ENABLED; |
| 70 | |
| 71 | /** |
| 72 | * Video is paused. |
| 73 | */ |
| 74 | public static final int STATE_PAUSED = 0x4; |
| 75 | |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 76 | private final int mVideoState; |
| 77 | |
| 78 | private final int mQuality; |
| 79 | |
| 80 | /** |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 81 | * Creates an instance of the VideoProfile |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 82 | * |
| 83 | * @param videoState The video state. |
Andrew Lee | 055e5a2 | 2014-07-21 12:14:11 -0700 | [diff] [blame] | 84 | */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 85 | public VideoProfile(int videoState) { |
Andrew Lee | 055e5a2 | 2014-07-21 12:14:11 -0700 | [diff] [blame] | 86 | this(videoState, QUALITY_DEFAULT); |
| 87 | } |
| 88 | |
| 89 | /** |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 90 | * Creates an instance of the VideoProfile |
Andrew Lee | 055e5a2 | 2014-07-21 12:14:11 -0700 | [diff] [blame] | 91 | * |
| 92 | * @param videoState The video state. |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 93 | * @param quality The video quality. |
| 94 | */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 95 | public VideoProfile(int videoState, int quality) { |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 96 | mVideoState = videoState; |
| 97 | mQuality = quality; |
| 98 | } |
| 99 | |
| 100 | /** |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 101 | * The video state of the call. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 102 | * Valid values: {@link VideoProfile#STATE_AUDIO_ONLY}, |
| 103 | * {@link VideoProfile#STATE_BIDIRECTIONAL}, |
| 104 | * {@link VideoProfile#STATE_TX_ENABLED}, |
| 105 | * {@link VideoProfile#STATE_RX_ENABLED}, |
| 106 | * {@link VideoProfile#STATE_PAUSED}. |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 107 | */ |
| 108 | public int getVideoState() { |
| 109 | return mVideoState; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * The desired video quality for the call. |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 114 | * Valid values: {@link VideoProfile#QUALITY_HIGH}, {@link VideoProfile#QUALITY_MEDIUM}, |
| 115 | * {@link VideoProfile#QUALITY_LOW}, {@link VideoProfile#QUALITY_DEFAULT}. |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 116 | */ |
| 117 | public int getQuality() { |
| 118 | return mQuality; |
| 119 | } |
| 120 | |
| 121 | /** |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 122 | * Responsible for creating VideoProfile objects from deserialized Parcels. |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 123 | **/ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 124 | public static final Parcelable.Creator<VideoProfile> CREATOR = |
| 125 | new Parcelable.Creator<VideoProfile> () { |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 126 | /** |
| 127 | * Creates a MediaProfile instances from a parcel. |
| 128 | * |
| 129 | * @param source The parcel. |
| 130 | * @return The MediaProfile. |
| 131 | */ |
| 132 | @Override |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 133 | public VideoProfile createFromParcel(Parcel source) { |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 134 | int state = source.readInt(); |
| 135 | int quality = source.readInt(); |
| 136 | |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 137 | ClassLoader classLoader = VideoProfile.class.getClassLoader(); |
| 138 | return new VideoProfile(state, quality); |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | @Override |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 142 | public VideoProfile[] newArray(int size) { |
| 143 | return new VideoProfile[size]; |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 144 | } |
| 145 | }; |
| 146 | |
| 147 | /** |
| 148 | * Describe the kinds of special objects contained in this Parcelable's |
| 149 | * marshalled representation. |
| 150 | * |
| 151 | * @return a bitmask indicating the set of special object types marshalled |
| 152 | * by the Parcelable. |
| 153 | */ |
| 154 | @Override |
| 155 | public int describeContents() { |
| 156 | return 0; |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Flatten this object in to a Parcel. |
| 161 | * |
| 162 | * @param dest The Parcel in which the object should be written. |
| 163 | * @param flags Additional flags about how the object should be written. |
| 164 | * May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}. |
| 165 | */ |
| 166 | @Override |
| 167 | public void writeToParcel(Parcel dest, int flags) { |
| 168 | dest.writeInt(mVideoState); |
| 169 | dest.writeInt(mQuality); |
| 170 | } |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 171 | |
Tyler Gunn | bde0b1e | 2015-04-24 15:09:58 -0700 | [diff] [blame] | 172 | @Override |
| 173 | public String toString() { |
| 174 | StringBuilder sb = new StringBuilder(); |
| 175 | sb.append("[VideoProfile videoState = "); |
| 176 | sb.append(VideoState.videoStateToString(mVideoState)); |
| 177 | sb.append(" videoQuality = "); |
| 178 | sb.append(mQuality); |
| 179 | sb.append("]"); |
| 180 | return sb.toString(); |
| 181 | } |
| 182 | |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 183 | /** |
| 184 | * The video state of the call, stored as a bit-field describing whether video transmission and |
| 185 | * receipt it enabled, as well as whether the video is currently muted. |
| 186 | */ |
| 187 | public static class VideoState { |
| 188 | /** |
| 189 | * Call is currently in an audio-only mode with no video transmission or receipt. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 190 | * @deprecated Use {@link VideoProfile#STATE_AUDIO_ONLY} instead |
| 191 | * @hide |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 192 | */ |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 193 | public static final int AUDIO_ONLY = VideoProfile.STATE_AUDIO_ONLY; |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 194 | |
| 195 | /** |
| 196 | * Video transmission is enabled. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 197 | * @deprecated Use {@link VideoProfile#STATE_TX_ENABLED} instead |
| 198 | * @hide |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 199 | */ |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 200 | public static final int TX_ENABLED = VideoProfile.STATE_TX_ENABLED; |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 201 | |
| 202 | /** |
| 203 | * Video reception is enabled. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 204 | * @deprecated Use {@link VideoProfile#STATE_RX_ENABLED} instead |
| 205 | * @hide |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 206 | */ |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 207 | public static final int RX_ENABLED = VideoProfile.STATE_RX_ENABLED; |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 208 | |
| 209 | /** |
| 210 | * Video signal is bi-directional. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 211 | * @deprecated Use {@link VideoProfile#STATE_BIDIRECTIONAL} instead |
| 212 | * @hide |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 213 | */ |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 214 | public static final int BIDIRECTIONAL = VideoProfile.STATE_BIDIRECTIONAL; |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 215 | |
| 216 | /** |
| 217 | * Video is paused. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 218 | * @deprecated Use {@link VideoProfile#STATE_PAUSED} instead |
| 219 | * @hide |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 220 | */ |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 221 | public static final int PAUSED = VideoProfile.STATE_PAUSED; |
| 222 | |
| 223 | /** @hide */ |
| 224 | private VideoState() {} |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 225 | |
| 226 | /** |
| 227 | * Whether the video state is audio only. |
| 228 | * @param videoState The video state. |
| 229 | * @return Returns true if the video state is audio only. |
| 230 | */ |
| 231 | public static boolean isAudioOnly(int videoState) { |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 232 | return !hasState(videoState, VideoProfile.STATE_TX_ENABLED) |
| 233 | && !hasState(videoState, VideoProfile.STATE_RX_ENABLED); |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | /** |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 237 | * Whether the video state is any of the video type |
| 238 | * @param videoState The video state. |
| 239 | * @hide |
| 240 | * @return Returns true if the video state TX or RX or Bidirectional |
| 241 | */ |
| 242 | public static boolean isVideo(int videoState) { |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 243 | return hasState(videoState, VideoProfile.STATE_TX_ENABLED) |
| 244 | || hasState(videoState, VideoProfile.STATE_RX_ENABLED) |
| 245 | || hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL); |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | /** |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 249 | * Whether the video transmission is enabled. |
| 250 | * @param videoState The video state. |
| 251 | * @return Returns true if the video transmission is enabled. |
| 252 | */ |
| 253 | public static boolean isTransmissionEnabled(int videoState) { |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 254 | return hasState(videoState, VideoProfile.STATE_TX_ENABLED); |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | /** |
| 258 | * Whether the video reception is enabled. |
| 259 | * @param videoState The video state. |
| 260 | * @return Returns true if the video transmission is enabled. |
| 261 | */ |
| 262 | public static boolean isReceptionEnabled(int videoState) { |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 263 | return hasState(videoState, VideoProfile.STATE_RX_ENABLED); |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | /** |
| 267 | * Whether the video signal is bi-directional. |
| 268 | * @param videoState |
| 269 | * @return Returns true if the video signal is bi-directional. |
| 270 | */ |
| 271 | public static boolean isBidirectional(int videoState) { |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 272 | return hasState(videoState, VideoProfile.STATE_BIDIRECTIONAL); |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | /** |
| 276 | * Whether the video is paused. |
| 277 | * @param videoState The video state. |
| 278 | * @return Returns true if the video is paused. |
| 279 | */ |
| 280 | public static boolean isPaused(int videoState) { |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame^] | 281 | return hasState(videoState, VideoProfile.STATE_PAUSED); |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Determines if a specified state is set in a videoState bit-mask. |
| 286 | * |
| 287 | * @param videoState The video state bit-mask. |
| 288 | * @param state The state to check. |
| 289 | * @return {@code True} if the state is set. |
| 290 | * {@hide} |
| 291 | */ |
| 292 | private static boolean hasState(int videoState, int state) { |
| 293 | return (videoState & state) == state; |
| 294 | } |
Tyler Gunn | bde0b1e | 2015-04-24 15:09:58 -0700 | [diff] [blame] | 295 | |
| 296 | /** |
| 297 | * Generates a string representation of a {@link VideoState}. |
| 298 | * |
| 299 | * @param videoState The video state. |
| 300 | * @return String representation of the {@link VideoState}. |
| 301 | */ |
| 302 | public static String videoStateToString(int videoState) { |
| 303 | StringBuilder sb = new StringBuilder(); |
| 304 | sb.append("Audio"); |
| 305 | |
| 306 | if (VideoProfile.VideoState.isTransmissionEnabled(videoState)) { |
| 307 | sb.append(" Tx"); |
| 308 | } |
| 309 | |
| 310 | if (VideoProfile.VideoState.isReceptionEnabled(videoState)) { |
| 311 | sb.append(" Rx"); |
| 312 | } |
| 313 | |
| 314 | if (VideoProfile.VideoState.isPaused(videoState)) { |
| 315 | sb.append(" Pause"); |
| 316 | } |
| 317 | |
| 318 | return sb.toString(); |
| 319 | } |
Andrew Lee | 48332d6 | 2014-07-28 14:04:20 -0700 | [diff] [blame] | 320 | } |
Yorke Lee | 400470f | 2015-05-12 13:31:25 -0700 | [diff] [blame] | 321 | |
| 322 | /** |
| 323 | * Represents the camera capabilities important to a Video Telephony provider. |
| 324 | */ |
| 325 | public static final class CameraCapabilities implements Parcelable { |
| 326 | |
| 327 | /** |
| 328 | * The width of the camera video in pixels. |
| 329 | */ |
| 330 | private final int mWidth; |
| 331 | |
| 332 | /** |
| 333 | * The height of the camera video in pixels. |
| 334 | */ |
| 335 | private final int mHeight; |
| 336 | |
| 337 | /** |
| 338 | * Whether the camera supports zoom. |
| 339 | */ |
| 340 | private final boolean mZoomSupported; |
| 341 | |
| 342 | /** |
| 343 | * The maximum zoom supported by the camera. |
| 344 | */ |
| 345 | private final float mMaxZoom; |
| 346 | |
| 347 | /** |
| 348 | * Create a call camera capabilities instance. |
| 349 | * |
| 350 | * @param width The width of the camera video (in pixels). |
| 351 | * @param height The height of the camera video (in pixels). |
| 352 | */ |
| 353 | public CameraCapabilities(int width, int height) { |
| 354 | this(width, height, false, 1.0f); |
| 355 | } |
| 356 | |
| 357 | /** |
| 358 | * Create a call camera capabilities instance that optionally |
| 359 | * supports zoom. |
| 360 | * |
| 361 | * @param width The width of the camera video (in pixels). |
| 362 | * @param height The height of the camera video (in pixels). |
| 363 | * @param zoomSupported True when camera supports zoom. |
| 364 | * @param maxZoom Maximum zoom supported by camera. |
| 365 | * @hide |
| 366 | */ |
| 367 | public CameraCapabilities(int width, int height, boolean zoomSupported, float maxZoom) { |
| 368 | mWidth = width; |
| 369 | mHeight = height; |
| 370 | mZoomSupported = zoomSupported; |
| 371 | mMaxZoom = maxZoom; |
| 372 | } |
| 373 | |
| 374 | /** |
| 375 | * Responsible for creating CallCameraCapabilities objects from deserialized Parcels. |
| 376 | **/ |
| 377 | public static final Parcelable.Creator<CameraCapabilities> CREATOR = |
| 378 | new Parcelable.Creator<CameraCapabilities> () { |
| 379 | /** |
| 380 | * Creates a CallCameraCapabilities instances from a parcel. |
| 381 | * |
| 382 | * @param source The parcel. |
| 383 | * @return The CallCameraCapabilities. |
| 384 | */ |
| 385 | @Override |
| 386 | public CameraCapabilities createFromParcel(Parcel source) { |
| 387 | int width = source.readInt(); |
| 388 | int height = source.readInt(); |
| 389 | boolean supportsZoom = source.readByte() != 0; |
| 390 | float maxZoom = source.readFloat(); |
| 391 | |
| 392 | return new CameraCapabilities(width, height, supportsZoom, maxZoom); |
| 393 | } |
| 394 | |
| 395 | @Override |
| 396 | public CameraCapabilities[] newArray(int size) { |
| 397 | return new CameraCapabilities[size]; |
| 398 | } |
| 399 | }; |
| 400 | |
| 401 | /** |
| 402 | * Describe the kinds of special objects contained in this Parcelable's |
| 403 | * marshalled representation. |
| 404 | * |
| 405 | * @return a bitmask indicating the set of special object types marshalled |
| 406 | * by the Parcelable. |
| 407 | */ |
| 408 | @Override |
| 409 | public int describeContents() { |
| 410 | return 0; |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * Flatten this object in to a Parcel. |
| 415 | * |
| 416 | * @param dest The Parcel in which the object should be written. |
| 417 | * @param flags Additional flags about how the object should be written. |
| 418 | * May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}. |
| 419 | */ |
| 420 | @Override |
| 421 | public void writeToParcel(Parcel dest, int flags) { |
| 422 | dest.writeInt(getWidth()); |
| 423 | dest.writeInt(getHeight()); |
| 424 | dest.writeByte((byte) (isZoomSupported() ? 1 : 0)); |
| 425 | dest.writeFloat(getMaxZoom()); |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * The width of the camera video in pixels. |
| 430 | */ |
| 431 | public int getWidth() { |
| 432 | return mWidth; |
| 433 | } |
| 434 | |
| 435 | /** |
| 436 | * The height of the camera video in pixels. |
| 437 | */ |
| 438 | public int getHeight() { |
| 439 | return mHeight; |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * Whether the camera supports zoom. |
| 444 | * @hide |
| 445 | */ |
| 446 | public boolean isZoomSupported() { |
| 447 | return mZoomSupported; |
| 448 | } |
| 449 | |
| 450 | /** |
| 451 | * The maximum zoom supported by the camera. |
| 452 | * @hide |
| 453 | */ |
| 454 | public float getMaxZoom() { |
| 455 | return mMaxZoom; |
| 456 | } |
| 457 | } |
| 458 | |
Tyler Gunn | 7c668b9 | 2014-06-27 14:38:28 -0700 | [diff] [blame] | 459 | } |