forked from LibRaw/LibRaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.GoPro.txt
94 lines (65 loc) · 3.62 KB
/
README.GoPro.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
GoPro HERO/Fusion .GPR files are DNG files by nature, but with own wavelet-based codec.
GoPro provides GPR SDK for reading these files, available at https://github.com/gopro/gpr
LibRaw is able to use this GPR SDK to read GoPro HERO/Fusion files.
To enable this support:
1. Build GPR SDK (see NOTES section below)
2. Build LibRaw with -DUSE_DNGSDK and -DUSE_GPRSDK compiler flags
(you'll need to adjust INCLUDE path and linker flags to add GPR SDK files to compile/link).
NOTES:
I. GPR SDK comes with (patched) Adobe DNG SDK source. You may use this DNG SDK instead of
Adobe's one, or use standard Adobe's distribution.
II. If Adobe's version is used:
a) You'll need to enable dng_ifd.fCompression value == 9 in dng_ifd::IsValidCFA() call
Use provided patch: LibRaw/GoPro/dng-sdk-allow-VC5-validate.diff
(it may not apply to any Adobe DNG SDK version, if so apply it by hands).
b) Newer (than supplied w/ GPR SDK) Adobe SDK versions changed dng_read_image::ReadTile interface
If newer Adobe SDK is used, please apply patches LibRaw/GoPro/gpr_read_image.cpp.diff
and LibRaw/GoPro/gpr_read_image.h.diff to your GPR SDK code
c) GPR SDK's gpr_sdk/private/gpr.cpp uses own (added) dng_host method GetGPMFPayload
so it will not compile with Adobes (not patched) dng_host.h
LibRaw does not use high-level interface provided by gpr.cpp, so
possible problem solutions are:
- either compile GPR SDK without gpr_sdk/private/gpr.cpp file
- or provide GPR's dng_host.h while building GPR SDK.
(in our software we use 1st method).
See Note VII below for detailed GPR SDK build instructions w/ Cmake
III. LibRaw uses private gpr_read_image() interface
So you'll need to add PATH_TO/gpr_sdk/gpr_sdk/private to -I compiler flags.
IV. -DUSE_GPRSDK LibRaw build flag requires -DUSE_DNGSDK. LibRaw will not compile if
USE_GPRSDK is set, but USE_DNGSDK is not
V. LibRaw will use DNG SDK to unpack GoPro files even if imgdata.params.use_dng_sdk is set to 0.
VI. If LibRaw is built with -DUSE_GPRSDK, LibRaw::capabilities will return LIBRAW_CAPS_GPRSDK flag.
VII. GPR SDK build using cmake (contributed by our user, great thanks)
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.