Mercurial > mplayer.hg
annotate libvo/aspecttest.c @ 30015:43f142b66ad7
divided a line in two, was too long
author | ptt |
---|---|
date | Fri, 18 Dec 2009 15:57:22 +0000 |
parents | faecce6b4b99 |
children | 32725ca88fed |
rev | line source |
---|---|
28446
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
1 /* |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
2 * test app for aspect.[ch] by Atmos |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
3 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
4 * This file is part of MPlayer. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
5 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
6 * MPlayer is free software; you can redistribute it and/or modify |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
9 * (at your option) any later version. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
10 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
11 * MPlayer is distributed in the hope that it will be useful, |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
14 * GNU General Public License for more details. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
15 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
16 * You should have received a copy of the GNU General Public License along |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
27506
diff
changeset
|
19 */ |
6087
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
20 |
29743 | 21 #include <stdint.h> |
6087
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
22 #include <stdio.h> |
25516 | 23 #include <stdlib.h> |
6087
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
24 |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
25 #include "aspect.h" |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
26 |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
27 /* default zoom state 0 off, 1 on */ |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
28 #define DEF_ZOOM 1 |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
29 |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
30 extern float monitor_aspect; |
29743 | 31 int vo_dheight; |
32 int vo_dwidth; | |
26583
6559b9364ca3
Add compilation rule for libvo/aspecttest and (hackishly) fix linking.
diego
parents:
25516
diff
changeset
|
33 int vo_fs; |
6559b9364ca3
Add compilation rule for libvo/aspecttest and (hackishly) fix linking.
diego
parents:
25516
diff
changeset
|
34 float vo_panscan; |
29743 | 35 int64_t WinID = -1; |
6087
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
36 |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
37 int main(int argc, char *argv[]) { |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
38 int w,h,z=DEF_ZOOM; |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
39 //printf("argc: %d\n",argc); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
40 switch(argc) { |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
41 case 10: |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
42 z = atoi(argv[9]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
43 case 9: |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
44 monitor_aspect = (float)atoi(argv[7])/(float)atoi(argv[8]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
45 case 7: |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
46 aspect_save_prescale(atoi(argv[5]),atoi(argv[6])); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
47 printf("prescale size: %sx%s\n",argv[5],argv[6]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
48 case 5: |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
49 aspect_save_screenres(atoi(argv[1]),atoi(argv[2])); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
50 printf("screenres: %sx%s\n",argv[1],argv[2]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
51 aspect_save_orig(atoi(argv[3]),atoi(argv[4])); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
52 printf("original size: %sx%s\n",argv[3],argv[4]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
53 w=atoi(argv[3]); h=atoi(argv[4]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
54 break; |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
55 default: |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
56 printf("USAGE: %s <screenw> <screenh> <origw> <origh>\n[<prescalew> " |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
57 "<prescaleh>] [<screenaspectw> <screenaspecth>] [<zoom 0/1>]\n", |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
58 argv[0]); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
59 return 1; |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
60 } |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
61 printf("monitor_aspect: %f\n",monitor_aspect); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
62 aspect(&w,&h,z); |
6087
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
63 printf("new size: %dx%d\n",w,h); |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
64 return 0; |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
65 } |
8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff
changeset
|
66 |