summaryrefslogtreecommitdiff
path: root/gr-video-sdl
diff options
context:
space:
mode:
Diffstat (limited to 'gr-video-sdl')
-rw-r--r--gr-video-sdl/.gitignore32
-rw-r--r--gr-video-sdl/CMakeLists.txt8
-rw-r--r--gr-video-sdl/Makefile.am27
-rw-r--r--gr-video-sdl/src/.gitignore15
-rw-r--r--gr-video-sdl/src/CMakeLists.txt8
-rw-r--r--gr-video-sdl/src/Makefile.am88
-rw-r--r--gr-video-sdl/src/Makefile.swig.gen145
-rwxr-xr-xgr-video-sdl/src/qa_video_sdl.py12
-rw-r--r--gr-video-sdl/src/run_tests.in10
-rw-r--r--gr-video-sdl/src/video_sdl.i18
-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
14 files changed, 59 insertions, 386 deletions
diff --git a/gr-video-sdl/.gitignore b/gr-video-sdl/.gitignore
deleted file mode 100644
index 53edad32f..000000000
--- a/gr-video-sdl/.gitignore
+++ /dev/null
@@ -1,32 +0,0 @@
-/*.cache
-/*.la
-/*.lo
-/*.pc
-/.deps
-/.la
-/.libs
-/.lo
-/Makefile
-/Makefile.in
-/aclocal.m4
-/autom4te.cache
-/config.cache
-/config.h
-/config.h.in
-/config.log
-/config.status
-/configure
-/depcomp
-/install-sh
-/libtool
-/ltmain.sh
-/make.log
-/missing
-/missing
-/mkinstalldirs
-/py-compile
-/stamp-h
-/stamp-h.in
-/stamp-h1
-/stamp-h1.in
-/stamp-h2.in
diff --git a/gr-video-sdl/CMakeLists.txt b/gr-video-sdl/CMakeLists.txt
index 6b1d7f79e..57ffde894 100644
--- a/gr-video-sdl/CMakeLists.txt
+++ b/gr-video-sdl/CMakeLists.txt
@@ -1,17 +1,17 @@
# Copyright 2011 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/Makefile.am b/gr-video-sdl/Makefile.am
deleted file mode 100644
index 75efb3b60..000000000
--- a/gr-video-sdl/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# 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,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = src
-
-pkgconfigdir = $(libdir)/pkgconfig
-dist_pkgconfig_DATA = gnuradio-video-sdl.pc
diff --git a/gr-video-sdl/src/.gitignore b/gr-video-sdl/src/.gitignore
deleted file mode 100644
index f128bd77b..000000000
--- a/gr-video-sdl/src/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.pyc
-/video_sdl.cc
-/video_sdl.py
-/run_tests
-/gnuradio
-/guile
-/python
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/Makefile.am b/gr-video-sdl/src/Makefile.am
deleted file mode 100644
index 3a0d4f34b..000000000
--- a/gr-video-sdl/src/Makefile.am
+++ /dev/null
@@ -1,88 +0,0 @@
-#
-# Copyright 2004,2005,2006,2008,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,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-include $(top_srcdir)/Makefile.swig
-
-TESTS =
-EXTRA_DIST += run_tests.in
-DISTCLEANFILES += run_tests
-
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(SDL_CFLAGS) \
- $(WITH_INCLUDES)
-
-noinst_PYTHON = \
- qa_video_sdl.py
-
-grinclude_HEADERS = \
- video_sdl_api.h \
- video_sdl_sink_uc.h \
- video_sdl_sink_s.h
-
-lib_LTLIBRARIES = libgnuradio-video-sdl.la
-
-libgnuradio_video_sdl_la_SOURCES = \
- video_sdl_sink_uc.cc \
- video_sdl_sink_s.cc
-
-libgnuradio_video_sdl_la_LIBADD = \
- $(SDL_LIBS) \
- $(GNURADIO_CORE_LA)
-
-libgnuradio_video_sdl_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-
-#################################
-# SWIG interfaces and libraries
-
-TOP_SWIG_DOC_IFILES = \
- video_sdl_swig_doc.i
-
-TOP_SWIG_IFILES = \
- $(TOP_SWIG_DOC_IFILES) \
- video_sdl.i
-
-BUILT_SOURCES += \
- $(TOP_SWIG_DOC_IFILES)
-
-EXTRA_DIST += \
- $(TOP_SWIG_DOC_IFILES)
-
-$(TOP_SWIG_DOC_IFILES):
- `echo "" > $@`
-
-# Install so that they end up available as:
-# import gnuradio.video_sdl
-# This ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio
-video_sdl_pythondir_category = \
- gnuradio
-
-# additional libraries for linking with the SWIG-generated library
-video_sdl_la_swig_libadd = \
- libgnuradio-video-sdl.la
-
-video_sdl_swiginclude_headers = \
- $(TOP_SWIG_DOC_IFILES)
-
-if PYTHON
-TESTS += run_tests
-endif
diff --git a/gr-video-sdl/src/Makefile.swig.gen b/gr-video-sdl/src/Makefile.swig.gen
deleted file mode 100644
index ac66bc9a2..000000000
--- a/gr-video-sdl/src/Makefile.swig.gen
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- Makefile -*-
-#
-# Copyright 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,
-# Boston, MA 02110-1301, USA.
-#
-
-# Makefile.swig.gen for video_sdl.i
-
-## Default install locations for these files:
-##
-## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/video_sdl
-## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/video_sdl
-##
-## The following can be overloaded to change the install location, but
-## this has to be done in the including Makefile.am -before-
-## Makefile.swig is included.
-
-video_sdl_pythondir_category ?= gnuradio/video_sdl
-video_sdl_pylibdir_category ?= $(video_sdl_pythondir_category)
-video_sdl_pythondir = $(pythondir)/$(video_sdl_pythondir_category)
-video_sdl_pylibdir = $(pyexecdir)/$(video_sdl_pylibdir_category)
-
-# The .so libraries for the guile modules get installed whereever guile
-# is installed, usually /usr/lib/guile/gnuradio/
-# FIXME: determince whether these should be installed with gnuradio.
-video_sdl_scmlibdir = $(libdir)
-
-# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/video_sdl
-# FIXME: determince whether these should be installed with gnuradio.
-video_sdl_scmdir = $(guiledir)
-
-## SWIG headers are always installed into the same directory.
-
-video_sdl_swigincludedir = $(swigincludedir)
-
-## This is a template file for a "generated" Makefile addition (in
-## this case, "Makefile.swig.gen"). By including the top-level
-## Makefile.swig, this file will be used to generate the SWIG
-## dependencies. Assign the variable TOP_SWIG_FILES to be the list of
-## SWIG .i files to generated wrappings for; there can be more than 1
-## so long as the names are unique (no sorting is done on the
-## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
-## file will generate .cc, .py, and possibly .h files -- meaning that
-## all of these files will have the same base name (that provided for
-## the SWIG .i file).
-##
-## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
-## right thing. For more info, see <
-## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
-
-## Other cleaned files: dependency files generated by SWIG or this Makefile
-
-MOSTLYCLEANFILES += $(DEPDIR)/*.S*
-
-## Various SWIG variables. These can be overloaded in the including
-## Makefile.am by setting the variable value there, then including
-## Makefile.swig .
-
-video_sdl_swiginclude_HEADERS = \
- video_sdl.i \
- $(video_sdl_swiginclude_headers)
-
-if PYTHON
-video_sdl_pylib_LTLIBRARIES = \
- _video_sdl.la
-
-_video_sdl_la_SOURCES = \
- python/video_sdl.cc \
- $(video_sdl_la_swig_sources)
-
-video_sdl_python_PYTHON = \
- video_sdl.py \
- $(video_sdl_python)
-
-_video_sdl_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(video_sdl_la_swig_libadd)
-
-_video_sdl_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(video_sdl_la_swig_ldflags)
-
-_video_sdl_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(video_sdl_la_swig_cxxflags)
-
-python/video_sdl.cc: video_sdl.py
-video_sdl.py: video_sdl.i
-
-# Include the python dependencies for this file
--include python/video_sdl.d
-
-endif # end of if python
-
-if GUILE
-
-video_sdl_scmlib_LTLIBRARIES = \
- libguile-gnuradio-video_sdl.la
-libguile_gnuradio_video_sdl_la_SOURCES = \
- guile/video_sdl.cc \
- $(video_sdl_la_swig_sources)
-nobase_video_sdl_scm_DATA = \
- gnuradio/video_sdl.scm \
- gnuradio/video_sdl-primitive.scm
-libguile_gnuradio_video_sdl_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(video_sdl_la_swig_libadd)
-libguile_gnuradio_video_sdl_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(video_sdl_la_swig_ldflags)
-libguile_gnuradio_video_sdl_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(video_sdl_la_swig_cxxflags)
-
-guile/video_sdl.cc: gnuradio/video_sdl.scm
-gnuradio/video_sdl.scm: video_sdl.i
-gnuradio/video_sdl-primitive.scm: gnuradio/video_sdl.scm
-
-# Include the guile dependencies for this file
--include guile/video_sdl.d
-
-endif # end of GUILE
-
-
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/run_tests.in b/gr-video-sdl/src/run_tests.in
deleted file mode 100644
index a0b6ff7e1..000000000
--- a/gr-video-sdl/src/run_tests.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# 1st parameter is absolute path to component source directory
-# 2nd parameter is absolute path to component build directory
-# 3rd parameter is path to Python QA directory
-
-@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-video-sdl \
- @abs_top_builddir@/gr-video-sdl \
- @srcdir@
diff --git a/gr-video-sdl/src/video_sdl.i b/gr-video-sdl/src/video_sdl.i
index 010851d10..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,
@@ -63,13 +63,3 @@ class video_sdl_sink_s : public gr_sync_block {
public:
~video_sdl_sink_s ();
};
-
-#if SWIGGUILE
-%scheme %{
-(load-extension-global "libguile-gnuradio-video_sdl" "scm_init_gnuradio_video_sdl_module")
-%}
-
-%goops %{
-(use-modules (gnuradio gnuradio_core_runtime))
-%}
-#endif
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);