Device-WebIO-RaspberryPi

 view release on metacpan or  search on metacpan

lib/Device/WebIO/RaspberryPi.pm  view on Meta::CPAN

476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
    default => sub {[
       30
    ]},
);
has '_vid_bitrate' => (
    is      => 'rw',
    default => sub {[
       8000
    ]},
);
has '_vid_stream_callbacks' => (
    is      => 'rw',
    default => sub {[]},
);
has '_vid_stream_callback_types' => (
    is      => 'rw',
    default => sub {[]},
);
has 'cv' => (
    is      => 'rw',
    default => sub { AnyEvent->condvar },

lib/Device/WebIO/RaspberryPi.pm  view on Meta::CPAN

569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
    my ($self, $pin, $type) = @_;
    die "Do not support type '$type'" unless exists $ALLOWED_VIDEO_TYPES{$type};
    $self->_init_gstreamer;
    return 1;
}
 
sub vid_stream_callback
{
    my ($self, $pin, $type, $callback) = @_;
    die "Do not support type '$type'" unless exists $ALLOWED_VIDEO_TYPES{$type};
    $self->_vid_stream_callbacks->[$pin] = $callback;
    $self->_vid_stream_callback_types->[$pin] = $type;
    return 1;
}
 
sub vid_stream_begin_loop
{
    my ($self, $channel) = @_;
    my $width    = $self->vid_width( $channel );
    my $height   = $self->vid_height( $channel );
    my $fps      = $self->vid_fps( $channel );
    my $bitrate  = $self->vid_kbps( $channel );
    my $callback = $self->_vid_stream_callbacks->[$channel];
    my $type     = $self->_vid_stream_callback_types->[$channel];
    my $use_audio = $self->vid_use_audio;
    my $audio_dev = $self->vid_audio_input_device;
 
 
    $self->_init_gstreamer;
    my $cv = $self->cv;
    my $pipeline = GStreamer1::Pipeline->new( 'pipeline' );
 
    my $rpi        = GStreamer1::ElementFactory::make( rpicamsrc => 'and_who' );



( run in 0.225 second using v1.01-cache-2.11-cpan-05444aca049 )