Release - PictureIt - Kodi Visualization

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
wsnipex Offline
Team-Kodi
Posts: 6,258
Joined: Jun 2011
Reputation: 161
Post: #16
Our addon build system already supports creating addon zips:

cmake -DPACKAGE_ZIP=ON -DCMAKE_INSTALL_PREFIX=/tmp
make addon-package
find quote
Tadly Offline
Team-Kodi Member
Posts: 280
Joined: Mar 2012
Reputation: 9
Post: #17
(2015-11-14 11:13)wsnipex Wrote:  Our addon build system already supports creating addon zips:

cmake -DPACKAGE_ZIP=ON -DCMAKE_INSTALL_PREFIX=/tmp
make addon-package

Oh.. didn't know that Big Grin
Thanks for letting me know Smile
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #18
Doesnt work on OpenELEC unfortunatley

[Image: Image1.jpg]

[Image: screenshot017.png]

I saw something on Github recently about SOIL, is there any other way to get this working on OpenELEC?
(This post was last modified: 2015-11-20 00:39 by zag.)
find quote
wisler Offline
Team-Kodi Member
Posts: 513
Joined: Jan 2014
Reputation: 12
Location: Germany
Post: #19
@Zag, yeah there is a way. Maybe switching to another image library would help to make this more platform independent.
Btw. as far as I know there is no apt-get in OpenELEC. Remember this is a very minimalistic Linux system. ;-)

@tadly
In my company we use this: https://github.com/nothings/stb maybe you can look deeper into it. With that we can embed the image file parsers directly into your binary addon.

Latest news about AudioDSP and my libraries are available on Twitter.

Developers can follow me on Github.
(This post was last modified: 2015-11-20 11:19 by zag.)
find quote
Tadly Offline
Team-Kodi Member
Posts: 280
Joined: Mar 2012
Reputation: 9
Post: #20
(2015-11-20 00:31)zag Wrote:  Doesnt work on OpenELEC unfortunatley

I saw something on Github recently about SOIL, is there any other way to get this working on OpenELEC?
No idea yet :/
OpenELEC is giving me a hard time with another (python based) addon as well *sigh*
As wisler said, it's a super minimalistic dist which is fine as it does just what it's supposed to do.
On the other hand it's giving me a hard time Big Grin
(Oh how I love my archlinux based HTPC.. I love you so much Big Grin)

(2015-11-20 08:35)wisler Wrote:  @tadly
In my company we use this: https://github.com/nothings/stb, maybe you can look deeper into it. With that we can embed the image file parsers directly into your binary addon.
Uh, stb_image sound really interesting.
AND v2.0 even supports Progressiv JPEG's (awesome)

And all that's needed is the header file? For real? Sound way to awesome to be true Big Grin

I will most certainly have a deeper look into that, thanks Smile

Not sure when I'll get to it though as I'm bouncing back and forth between a few projects right now :/
find quote
TheNinja Offline
Junior Member
Posts: 3
Joined: Nov 2015
Reputation: 0
Post: #21
Thanks, I got a working bin file now.
(I had to change the 6th line though, I tried it before there were the other comments on your code: cmake -DCMAKE_PREFIX_PATH=/usr/lib/kodi -DOVERRIDE_PATHS=1 ../)

Two feature requests Wink
- Images are stretched to fit, which doesn't look good when using normal photos that don't have the right aspect ratio. Keep the ratio and show black stripes would be good.
- For a image slideshow, an interval < 1 minute would be good.
find quote
Tadly Offline
Team-Kodi Member
Posts: 280
Joined: Mar 2012
Reputation: 9
Post: #22
(2015-11-20 10:44)TheNinja Wrote:  Thanks, I got a working bin file now.
(I had to change the 6th line though, I tried it before there were the other comments on your code: cmake -DCMAKE_PREFIX_PATH=/usr/lib/kodi -DOVERRIDE_PATHS=1 ../)

Two feature requests Wink
- Images are stretched to fit, which doesn't look good when using normal photos that don't have the right aspect ratio. Keep the ratio and show black stripes would be good.
- For a image slideshow, an interval < 1 minute would be good.

Good to hear Smile

Yeah stretching is an issue I'm aware of. Not sure how I can get the aspect ratio of an image though. But I'll look into that Wink

I never expected that people want a update interval < 1 min. but it looks like I've been super wrong Big Grin
I will update that Wink
find quote
wisler Offline
Team-Kodi Member
Posts: 513
Joined: Jan 2014
Reputation: 12
Location: Germany
Post: #23
(2015-11-20 10:37)Tadly Wrote:  And all that's needed is the header file? For real? Sound way to awesome to be true Big Grin

Yeah the project is really nice. But I don't know how fast the parsers are.

No hurry, if you find the time it's great Blush

(2015-11-20 11:20)Tadly Wrote:  I never expected that people want a update interval < 1 min.

Just an idea you could provide a user interface (sorry currently I can't look if it is already there) for configuration and it is possible to define update intervals 0,1 ... mm sec.

Latest news about AudioDSP and my libraries are available on Twitter.

Developers can follow me on Github.
find quote
Tadly Offline
Team-Kodi Member
Posts: 280
Joined: Mar 2012
Reputation: 9
Post: #24
(2015-11-20 13:33)wisler Wrote:  Yeah the project is really nice. But I don't know how fast the parsers are.

No hurry, if you find the time it's great Blush

Did a quick-and-dirty test and it looks really really promising Smile

(2015-11-20 13:33)wisler Wrote:  Just an idea you could provide a user interface (sorry currently I can't look if it is already there) for configuration and it is possible to define update intervals 0,1 ... mm sec.

I already have it configurable within the visualizations settings. But the minimum is 1 min. atm
It's not that big of a deal to change...
...I just never imagined anyone wanting to use a value lower than that ^^
(This post was last modified: 2015-11-20 15:32 by Tadly.)
find quote
wsnipex Offline
Team-Kodi
Posts: 6,258
Joined: Jun 2011
Reputation: 161
Post: #25
Openelec has a completely different build system. You'll have to add the addon there first and rebuild the whole thing.
find quote
Tadly Offline
Team-Kodi Member
Posts: 280
Joined: Mar 2012
Reputation: 9
Post: #26
Could someone, who knows about kodis build-system help me out real quick?

I'm rewriting most of the visualization (making it more modular) and the core of the visualization will
be a project on it's own (a static library to be exact) but I'm unable to link it properly using the build_addon macro
(With a glut-based project it works just fine)

PictureIt CMakeLists.txt (builds fine on it's own)
Code:
project(PictureIt)

cmake_minimum_required(VERSION 2.6)

find_package(OpenGL)
if(OPENGL_FOUND)
    list(APPEND INCLUDES ${OpenGL_INCLUDE_DIRS})
    list(APPEND DEPLIBS ${OPENGL_LIBRARIES})
    add_definitions(${OpenGL_DEFINITIONS})
else(OPENGL_FOUND)
    message(FATAL_ERROR "No rendering API found. Bailing")
endif(OPENGL_FOUND)

include_directories(${INCLUDES})

set(PICTUREIT_SOURCES pictureit.cpp
                      background.cpp
                      effects.cpp
                      spectrum.cpp)

if(NOT WIN32)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif(NOT WIN32)

add_library(PictureIt STATIC ${PICTUREIT_SOURCES})

set_property(TARGET PictureIt PROPERTY CXX_STANDARD 11)

visualization.pictureit CMakeLists.txt
It builds as well but says:
You have called ADD_LIBRARY for library visualization.pictureit without any source files. This typically indicates a problem with your CMakeLists.txt file
and for the life of me I don't see what I'm doing wrong :/
(I'm still super new to cmake so sorry if it's super obvious)
Code:
project(visualization.pictureit)

cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

find_package(kodi REQUIRED)

find_package(OpenGL)
if(OPENGL_FOUND)
    list(APPEND INCLUDES ${OpenGL_INCLUDE_DIR})
    list(APPEND DEPLIBS  ${OPENGL_LIBRARIES})
    add_definitions(${OpenGL_DEFINITIONS})
else()
    message(FATAL_ERROR "No rendering API found. Bailing")
endif()

include_directories(${INCLUDES}
                    ${KODI_INCLUDE_DIR}
                    ${PROJECT_SOURCE_DIR}/lib/pictureit
                    ${CMAKE_INCLUDE_PATH})

add_subdirectory(lib/pictureit)

set(VIS_SOURCES src/pictureit_addon.cpp)

list(APPEND DEPLIBS PictureIt)

if(APPLE)
    set(DEPLIBS ${DEPLIBS} "-framework CoreVideo")
endif(APPLE)

build_addon(visualization.pictureit PICTUREIT DEPLIBS)

include(CPack)
(This post was last modified: 2015-11-23 16:00 by Tadly.)
find quote
ironic_monkey Offline
Posting Freak
Posts: 1,322
Joined: Nov 2013
Reputation: 63
Post: #27
i understand this can be a bit confusing.

if you look at what the build_addon() macro does, the second argument is a prefix to certain variables, the most important being the sources it should build. it will expect to find these sources in the PICTUREIT_SOURCES variable,
while you build a 'VIS_SOURCES' variable.
find quote
Tadly Offline
Team-Kodi Member
Posts: 280
Joined: Mar 2012
Reputation: 9
Post: #28
(2015-11-23 16:31)ironic_monkey Wrote:  i understand this can be a bit confusing.

if you look at what the build_addon() macro does, the second argument is a prefix to certain variables, the most important being the sources it should build. it will expect to find these sources in the PICTUREIT_SOURCES variable,
while you build a 'VIS_SOURCES' variable.

Oh god.. I feel so stupid right now Big Grin
Thanks a lot Smile

Build fails now with:
Code:
/usr/bin/ld: lib/pictureit/libPictureIt.a(pictureit.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
lib/pictureit/libPictureIt.a: error adding symbols: Bad value
Let's hope google can tell me more about it ^^
find quote
ironic_monkey Offline
Posting Freak
Posts: 1,322
Joined: Nov 2013
Reputation: 63
Post: #29
you need to build your static library with position independent code (-fPIC) since you are linking into a shared object.

add

set(CMAKE_USE_POSITION_INDEPENDENT_CODE 1)

before you add the libpictureit target.
find quote
wsnipex Offline
Team-Kodi
Posts: 6,258
Joined: Jun 2011
Reputation: 161
Post: #30
your library was built without -fPIC.

edit: heh, too slow
(This post was last modified: 2015-11-23 16:54 by wsnipex.)
find quote