summaryrefslogtreecommitdiff
path: root/gr-video-sdl/src
diff options
context:
space:
mode:
Diffstat (limited to 'gr-video-sdl/src')
-rw-r--r--gr-video-sdl/src/CMakeLists.txt8
-rwxr-xr-xgr-video-sdl/src/qa_video_sdl.py12
-rw-r--r--gr-video-sdl/src/video_sdl.i8
-rw-r--r--gr-video-sdl/src/video_sdl_sink_s.cc28
-rw-r--r--gr-video-sdl/src/video_sdl_sink_s.h10
-rw-r--r--gr-video-sdl/src/video_sdl_sink_uc.cc34
-rw-r--r--gr-video-sdl/src/video_sdl_sink_uc.h10
7 files changed, 55 insertions, 55 deletions
diff --git a/gr-video-sdl/src/CMakeLists.txt b/gr-video-sdl/src/CMakeLists.txt
index 0c2069112..c21c9a9c8 100644
--- a/gr-video-sdl/src/CMakeLists.txt
+++ b/gr-video-sdl/src/CMakeLists.txt
@@ -1,17 +1,17 @@
# Copyright 2011-2012 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
diff --git a/gr-video-sdl/src/qa_video_sdl.py b/gr-video-sdl/src/qa_video_sdl.py
index 8f82a60b1..9008d1513 100755
--- a/gr-video-sdl/src/qa_video_sdl.py
+++ b/gr-video-sdl/src/qa_video_sdl.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2006,2010 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
from gnuradio import gr, gr_unittest
import video_sdl
@@ -35,6 +35,6 @@ class test_video_sdl (gr_unittest.TestCase):
"""Just see if we can import the module...
They may not have video drivers, etc. Don't try to run anything"""
pass
-
+
if __name__ == '__main__':
gr_unittest.run(test_video_sdl, "test_video_sdl.xml")
diff --git a/gr-video-sdl/src/video_sdl.i b/gr-video-sdl/src/video_sdl.i
index 3546adab0..c06ad6c2e 100644
--- a/gr-video-sdl/src/video_sdl.i
+++ b/gr-video-sdl/src/video_sdl.i
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006,2009 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
diff --git a/gr-video-sdl/src/video_sdl_sink_s.cc b/gr-video-sdl/src/video_sdl_sink_s.cc
index 2be3ff072..d9232043a 100644
--- a/gr-video-sdl/src/video_sdl_sink_s.cc
+++ b/gr-video-sdl/src/video_sdl_sink_s.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006,2010 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -50,21 +50,21 @@ video_sdl_sink_s::video_sdl_sink_s (double framerate,int width, int height,unsig
d_height (height),
d_dst_width(dst_width),
d_dst_height(dst_height),
- d_format(format),
+ d_format(format),
d_current_line(0),
d_screen(NULL),
d_image(NULL),
d_avg_delay(0.0),
d_wanted_ticks(0)
{
- if(framerate<=0.0)
+ if(framerate<=0.0)
d_wanted_frametime_ms=0;//Go as fast as possible
else
d_wanted_frametime_ms=(int)(1000.0/framerate);
if(dst_width<0) d_dst_width=d_width;
if(dst_height<0) d_dst_height=d_height;
if(0==format) d_format=IMGFMT_YV12;
-
+
atexit(SDL_Quit);//check if this is the way to do this
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
std::cerr << "video_sdl_sink_s: Couldn't initialize SDL:" << SDL_GetError() << " \n SDL_Init(SDL_INIT_VIDEO) failed\n";
@@ -104,9 +104,9 @@ video_sdl_sink_s::video_sdl_sink_s (double framerate,int width, int height,unsig
std::cerr << "SDL: Couldn't lock YUV overlay: \n"<< SDL_GetError() <<"\n";
throw std::runtime_error ("video_sdl_sink_s");
}
- memset(d_image->pixels[0], 128, d_image->pitches[0]*d_height);
- memset(d_image->pixels[1], 128, d_image->pitches[1]*d_height/2);
- memset(d_image->pixels[2], 128, d_image->pitches[2]*d_height/2);
+ memset(d_image->pixels[0], 128, d_image->pitches[0]*d_height);
+ memset(d_image->pixels[1], 128, d_image->pitches[1]*d_height/2);
+ memset(d_image->pixels[2], 128, d_image->pitches[2]*d_height/2);
SDL_UnlockYUVOverlay( d_image );
}
@@ -241,7 +241,7 @@ video_sdl_sink_s::work (int noutput_items,
if ( SDL_LockYUVOverlay( d_image ) ) {
return 0;
- }
+ }
switch (input_items.size ()){
case 3: // first channel=Y, second channel is U , third channel is V
src_pixels_0 = (short *) input_items[0];
@@ -253,7 +253,7 @@ video_sdl_sink_s::work (int noutput_items,
noutput_items_produced+=copy_plane_to_surface (0,d_chunk_size, src_pixels_0);
src_pixels_0 += d_chunk_size;
src_pixels_1 += d_chunk_size;
- src_pixels_2 += d_chunk_size;
+ src_pixels_2 += d_chunk_size;
}
break;
case 2:
@@ -266,7 +266,7 @@ video_sdl_sink_s::work (int noutput_items,
copy_plane_to_surface (12,d_chunk_size/2, src_pixels_1);
noutput_items_produced+=copy_plane_to_surface (0,d_chunk_size, src_pixels_0);
src_pixels_0 += d_chunk_size;
- src_pixels_1 += d_chunk_size;
+ src_pixels_1 += d_chunk_size;
}
} else
{
@@ -277,7 +277,7 @@ video_sdl_sink_s::work (int noutput_items,
copy_plane_to_surface (1222,d_chunk_size/2, src_pixels_1);
noutput_items_produced+=copy_plane_to_surface (0,d_chunk_size, src_pixels_0);
src_pixels_0 += d_chunk_size;
- src_pixels_1 += d_chunk_size;
+ src_pixels_1 += d_chunk_size;
}
}
break;
diff --git a/gr-video-sdl/src/video_sdl_sink_s.h b/gr-video-sdl/src/video_sdl_sink_s.h
index 2ec15e36d..64f5b5a6c 100644
--- a/gr-video-sdl/src/video_sdl_sink_s.h
+++ b/gr-video-sdl/src/video_sdl_sink_s.h
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -82,7 +82,7 @@ class VIDEO_SDL_API video_sdl_sink_s : public gr_sync_block {
public:
~video_sdl_sink_s ();
-
+
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
diff --git a/gr-video-sdl/src/video_sdl_sink_uc.cc b/gr-video-sdl/src/video_sdl_sink_uc.cc
index 58e4830e4..360df1109 100644
--- a/gr-video-sdl/src/video_sdl_sink_uc.cc
+++ b/gr-video-sdl/src/video_sdl_sink_uc.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006,2010 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -50,21 +50,21 @@ video_sdl_sink_uc::video_sdl_sink_uc (double framerate,int width, int height,uns
d_height (height),
d_dst_width(dst_width),
d_dst_height(dst_height),
- d_format(format),
+ d_format(format),
d_current_line(0),
d_screen(NULL),
d_image(NULL),
d_avg_delay(0.0),
d_wanted_ticks(0)
{
- if(framerate<=0.0)
+ if(framerate<=0.0)
d_wanted_frametime_ms=0;//Go as fast as possible
else
d_wanted_frametime_ms=(int)(1000.0/framerate);
if(dst_width<0) d_dst_width=d_width;
if(dst_height<0) d_dst_height=d_height;
if(0==format) d_format=IMGFMT_YV12;
-
+
atexit(SDL_Quit);//check if this is the way to do this
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
std::cerr << "video_sdl_sink_uc: Couldn't initialize SDL:" << SDL_GetError() << " \n SDL_Init(SDL_INIT_VIDEO) failed\n";
@@ -104,9 +104,9 @@ video_sdl_sink_uc::video_sdl_sink_uc (double framerate,int width, int height,uns
std::cerr << "SDL: Couldn't lock YUV overlay: \n"<< SDL_GetError() <<"\n";
throw std::runtime_error ("video_sdl_sink_uc");
}
- memset(d_image->pixels[0], 128, d_image->pitches[0]*d_height);
- memset(d_image->pixels[1], 128, d_image->pitches[1]*d_height/2);
- memset(d_image->pixels[2], 128, d_image->pitches[2]*d_height/2);
+ memset(d_image->pixels[0], 128, d_image->pitches[0]*d_height);
+ memset(d_image->pixels[1], 128, d_image->pitches[1]*d_height/2);
+ memset(d_image->pixels[2], 128, d_image->pitches[2]*d_height/2);
SDL_UnlockYUVOverlay( d_image );
}
@@ -135,15 +135,15 @@ video_sdl_sink_uc::copy_line_pixel_interleaved(unsigned char *dst_pixels_u,unsig
void
video_sdl_sink_uc::copy_line_line_interleaved(unsigned char *dst_pixels_u,unsigned char *dst_pixels_v,const unsigned char * src_pixels,int src_width)
{
- memcpy(dst_pixels_u, src_pixels, src_width);
- memcpy(dst_pixels_v, src_pixels+src_width, src_width);
+ memcpy(dst_pixels_u, src_pixels, src_width);
+ memcpy(dst_pixels_v, src_pixels+src_width, src_width);
return;
}
void
video_sdl_sink_uc::copy_line_single_plane(unsigned char *dst_pixels,const unsigned char * src_pixels,int src_width)
{
- memcpy(dst_pixels, src_pixels, src_width);
+ memcpy(dst_pixels, src_pixels, src_width);
return;
}
@@ -231,7 +231,7 @@ video_sdl_sink_uc::work (int noutput_items,
if ( SDL_LockYUVOverlay( d_image ) ) {
return 0;
- }
+ }
switch (input_items.size ()){
case 3: // first channel=Y, second channel is U , third channel is V
src_pixels_0 = (unsigned char *) input_items[0];
@@ -243,7 +243,7 @@ video_sdl_sink_uc::work (int noutput_items,
noutput_items_produced+=copy_plane_to_surface (0,d_chunk_size, src_pixels_0);
src_pixels_0 += d_chunk_size;
src_pixels_1 += d_chunk_size;
- src_pixels_2 += d_chunk_size;
+ src_pixels_2 += d_chunk_size;
}
break;
case 2:
@@ -256,7 +256,7 @@ video_sdl_sink_uc::work (int noutput_items,
copy_plane_to_surface (12,d_chunk_size/2, src_pixels_1);
noutput_items_produced+=copy_plane_to_surface (0,d_chunk_size, src_pixels_0);
src_pixels_0 += d_chunk_size;
- src_pixels_1 += d_chunk_size;
+ src_pixels_1 += d_chunk_size;
}
} else
{
@@ -267,7 +267,7 @@ video_sdl_sink_uc::work (int noutput_items,
copy_plane_to_surface (1222,d_chunk_size/2, src_pixels_1);
noutput_items_produced+=copy_plane_to_surface (0,d_chunk_size, src_pixels_0);
src_pixels_0 += d_chunk_size;
- src_pixels_1 += d_chunk_size;
+ src_pixels_1 += d_chunk_size;
}
}
break;
diff --git a/gr-video-sdl/src/video_sdl_sink_uc.h b/gr-video-sdl/src/video_sdl_sink_uc.h
index 435ddaa8f..6c071cf9d 100644
--- a/gr-video-sdl/src/video_sdl_sink_uc.h
+++ b/gr-video-sdl/src/video_sdl_sink_uc.h
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -82,7 +82,7 @@ class VIDEO_SDL_API video_sdl_sink_uc : public gr_sync_block {
public:
~video_sdl_sink_uc ();
-
+
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);