Chih-Wei Huang | 0d92eda | 2012-02-07 16:55:49 +0800 | [diff] [blame] | 1 | /* |
| 2 | libcamera: An implementation of the library required by Android OS 3.2 so |
| 3 | it can access V4L2 devices as cameras. |
| 4 | |
Chih-Wei Huang | d5590eb | 2019-02-26 17:48:45 +0800 | [diff] [blame] | 5 | (C) 2011 Eduardo José Tagle <ejtagle@tutopia.com> |
Chih-Wei Huang | 0d92eda | 2012-02-07 16:55:49 +0800 | [diff] [blame] | 6 | |
| 7 | Based on several packages: |
| 8 | - luvcview: Sdl video Usb Video Class grabber |
| 9 | (C) 2005,2006,2007 Laurent Pinchart && Michel Xhaard |
| 10 | |
| 11 | - spcaview |
| 12 | (C) 2003,2004,2005,2006 Michel Xhaard |
| 13 | |
| 14 | - JPEG decoder from http://www.bootsplash.org/ |
| 15 | (C) August 2001 by Michael Schroeder, <mls@suse.de> |
| 16 | |
| 17 | - libcamera V4L for Android 2.2 |
| 18 | (C) 2009 0xlab.org - http://0xlab.org/ |
| 19 | (C) 2010 SpectraCore Technologies |
| 20 | Author: Venkat Raju <codredruids@spectracoretech.com> |
| 21 | Based on a code from http://code.google.com/p/android-m912/downloads/detail?name=v4l2_camera_v2.patch |
| 22 | |
| 23 | - guvcview: http://guvcview.berlios.de |
| 24 | Paulo Assis <pj.assis@gmail.com> |
| 25 | Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
| 26 | |
| 27 | This program is free software: you can redistribute it and/or modify |
| 28 | it under the terms of the GNU General Public License as published by |
| 29 | the Free Software Foundation, either version 3 of the License, or |
| 30 | (at your option) any later version. |
| 31 | |
| 32 | This program is distributed in the hope that it will be useful, |
| 33 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 35 | GNU General Public License for more details. |
| 36 | |
| 37 | You should have received a copy of the GNU General Public License |
| 38 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 39 | |
| 40 | */ |
| 41 | |
| 42 | |
| 43 | #include "SurfaceSize.h" |
| 44 | |
| 45 | namespace android { |
| 46 | |
| 47 | int SurfaceSize::compare(const SurfaceSize& other) const |
| 48 | { |
| 49 | /* If bigger in both directions, it is the biggest */ |
| 50 | if (width > other.width && height > other.height) |
| 51 | return 1; |
| 52 | |
| 53 | /* If smaller in both directions, it is the smaller */ |
| 54 | if (width < other.width && height < other.height) |
| 55 | return -1; |
| 56 | |
| 57 | /* In the other cases, we sort by surface */ |
| 58 | return getArea() - other.getArea(); |
| 59 | } |
| 60 | |
| 61 | }; |