Release PictureIt - Kodi Visualization
#31
You guys really are quick on the draw...
again, thanks a lot. I really do appreciate it :)

But that doesn't seem to work.
Also, the error posted above says that it already tried rebuilding with -fPIC and still fails

Or am I missing something again?

Edit:
It's absolutely the same error by the way.. And saying that I just realized... This means I must have added that option at the wrong place :/
Reply
#32
it tells YOU to rebuild with -fPIC.

it's my bad. the variable is called CMAKE_POSITION_INDEPENDENT_CODE, i.e no USE
Reply
#33
and start with a fresh build folder, it won't apply the property to an already existing target if you rerun cmake iirc (nice little quirk).
Reply
#34
yay! more (different) errors!
But the linking should work now Smile

Thanks again Smile

Edit:
yeah, works now Smile
and I think I just found out why people say it's a bad idea to link static-libraries into shared-libraries ^^
Reply
#35
nah, thats fine, we do it all the time Tongue
cmake should really make pic default for static libs as well, it is already for shared ones.
Reply
#36
(2015-11-23, 17:45)wsnipex Wrote: nah, thats fine, we do it all the time Tongue
cmake should really make pic default for static libs as well, it is already for shared ones.

Really? Is it?
Well in that case I'll leave it as is Smile
Don't feel like messing with cmake atm anyway.. I just want to get things done in terms of writing code Big Grin
Reply
#37
Actually the reason for the is that amd64 requires pic code for shared objects. Since there is no issue with register starvation this makes sense and is the secure approach (first step to adress randomization). On x86 however register starvation is a real issue so pic is not mandated.

The typical usecase for static libraries is that they are linked into binaries and not shared objects. Cmake has chosen defaults accordingly.
Reply
#38
Awesome job on this Visualization.
Thanks so much for adding in the sliders, it makes a big difference.
*Transition time now is a value in milliseconds (instead of seconds)
◦Update interval now is a value in seconds (instead of minutes)
There was a suggestion on not expanding the images, that would be a nice check box option. Expand or use actual size.
Also, does the code look recursively though folders?
Does it randomize the images?
I have 3 folders and it appears to only be showing the images in the 1st folder even though I have the parent folder listed in the settings.
So far so good though. Great Visualization.
Thanks
Reply
#39
losbyers Wrote:There was a suggestion on not expanding the images, that would be a nice check box option. Expand or use actual size.
I'd like to add even more option. Still gotta figure out how to do it ^^
I'm currently in the process of rewriting the whole Visualization. So let's see what I end up with Wink

(2015-11-24, 22:21)losbyers Wrote: Also, does the code look recursively though folders?
It does, however it takes the subfolders of the folder you specified as Presets. So if you have a folder-structure like:

Wallpapers
|- Folder 1
| |- Subfolder 1
| |- image1
|- Folder 2
| |- Subfolder 1
| |- image1

you'll have 2 Presets, "Folder 1" and "Folder 2". (In kodi, while in fullscreen, press "p" on the keyboard to open the presets list)

(2015-11-24, 22:21)losbyers Wrote: Does it randomize the images?
Yes it does.
Also, every time the visualization initializes (which sadly happens even if you toggle fullscreen etc.) a random preset gets picked

I'll in the future make all the random stuff configurable in the settings but for now this will have to do ^^

(2015-11-24, 22:21)losbyers Wrote: So far so good though. Great Visualization.
Thanks
Glad you like it. Smile
A lot is planed for the future...
... I just don't have as much time as I'd like to spend on my private projects ^^
Reply
#40
Did a quick search for some "epic" 1080p wallpapers Smile

If I spend a bit more time, I can probably find some better ones with larger clear areas at the bottom for the equalizer.

Image

Download
Reply
#41
(2015-11-25, 12:08)zag Wrote: Did a quick search for some "epic" 1080p wallpapers Smile

If I spend a bit more time, I can probably find some better ones with larger clear areas at the bottom for the equalizer.

Image

Download

Uh.. awesome Smile
Want me to host it on my server and link it in the first post?
Or do you wanna keep it on your ondrive storage?

If you want me to host it and/or link it in the first post, is it okay to credit you for it?

Also, if you want me to host it and you happen to have new images somewhere in the future, let me know and I'll add them Smile
Reply
#42
Sure host it anywhere you wish.

It was just a 20min google search and a little GIMP editing to crop them

Cant wait to see how epic-clouds.jpg and dragon.jpg looks Smile
Reply
#43
(2015-11-25, 19:13)zag Wrote: Sure host it anywhere you wish.

It was just a 20min google search and a little GIMP editing to crop them

Cant wait to see how epic-clouds.jpg and dragon.jpg looks Smile

I'll add my README to the zip just in case of any copyright problems and such.

That's the link where all the collection go that I'm hosting Smile
http://kodi.linuxwhatelse.com/wallpapers/

Edit:
(2015-11-25, 19:13)zag Wrote: Cant wait to see how epic-clouds.jpg and dragon.jpg looks Smile
Quite hard to get exactly the image you'r looking for with all the randomness of the visualization Big Grin
Reply
#44
UPDATE
Aaaaaahm.. I just rewrote the namspaces (moved them into a utils-file) aaaaand now it builds and works ._.
So.. solved I guess?! Big Grin
Though I'm still curios to whether I'm using cmake wrong or if it's fine the way I did it.
Would be nice if you'd let me know Smile

Okay, I need help with cmake again *sigh* (I've wasted hours now and just can't get it to work the way I want)

PictureIt
Code:
PictureIt
├── CMakeLists.txt
├── depends
│   └── stb_image.h
├── include
│   └── pictureit
│       ├── effects
│       │   ├── crossfade.h
│       │   └── effects.h
│       ├── pictureit.h
│       └── spectrum.h
├── PictureItConfig.cmake.in
└── src
    ├── effects
    │   ├── crossfade.cpp
    │   └── effects.cpp
    ├── pictureit.cpp
    └── spectrum.cpp

CMakeLists.txt
Code:
cmake_minimum_required(VERSION 2.6)
project(PictureIt)

enable_language(CXX)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

# Find and include OpenGL
find_package(OpenGL REQUIRED)
if(OPENGL_FOUND)
    list(APPEND INCLUDES ${OpenGL_INCLUDE_DIRS})
    list(APPEND DEPLIBS ${OPENGL_LIBRARIES})
    add_definitions(${OpenGL_DEFINITIONS})
else(OPENGL_FOUND)
    message(FATAL_ERROR "OpenGL not found!")
endif(OPENGL_FOUND)


list(APPEND INCLUDES ${PROJECT_SOURCE_DIR}/include)
list(APPEND INCLUDES ${PROJECT_SOURCE_DIR}/depends)

include_directories(${INCLUDES})
include_directories(${CMAKE_INCLUDE_PATH})

# Add all sources
file(GLOB_RECURSE SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)

set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/depends")
configure_file(PictureItConfig.cmake.in "${PROJECT_BINARY_DIR}/PictureItConfig.cmake" @ONLY)

# Enable pic
set(CMAKE_POSITION_INDEPENDENT_CODE 1)

add_library(PictureIt STATIC ${SOURCES})

set_property(TARGET PictureIt PROPERTY CXX_STANDARD 11)

PictureItConfig.cmake.in
Code:
# - Config file for the FooBar package
# It defines the following variables
#  PICTUREIT_INCLUDE_DIRS - include directories for FooBar

# Compute paths
get_filename_component(PICTUREIT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(PICTUREIT_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")

This project builds just fine.
One important note:
effects defines a namespace PI_IMAGE which will be relevant later

Other Project using PictureIt (will be the kodi-addon as as soon as I get this thing to build)
Code:
Other Project
├── CMakeLists.txt
├── depends
│   └── PictureIt -> ../../PictureIt (I'm using a symlink because it makes development easier for now)
└── src
    └── main.cpp

CMakeLists.txt
Code:
cmake_minimum_required(VERSION 2.6)
project(glut-pictureit)

enable_language(CXX)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
list(APPEND CMAKE_PREFIX_PATH ${PROJECT_BINARY_DIR}/depends)

# Find and include GLUT
find_package(GLUT REQUIRED)
if(GLUT_FOUND)
    list(APPEND INCLUDES ${GLUT_INCLUDE_DIR})
    list(APPEND DEPLIBS ${GLUT_LIBRARIES})
    add_definitions(${GLUT_DEFINITIONS})
else(GLUT_FOUND)
    message(FATAL_ERROR "GLUT not found!")
endif(GLUT_FOUND)

# Find and include OpenGL
find_package(OpenGL REQUIRED)
if(OPENGL_FOUND)
    list(APPEND INCLUDES ${OpenGL_INCLUDE_DIRS})
    list(APPEND DEPLIBS ${OPENGL_LIBRARIES})
    add_definitions(${OpenGL_DEFINITIONS})
else(OPENGL_FOUND)
    message(FATAL_ERROR "OpenGL not found!")
endif(OPENGL_FOUND)

# Include PictureIt
add_subdirectory(${PROJECT_SOURCE_DIR}/depends/PictureIt)

list(APPEND DEPLIBS PictureIt)

find_package(PictureIt CONFIG REQUIRED)
if(PictureIt_FOUND)
    list(APPEND INCLUDES ${PICTUREIT_INCLUDE_DIRS})
else(PictureIt_FOUND)
    message(FATAL_ERROR "PictureIt not found!")
endif(PictureIt_FOUND)

include_directories(${INCLUDES})
include_directories(${PROJECT_SOURCE_DIR})

add_executable(glut-pictureit src/main.cpp)
target_link_libraries(glut-pictureit ${DEPLIBS})

set_property(TARGET glut-pictureit PROPERTY CXX_STANDARD 11)

Build-Log
Code:
Scanning dependencies of target PictureIt
[ 14%] Building CXX object depends/PictureIt/CMakeFiles/PictureIt.dir/src/pictureit.cpp.o
[ 28%] Building CXX object depends/PictureIt/CMakeFiles/PictureIt.dir/src/effects/effects.cpp.o
[ 42%] Building CXX object depends/PictureIt/CMakeFiles/PictureIt.dir/src/effects/crossfade.cpp.o
[ 57%] Building CXX object depends/PictureIt/CMakeFiles/PictureIt.dir/src/spectrum.cpp.o
[ 71%] Linking CXX static library libPictureIt.a
[ 71%] Built target PictureIt
Scanning dependencies of target glut-pictureit
[ 85%] Building CXX object CMakeFiles/glut-pictureit.dir/src/main.cpp.o
[100%] Linking CXX executable glut-pictureit
depends/PictureIt/libPictureIt.a(pictureit.cpp.o): In function `PictureIt::render()':
pictureit.cpp:(.text+0x2fd): undefined reference to `PI_IMAGE::load(char const*, unsigned int)'
pictureit.cpp:(.text+0x33c): undefined reference to `PI_IMAGE::draw(unsigned int, float, float, float)'
pictureit.cpp:(.text+0x402): undefined reference to `PI_IMAGE::draw(unsigned int, float, float, float)'
depends/PictureIt/libPictureIt.a(crossfade.cpp.o): In function `EFXCrossfade::render(unsigned int, unsigned int)':
crossfade.cpp:(.text+0x14a): undefined reference to `PI_IMAGE::draw(unsigned int, float, float, float)'
crossfade.cpp:(.text+0x23a): undefined reference to `PI_IMAGE::draw(unsigned int, float, float, float)'
collect2: error: ld returned 1 exit status
CMakeFiles/glut-pictureit.dir/build.make:100: recipe for target 'glut-pictureit' failed
make[2]: *** [glut-pictureit] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/glut-pictureit.dir/all' failed
make[1]: *** [CMakeFiles/glut-pictureit.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I have no idea what so every why that namespace isn't accessible.

I know that normally you'd install a lib to the system (including the headers) but I don't want that as the kodi visualisation addon has to work on its.
That's why I'm doing the "list(APPEND INCLUDES ${PICTUREIT_INCLUDE_DIRS})"

I really hope you guys can help me out again Smile
Reply
#45
the linker fails to find the pictureit library that provides the PI_IMAGE functions.
This is because your PictureItConfig.cmake does not set PICTUREIT_LIB_DIR.

On a more general note regarding PictureIt:
- You should put your headers in in the src dir, right besides the cpps
- the depends dir is not meant to put headers or libraries directly. Its intended use is to put definitions(usually an URL to a tarball or github repo) of libraries, your addon needs. Our kodi cmake addon buildsystem will then automatically download and build those dependencies. This won't be used on standalone building(=clone addon repo, cmake, make install) though. In that case you have to install all needed dependencies (system wide) manually.
Reply

Logout Mark Read Team Forum Stats Members Help
PictureIt - Kodi Visualization1