Changeset 26517 in vbox for trunk/src/VBox/Frontends/VBoxHeadless
- Timestamp:
- Feb 14, 2010 9:39:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r26439 r26517 39 39 # include <VBox/vrdpapi.h> 40 40 #endif 41 #include <iprt/buildconfig.h> 41 42 #include <iprt/ctype.h> 42 43 #include <iprt/initterm.h> … … 681 682 { "--capture", 'c', 0 }, 682 683 { "--width", 'w', RTGETOPT_REQ_UINT32 }, 683 { "--height", 'h', RTGETOPT_REQ_UINT32 }, 684 { "--height", 'h', RTGETOPT_REQ_UINT32 }, /* great choice of short option! */ 684 685 { "--bitrate", 'r', RTGETOPT_REQ_UINT32 }, 685 686 { "--filename", 'f', RTGETOPT_REQ_STRING }, … … 746 747 ulFrameWidth = ValueUnion.u32; 747 748 break; 748 case 'h':749 ulFrameHeight = ValueUnion.u32;750 break;751 749 case 'r': 752 750 ulBitRate = ValueUnion.u32; … … 756 754 break; 757 755 #endif /* VBOX_FFMPEG defined */ 758 case VINF_GETOPT_NOT_OPTION: 759 RTPrintf("Invalid parameter '%s'\n\n", ValueUnion.psz); 756 case 'h': 757 #ifdef VBOX_FFMPEG 758 if ((GetState.pDef->fFlags & RTGETOPT_REQ_MASK) != RTGETOPT_REQ_NOTHING) 759 { 760 ulFrameHeight = ValueUnion.u32; 761 break; 762 } 763 #endif 760 764 show_usage(); 761 return -1;765 return 0; 762 766 case OPT_COMMENT: 763 767 /* nothing to do */ 764 768 break; 769 case 'V': 770 RTPrintf("%sr%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()); 771 return 0; 765 772 default: 766 if (ch > 0) 767 { 768 if (RT_C_IS_PRINT(ch)) 769 RTPrintf("Invalid option -%c\n\n", ch); 770 else 771 RTPrintf("Invalid option case %i\n\n", ch); 772 } 773 else if (ch == VERR_GETOPT_UNKNOWN_OPTION) 774 RTPrintf("Unknown option: %s\n\n", ValueUnion.psz); 775 else if (ValueUnion.pDef) 776 RTPrintf("%s: %Rrs\n\n", ValueUnion.pDef->pszLong, ch); 777 else 778 RTPrintf("Error: %Rrs\n\n", ch); 773 ch = RTGetOptPrintError(ch, &ValueUnion); 779 774 show_usage(); 780 return -1;775 return ch; 781 776 } 782 777 } … … 786 781 { 787 782 LogError("VBoxHeadless: ERROR: please specify an even frame width between 512 and 2048", 0); 788 return -1;783 return 1; 789 784 } 790 785 if (ulFrameHeight < 384 || ulFrameHeight > 1536 || ulFrameHeight % 2) 791 786 { 792 787 LogError("VBoxHeadless: ERROR: please specify an even frame height between 384 and 1536", 0); 793 return -1;788 return 1; 794 789 } 795 790 if (ulBitRate < 300000 || ulBitRate > 1000000) 796 791 { 797 792 LogError("VBoxHeadless: ERROR: please specify an even bitrate between 300000 and 1000000", 0); 798 return -1;793 return 1; 799 794 } 800 795 /* Make sure we only have %d or %u (or none) in the file name specified */ … … 803 798 { 804 799 LogError("VBoxHeadless: ERROR: Only %%d and %%u are allowed in the capture file name.", -1); 805 return -1;800 return 1; 806 801 } 807 802 /* And no more than one % in the name */ … … 809 804 { 810 805 LogError("VBoxHeadless: ERROR: Only one format modifier is allowed in the capture file name.", -1); 811 return -1;806 return 1; 812 807 } 813 808 RTStrPrintf(&pszMPEGFile[0], RTPATH_MAX, pszFileNameParam, RTProcSelf()); … … 817 812 { 818 813 show_usage(); 819 return -1;814 return 1; 820 815 } 821 816 … … 826 821 { 827 822 RTPrintf("VBoxHeadless: ERROR: failed to initialize COM!\n"); 828 return rc;823 return 1; 829 824 } 830 825 … … 1172 1167 LogFlow(("VBoxHeadless FINISHED.\n")); 1173 1168 1174 return rc;1169 return FAILED(rc) ? 1 : 0; 1175 1170 } 1176 1171
Note:
See TracChangeset
for help on using the changeset viewer.