Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: zpmorgan/PDL-GStreamer
base: 01335271ce
...
head fork: zpmorgan/PDL-GStreamer
compare: bcb702b65e
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 13, 2012
@zpmorgan screenie to examples.
also, terminating gst-launch with DEMOLISH.
e6fb7e0
@zpmorgan killing & clearing gst_pid with pseudoseek bcb702b
View
0  screenshot_imag2d.pl → examples/screenshot_imag2d.pl
File renamed without changes
View
23 lib/PDL/GStreamer.pm
@@ -10,6 +10,12 @@ my $nine_zeros = '000000000';
my ($loop); #cruft below.
+has gst_pid => (
+ is => 'rw',
+ isa => 'Int',
+ clearer => 'clear_gst_pid',
+);
+
has playing => (
is => 'rw',
isa => 'Bool',
@@ -31,6 +37,10 @@ sub seek{
close $self->input_fd;
close $self->info_fd;
}
+ if ($self->gst_pid){
+ kill 15, $self->gst_pid;
+ $self->clear_gst_pid;
+ }
$self->start_time($time);
}
@@ -97,6 +107,13 @@ has [qw/scale_w scale_h/] => (
required => 0,
);
+sub DEMOLISH{
+ my $self = shift;
+ return unless $self->playing;
+ kill 15, $self->gst_pid;
+ close($self->info_fd);
+ close($self->input_fd);
+}
sub width{
@@ -150,14 +167,13 @@ sub play{
"|";
#die $gst_launch_cmd;
my $gst_launch_output; #info about pipelines,etc.
- open ($gst_launch_output, $gst_launch_cmd) or die $!;
+ my $gst_pid = open ($gst_launch_output, $gst_launch_cmd) or die $!;
$self->info_fd($gst_launch_output);
+ $self->gst_pid($gst_pid);
- warn;
{ #open input_fd
my $fd;
open($fd,'<',$self->input_fifo) or die $!;
- warn;
$self->input_fd($fd);
}
#open ($gst_pipe,'<',$self->input_fifo) or die $!;
@@ -180,7 +196,6 @@ sub get_frame{
#warn;
$self->play() unless $self->playing();
my $data;
- warn;
read($self->input_fd,$data,$self->frame_size_in_bytes);
my $img = pdl(unpack("C*",$data));
#$img = $img->float / 256;

No commit comments for this range

Something went wrong with that request. Please try again.