@ -16,7 +16,7 @@ struct args {
const char * record_filename ;
enum recorder_format record_format ;
SDL_bool fullscreen ;
SDL_bool no_ window ;
SDL_bool no_ display ;
SDL_bool help ;
SDL_bool version ;
SDL_bool show_touches ;
@ -58,8 +58,9 @@ static void usage(const char *arg0) {
" is preserved. \n "
" Default is %d%s. \n "
" \n "
" -n, --no-window \n "
" Do not show window (only when screen recording is enabled). \n "
" -N, --no-display \n "
" Do not display device (only when screen recording is \n "
" enabled). \n "
" \n "
" -p, --port port \n "
" Set the TCP port the client listens on. \n "
@ -276,7 +277,7 @@ parse_args(struct args *args, int argc, char *argv[]) {
{ " fullscreen " , no_argument , NULL , ' f ' } ,
{ " help " , no_argument , NULL , ' h ' } ,
{ " max-size " , required_argument , NULL , ' m ' } ,
{ " no- window" , no_argument , NULL , ' n ' } ,
{ " no- display" , no_argument , NULL , ' N ' } ,
{ " port " , required_argument , NULL , ' p ' } ,
{ " record " , required_argument , NULL , ' r ' } ,
{ " record-format " , required_argument , NULL , ' f ' } ,
@ -286,7 +287,7 @@ parse_args(struct args *args, int argc, char *argv[]) {
{ NULL , 0 , NULL , 0 } ,
} ;
int c ;
while ( ( c = getopt_long ( argc , argv , " b:c:fF:hm: n p:r:s:tTv" , long_options ,
while ( ( c = getopt_long ( argc , argv , " b:c:fF:hm: N p:r:s:tTv" , long_options ,
NULL ) ) ! = - 1 ) {
switch ( c ) {
case ' b ' :
@ -313,8 +314,8 @@ parse_args(struct args *args, int argc, char *argv[]) {
return SDL_FALSE ;
}
break ;
case ' n ' :
args - > no_ window = SDL_TRUE ;
case ' N ' :
args - > no_ display = SDL_TRUE ;
break ;
case ' p ' :
if ( ! parse_port ( optarg , & args - > port ) ) {
@ -342,13 +343,13 @@ parse_args(struct args *args, int argc, char *argv[]) {
}
}
if ( args - > no_ window & & ! args - > record_filename ) {
LOGE ( " - n/--no-window requires screen recording (-r/--record)" ) ;
if ( args - > no_ display & & ! args - > record_filename ) {
LOGE ( " - N/--no-display requires screen recording (-r/--record)" ) ;
return SDL_FALSE ;
}
if ( args - > no_ window & & args - > fullscreen ) {
LOGE ( " -f/--fullscreen-window is incompatible with - n/--no-window " ) ;
if ( args - > no_ display & & args - > fullscreen ) {
LOGE ( " -f/--fullscreen-window is incompatible with - N/--no-display " ) ;
return SDL_FALSE ;
}
@ -395,7 +396,7 @@ main(int argc, char *argv[]) {
. max_size = DEFAULT_MAX_SIZE ,
. bit_rate = DEFAULT_BIT_RATE ,
. always_on_top = SDL_FALSE ,
. no_ window = SDL_FALSE ,
. no_ display = SDL_FALSE ,
} ;
if ( ! parse_args ( & args , argc , argv ) ) {
return 1 ;
@ -434,7 +435,7 @@ main(int argc, char *argv[]) {
. show_touches = args . show_touches ,
. fullscreen = args . fullscreen ,
. always_on_top = args . always_on_top ,
. no_ window = args . no_window ,
. no_ display = args . no_display ,
} ;
int res = scrcpy ( & options ) ? 0 : 1 ;