GoPro sdk with latest Adobe dng SDK

Hi,

Thanks very much for libraw and for the latest update!

I'm trying to build libRaw with Gopro raw support against the current Adobe DNG sdk, as explained in README.GoPro.txt, but I can't get it to build. I'm using https://download.adobe.com/pub/adobe/dng/dng_sdk_1_5.zip

I've applied the patches you mentioned. Compilation of gpr_sdk fails with:

gpr/src/source/lib/gpr_sdk/private/gpr.cpp:583:47: error: no member named
'GetGPMFPayload' in 'dng_host'
dng_memory_block* gpmf_payload = host.GetGPMFPayload().Get();

Indeed, GetGPMFPayload() is added in GoPro's version of dng_host. And a couple of more errors, IsVc5Image() and ReadVc5Image() in dng_host. So there must be more patched needed. Do you happen to have them?

Thanks
Joost

Forums: 

BTW, you may not include gpr

BTW, you may not include gpr_sdk/private/gpr.cpp in your gpr_sdk build, LibRaw do not use this high level interface.

(looks like we need to update GPR readme)

-- Alex Tutubalin @LibRaw LLC

Thanks!

Thanks, that clarifies things. I'll give it a try.

It works!

I managed to build gpr and libraw against Adobe's stock dng sdk v1.5. It seems to work. In case someone else needs this:

I: Build gopro/gpr:

1. replace gopro's toplevel CMakeLists.txt with this one (this builds only a subset of the libraries):
------------------------------------
# minimum required cmake version
cmake_minimum_required( VERSION 3.5 FATAL_ERROR )

set(CMAKE_SUPPRESS_REGENERATION true)
set(CMAKE_C_FLAGS "-std=c99")

# project name
project( gpr )

option(DNGINCLUDEDIR "Adobe DNG toolkit include directory")
INCLUDE_DIRECTORIES( ${DNGINCLUDEDIR} )

# DNG toolkit requires C++11 minimum:
set_property(GLOBAL PROPERTY CXX_STANDARD 17)

# add needed subdirectories
add_subdirectory( "source/lib/common" )
add_subdirectory( "source/lib/vc5_common" )
add_subdirectory( "source/lib/vc5_decoder" )
add_subdirectory( "source/lib/gpr_sdk" )

set_property(TARGET gpr_sdk PROPERTY CXX_STANDARD 17)

IF (WIN32)
TARGET_COMPILE_DEFINITIONS( gpr_sdk PUBLIC -DqWinOS=1 -DqMacOS=0 -DqLinux=0)
ELSEIF (APPLE)
TARGET_COMPILE_DEFINITIONS( gpr_sdk PUBLIC -DqWinOS=0 -DqMacOS=1 -DqLinux=0)
ELSE()
TARGET_COMPILE_DEFINITIONS( gpr_sdk PUBLIC -DqWinOS=0 -DqMacOS=0 -DqLinux=1)
ENDIF()
----------------------------------------

2. apply the two patches of README.GoPro.txt section II b.
the patch of section IIa is not needed with libdng1.5.

3. delete these two files:
/source/lib/gpr_sdk/private/gpr.cpp
/source/lib/gpr_sdk/private/gpr_image_writer.cpp

4. run CMAKE with -DDNGINCLUDEDIR, pointing to the headers from Adobe dng 1.5.

5. build. You get 4 libraries "gpr_sdk", "vc5_common", "vc5_decoder", "common", the rest is ignored.

II build libraw:
1. pass the following to ./configure:
CXXFLAGS="-stdlib=libc++ -std=c++17" CPPFLAGS="-DUSE_DNGSDK -DUSE_GPRSDK"
(and also add -I... for the header paths of the dng library and gopro's headers)

2. remove the 'register' keyword from these files:
src/utils/phaseone_processing.cpp
src/x3f/x3f_parse_process.cpp

Or probably -std=c++11 should work as well. dng1.5 seems to require c++11 at least.

Thank you for detailed

Thank you for detailed explanation, we'll add cmake/gpr related section to readme.gopro.

Note: register keyword results into warning, not error on c++11

-- Alex Tutubalin @LibRaw LLC