Android-ElectricSheep-Automator
view release on metacpan or search on metacpan
# Optionally specify %size = ('width' => ..., 'height' => ...)
size
optionally specify the size (geometry) of the recorded video as a
HASH_REF with keys width and height, in pixels. Default is "the
device's main display resolution".
bugreport
optionally set this flag to 1 to have Android overlay debug
information on the recorded video, e.g. timestamp.
# Optionally specify 'display-id'. =item display-id
for a device set up with multiple physical displays, optionally
specify which one to record -- if not the main display -- by
providing the display id. You can find display ids with
"list_physical_displays()" or, from the CLI, by adb shell dumpsys
SurfaceFlinger --display-id
\# Optionally specify %size = ('width' => ..., 'height' => ...)
- **`size`**
optionally specify the size (geometry) of the recorded video as a
HASH\_REF with keys `width` and `height`, in pixels. Default is "_the
device's main display resolution_".
- **`bugreport`**
optionally set this flag to 1 to have Android overlay debug information
on the recorded video, e.g. timestamp.
\# Optionally specify 'display-id'.
=item **`display-id`**
for a device set up with multiple physical displays, optionally
specify which one to record -- if not the main display -- by providing the
display id. You can find display ids with ["list\_physical\_displays()"](#list_physical_displays)
or, from the CLI, by `adb shell dumpsys SurfaceFlinger --display-id`
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
if( ! $img->read($filename) ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, failed to read local file '$filename' as PNG (call to ".'Image::PNG->read()'." has failed)."); return undef }
return $img;
}
# It takes a video recording of current screen on device and
# saves its to the specified file ($filename).
# Optionally specify 'time-limit' or a default of 10s is used.
# Optionally specify 'bit-rate'.
# Optionally specify %size = ('width' => ..., 'height' => ...)
# Optionally specify if $bugreport==1, then Android will overlay debug info on movie.
# Optionally specify 'display-id'.
# Output format of recording is MP4.
# It returns 1 on failure, 0 on success.
# it needs that connect_device() to have been called prior to this call
sub dump_current_screen_video {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# optional duration or default of 10 seconds. (Android default is 180 which is stupidly huge for us)
if( exists($params->{'time-limit'}) && defined($params->{'time-limit'}) ){
push @options, '--time-limit', $params->{'time-limit'}
} else { push @options, '--time-limit', '10' }
# optional bitrate (don't know what Android default is)
if( exists($params->{'bit-rate'}) && defined($params->{'bit-rate'}) ){
push @options, '--bit-rate', $params->{'bit-rate'}
}
# optional bugreport (Android overlays timestamp etc.)
if( exists($params->{'bugreport'}) && defined($params->{'bugreport'})
&& ($params->{'bugreport'} > 0)
){
push @options, '--bugreport'
}
# optional size
if( exists($params->{'size'}) && defined($params->{'size'}) ){
if( (ref($params->{'size'}) ne 'HASH')
|| (! exists $$params->{'size'}->{'width'})
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# Optionally specify %size = ('width' => ..., 'height' => ...)
=item B<C<size>>
optionally specify the size (geometry) of the recorded video as a
HASH_REF with keys C<width> and C<height>, in pixels. Default is "I<the
device's main display resolution>".
=item B<C<bugreport>>
optionally set this flag to 1 to have Android overlay debug information
on the recorded video, e.g. timestamp.
# Optionally specify 'display-id'.
=item B<C<display-id>>
for a device set up with multiple physical displays, optionally
specify which one to record -- if not the main display -- by providing the
display id. You can find display ids with L</list_physical_displays()>
or, from the CLI, by C<adb shell dumpsys SurfaceFlinger --display-id>
( run in 0.329 second using v1.01-cache-2.11-cpan-49f99fa48dc )