diff options
author | Solomon Tan <solomonbstoner@yahoo.com.au> | 2021-08-24 21:11:25 +0800 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-09-02 09:24:22 -0400 |
commit | 5ff50fe1f7c46abab8e5dc26039419dc0cf5f526 (patch) | |
tree | 167f6a3e230be43c8da87e65e734fae78a92c33b | |
parent | ed4cc57c043741d43dfa071770bdf3b78821ba54 (diff) |
gr-video-sdl: Remove d_format
Remove d_format because the yaml sets it to 0, and is not checked at all
after initialization.
Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
-rw-r--r-- | gr-video-sdl/grc/video_sdl_sink.block.yml | 4 | ||||
-rw-r--r-- | gr-video-sdl/include/gnuradio/video_sdl/sink_s.h | 8 | ||||
-rw-r--r-- | gr-video-sdl/include/gnuradio/video_sdl/sink_uc.h | 8 | ||||
-rw-r--r-- | gr-video-sdl/lib/sink_s_impl.cc | 21 | ||||
-rw-r--r-- | gr-video-sdl/lib/sink_s_impl.h | 8 | ||||
-rw-r--r-- | gr-video-sdl/lib/sink_uc_impl.cc | 22 | ||||
-rw-r--r-- | gr-video-sdl/lib/sink_uc_impl.h | 8 | ||||
-rw-r--r-- | gr-video-sdl/python/video_sdl/bindings/sink_s_python.cc | 3 | ||||
-rw-r--r-- | gr-video-sdl/python/video_sdl/bindings/sink_uc_python.cc | 3 |
9 files changed, 20 insertions, 65 deletions
diff --git a/gr-video-sdl/grc/video_sdl_sink.block.yml b/gr-video-sdl/grc/video_sdl_sink.block.yml index ea929a343e..3ef830450c 100644 --- a/gr-video-sdl/grc/video_sdl_sink.block.yml +++ b/gr-video-sdl/grc/video_sdl_sink.block.yml @@ -45,13 +45,13 @@ inputs: templates: imports: from gnuradio import video_sdl - make: video_sdl.sink_${type.fcn}(${fps}, ${width}, ${height}, 0, ${display_width}, + make: video_sdl.sink_${type.fcn}(${fps}, ${width}, ${height}, ${display_width}, ${display_height}) cpp_templates: includes: [ '#include <gnuradio/video_sdl/sink_${type.fcn}.h>' ] declarations: 'video_sdl::sink_${type.fcn}::sptr ${id};' - make: 'this->${id} = video_sdl::sink_${type.fcn}::make(${fps}, ${width}, ${height}, 0, ${display_width}, + make: 'this->${id} = video_sdl::sink_${type.fcn}::make(${fps}, ${width}, ${height}, ${display_width}, ${display_height});' link: ['gnuradio::gnuradio-video_sdl'] diff --git a/gr-video-sdl/include/gnuradio/video_sdl/sink_s.h b/gr-video-sdl/include/gnuradio/video_sdl/sink_s.h index 51bfd188de..d2c31cc95d 100644 --- a/gr-video-sdl/include/gnuradio/video_sdl/sink_s.h +++ b/gr-video-sdl/include/gnuradio/video_sdl/sink_s.h @@ -32,12 +32,8 @@ public: // gr::video_sdl::sink_s::sptr typedef std::shared_ptr<sink_s> sptr; - static sptr make(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height); + static sptr + make(double framerate, int width, int height, int dst_width, int dst_height); }; } /* namespace video_sdl */ diff --git a/gr-video-sdl/include/gnuradio/video_sdl/sink_uc.h b/gr-video-sdl/include/gnuradio/video_sdl/sink_uc.h index dae931b19a..3f4e253068 100644 --- a/gr-video-sdl/include/gnuradio/video_sdl/sink_uc.h +++ b/gr-video-sdl/include/gnuradio/video_sdl/sink_uc.h @@ -32,12 +32,8 @@ public: // gr::video_sdl::sink_uc::sptr typedef std::shared_ptr<sink_uc> sptr; - static sptr make(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height); + static sptr + make(double framerate, int width, int height, int dst_width, int dst_height); }; } /* namespace video_sdl */ diff --git a/gr-video-sdl/lib/sink_s_impl.cc b/gr-video-sdl/lib/sink_s_impl.cc index 56d51ffbca..df8d9a8c0f 100644 --- a/gr-video-sdl/lib/sink_s_impl.cc +++ b/gr-video-sdl/lib/sink_s_impl.cc @@ -27,23 +27,15 @@ namespace gr { namespace video_sdl { -sink_s::sptr sink_s::make(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height) +sink_s::sptr +sink_s::make(double framerate, int width, int height, int dst_width, int dst_height) { return gnuradio::make_block_sptr<sink_s_impl>( - framerate, width, height, format, dst_width, dst_height); + framerate, width, height, dst_width, dst_height); } -sink_s_impl::sink_s_impl(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height) +sink_s_impl::sink_s_impl( + double framerate, int width, int height, int dst_width, int dst_height) : sync_block("video_sdl_sink_s", io_signature::make(1, 3, sizeof(short)), io_signature::make(0, 0, 0)), @@ -54,7 +46,6 @@ sink_s_impl::sink_s_impl(double framerate, d_height(height), d_dst_width(dst_width), d_dst_height(dst_height), - d_format(format), d_current_line(0), d_screen(NULL), d_image(NULL), @@ -70,8 +61,6 @@ sink_s_impl::sink_s_impl(double framerate, 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) { diff --git a/gr-video-sdl/lib/sink_s_impl.h b/gr-video-sdl/lib/sink_s_impl.h index a8803a3cb4..1dd48bc588 100644 --- a/gr-video-sdl/lib/sink_s_impl.h +++ b/gr-video-sdl/lib/sink_s_impl.h @@ -51,7 +51,6 @@ protected: int d_height; int d_dst_width; int d_dst_height; - int d_format; int d_current_line; SDL_Surface* d_screen; SDL_Overlay* d_image; @@ -60,12 +59,7 @@ protected: unsigned int d_wanted_ticks; public: - sink_s_impl(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height); + sink_s_impl(double framerate, int width, int height, int dst_width, int dst_height); ~sink_s_impl() override; int work(int noutput_items, diff --git a/gr-video-sdl/lib/sink_uc_impl.cc b/gr-video-sdl/lib/sink_uc_impl.cc index b34e51fbba..85b9314cdb 100644 --- a/gr-video-sdl/lib/sink_uc_impl.cc +++ b/gr-video-sdl/lib/sink_uc_impl.cc @@ -26,23 +26,15 @@ namespace gr { namespace video_sdl { -sink_uc::sptr sink_uc::make(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height) +sink_uc::sptr +sink_uc::make(double framerate, int width, int height, int dst_width, int dst_height) { return gnuradio::make_block_sptr<sink_uc_impl>( - framerate, width, height, format, dst_width, dst_height); + framerate, width, height, dst_width, dst_height); } -sink_uc_impl::sink_uc_impl(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height) +sink_uc_impl::sink_uc_impl( + double framerate, int width, int height, int dst_width, int dst_height) : sync_block("video_sdl_sink_uc", io_signature::make(1, 3, sizeof(unsigned char)), io_signature::make(0, 0, 0)), @@ -53,7 +45,6 @@ sink_uc_impl::sink_uc_impl(double framerate, d_height(height), d_dst_width(dst_width), d_dst_height(dst_height), - d_format(format), d_current_line(0), d_screen(NULL), d_image(NULL), @@ -71,9 +62,6 @@ sink_uc_impl::sink_uc_impl(double framerate, 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::ostringstream msg; diff --git a/gr-video-sdl/lib/sink_uc_impl.h b/gr-video-sdl/lib/sink_uc_impl.h index 0e08327f4c..fad668abb7 100644 --- a/gr-video-sdl/lib/sink_uc_impl.h +++ b/gr-video-sdl/lib/sink_uc_impl.h @@ -52,7 +52,6 @@ protected: int d_height; int d_dst_width; int d_dst_height; - int d_format; int d_current_line; SDL_Surface* d_screen; SDL_Overlay* d_image; @@ -61,12 +60,7 @@ protected: unsigned int d_wanted_ticks; public: - sink_uc_impl(double framerate, - int width, - int height, - unsigned int format, - int dst_width, - int dst_height); + sink_uc_impl(double framerate, int width, int height, int dst_width, int dst_height); ~sink_uc_impl() override; int work(int noutput_items, diff --git a/gr-video-sdl/python/video_sdl/bindings/sink_s_python.cc b/gr-video-sdl/python/video_sdl/bindings/sink_s_python.cc index cc9bd4d35e..35db6b3756 100644 --- a/gr-video-sdl/python/video_sdl/bindings/sink_s_python.cc +++ b/gr-video-sdl/python/video_sdl/bindings/sink_s_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(sink_s.h) */ -/* BINDTOOL_HEADER_FILE_HASH(d03e405a0f05388481c19349dbc08a51) */ +/* BINDTOOL_HEADER_FILE_HASH(3ef77f729107b45d1569b3f23213e07f) */ /***********************************************************************************/ #include <pybind11/complex.h> @@ -43,7 +43,6 @@ void bind_sink_s(py::module& m) py::arg("framerate"), py::arg("width"), py::arg("height"), - py::arg("format"), py::arg("dst_width"), py::arg("dst_height"), D(sink_s, make)) diff --git a/gr-video-sdl/python/video_sdl/bindings/sink_uc_python.cc b/gr-video-sdl/python/video_sdl/bindings/sink_uc_python.cc index 3106548b02..5fe0434a2d 100644 --- a/gr-video-sdl/python/video_sdl/bindings/sink_uc_python.cc +++ b/gr-video-sdl/python/video_sdl/bindings/sink_uc_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(sink_uc.h) */ -/* BINDTOOL_HEADER_FILE_HASH(49c2aee2770a14d64b019ea2a551e7c7) */ +/* BINDTOOL_HEADER_FILE_HASH(feb95c3f7af87f7f5bfc2d1b45835a1a) */ /***********************************************************************************/ #include <pybind11/complex.h> @@ -43,7 +43,6 @@ void bind_sink_uc(py::module& m) py::arg("framerate"), py::arg("width"), py::arg("height"), - py::arg("format"), py::arg("dst_width"), py::arg("dst_height"), D(sink_uc, make)) |