annotate libvo/aspecttest.c @ 36341:63f19afc5a6f

avidemux: try reading ODML index if the default one is uselessly small. Fixes Bugzilla #2150.
author reimar
date Sat, 31 Aug 2013 06:49:56 +0000
parents f1fffb77cd71
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
faecce6b4b99 Fix aspect test program linking.
diego
parents: 29263
diff changeset
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
dd86735178a6 Add missing #include, fixes the warning:
diego
parents: 6087
diff changeset
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
29743
faecce6b4b99 Fix aspect test program linking.
diego
parents: 29263
diff changeset
30 int vo_dheight;
faecce6b4b99 Fix aspect test program linking.
diego
parents: 29263
diff changeset
31 int vo_dwidth;
26583
6559b9364ca3 Add compilation rule for libvo/aspecttest and (hackishly) fix linking.
diego
parents: 25516
diff changeset
32 int vo_fs;
6559b9364ca3 Add compilation rule for libvo/aspecttest and (hackishly) fix linking.
diego
parents: 25516
diff changeset
33 float vo_panscan;
29743
faecce6b4b99 Fix aspect test program linking.
diego
parents: 29263
diff changeset
34 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
35
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
36 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
37 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
38 //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
39 switch(argc) {
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
40 case 10:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
41 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
42 case 9:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
43 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
44 case 7:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
45 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
46 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
47 case 5:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
48 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
49 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
50 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
51 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
52 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
53 break;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
54 default:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
55 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
56 "<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
57 argv[0]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
58 return 1;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
59 }
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
60 printf("monitor_aspect: %f\n",monitor_aspect);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
61 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
62 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
63 return 0;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
64 }