class_body
{ "{"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "SAMPLE_RATE"
= "="
decimal_integer_literal "48000"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CHANNEL_CONFIG"
= "="
field_access
identifier "AudioFormat"
. "."
identifier "CHANNEL_IN_STEREO"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "CHANNELS"
= "="
decimal_integer_literal "2"
; ";"
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "ENCODING"
= "="
field_access
identifier "AudioFormat"
. "."
identifier "ENCODING_PCM_16BIT"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "BYTES_PER_SAMPLE"
= "="
decimal_integer_literal "2"
; ";"
line_comment "// Never read more than 1024 samples, even if the buffer is "...
line_comment "// A lower value is useless, since the system captures audio"...
line_comment "// receive 4 successive blocks without waiting, then we wait"...
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "MAX_READ_SIZE"
= "="
binary_expression
binary_expression
decimal_integer_literal "1024"
* "*"
identifier "CHANNELS"
* "*"
identifier "BYTES_PER_SAMPLE"
; ";"
field_declaration (+24 nodes collapsed)
line_comment "// 1 sample in microseconds (used for fixing PTS)"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "audioSource"
; ";"
field_declaration
modifiers
private "private"
type_identifier "AudioRecord"
variable_declarator
identifier "recorder"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AudioTimestamp"
variable_declarator
identifier "timestamp"
= "="
object_creation_expression
new "new"
type_identifier "AudioTimestamp"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "previousRecorderTimestamp"
= "="
unary_expression
- "-"
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "previousPts"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "nextPts"
= "="
decimal_integer_literal "0"
; ";"
constructor_declaration (+28 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration
modifiers
private "private"
static "static"
void_type "void"
identifier "startWorkaroundAndroid11"
formal_parameters
( "("
) ")"
block
{ "{"
line_comment "// Android 11 requires Apps to be at foreground to record au"...
line_comment "// Normally, each App has its own user ID, so Android checks"...
line_comment "// But scrcpy server is NOT an App, it's a Java application "...
line_comment "// shell (\"com.android.shell\")."
line_comment "// If there is an Activity from Android shell running at for"...
line_comment "// foreground."
local_variable_declaration
type_identifier "Intent"
variable_declarator
identifier "intent"
= "="
object_creation_expression
new "new"
type_identifier "Intent"
argument_list
( "("
field_access
identifier "Intent"
. "."
identifier "ACTION_MAIN"
) ")"
; ";"
expression_statement
method_invocation
identifier "intent"
. "."
identifier "addFlags"
argument_list
( "("
field_access
identifier "Intent"
. "."
identifier "FLAG_ACTIVITY_NEW_TASK"
) ")"
; ";"
expression_statement
method_invocation
identifier "intent"
. "."
identifier "addCategory"
argument_list
( "("
field_access
identifier "Intent"
. "."
identifier "CATEGORY_LAUNCHER"
) ")"
; ";"
expression_statement (+24 nodes collapsed)
expression_statement
method_invocation
method_invocation
identifier "ServiceManager"
. "."
identifier "getActivityManager"
argument_list
( "("
) ")"
. "."
identifier "startActivityAsUserWithFeature"
argument_list
( "("
identifier "intent"
) ")"
; ";"
} "}"
method_declaration (+31 nodes collapsed)
method_declaration (+145 nodes collapsed)
method_declaration (+73 nodes collapsed)
method_declaration (+83 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+283 nodes collapsed)
} "}"