Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved GIL acquisition deadlock #33

Merged
merged 279 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
125b11e
Issue #16: using Debug CMake type in build script
dzhoshkun Oct 12, 2018
20fb19e
Issue #16: renamed variable for clarity in run script
dzhoshkun Oct 13, 2018
7dac7e6
Issue #16: setting ulimit to dump cores when running check
dzhoshkun Oct 13, 2018
470cfc8
Issue #16: saving all output in a hierarchical session directory
dzhoshkun Oct 13, 2018
5e89c91
Issue #16: added indentation for readability
dzhoshkun Oct 13, 2018
bc2a2d9
Issue #16: can now specify number of reps in check script
dzhoshkun Oct 13, 2018
435b302
Issue #16: can now optionally specify root output dir (e.g. not to fi…
dzhoshkun Oct 13, 2018
d69aee7
Issue #16: logging frequency of exit codes as well
dzhoshkun Oct 13, 2018
dfab9e4
Issue #16: nicer formatting of exit code frequencies log
dzhoshkun Oct 13, 2018
b74aeb5
Issue #16: ignoring output folder to avoid an accidental commit of bi…
dzhoshkun Oct 13, 2018
099903a
Issue #16: using absolute path expansion if root-dir passed as a CLI …
dzhoshkun Oct 13, 2018
a0cc695
Issue #16: intermediately writing exit codes every 10 iterations
dzhoshkun Oct 13, 2018
2ee8a52
Issue #16: using git-describe to tag the output with the version used
dzhoshkun Oct 13, 2018
e319205
Issue #16: querying for update override after the acquisition of GIL
dzhoshkun Oct 13, 2018
40777b6
Issue #16: checking update method overridden in Python before actuall…
dzhoshkun Oct 13, 2018
f47b76e
Issue #16: using Pythonic percentage formatting
dzhoshkun Oct 14, 2018
ed3a02a
Issue #16: added a SnapshotSaver class that implements IObserver dire…
dzhoshkun Oct 14, 2018
f87c8ff
Issue #16: inserted snapshot saver into the pipeline
dzhoshkun Oct 14, 2018
9be73e9
Issue #16: fixed timed saving of snapshots
dzhoshkun Oct 14, 2018
e4c17d0
Issue #16: renamed buffer => np_buffer as buffer is built-in type
dzhoshkun Oct 14, 2018
93a6cc7
Issue #16: renamed global buffers for clarity
dzhoshkun Oct 14, 2018
782c8a1
Issue #16: commented checker script
dzhoshkun Oct 14, 2018
b6261c5
Issue #16: moved issue-specific comments to shell script
dzhoshkun Oct 14, 2018
fdfbde5
Issue #16: added synopsis display to shell script
dzhoshkun Oct 14, 2018
9108bdd
Issue #16: shell script now shows the current session directory befor…
dzhoshkun Oct 14, 2018
345aa97
Issue #16: shorter name for Python script
dzhoshkun Oct 14, 2018
1a88e0b
Issue #16: shorter name for Bash script
dzhoshkun Oct 14, 2018
5db2dcc
Issue #16: fixed typos
dzhoshkun Oct 14, 2018
37ff47d
Issue #16: reduced snapshot output
dzhoshkun Oct 14, 2018
67ee662
Issue #16: fixed calling of Python script from Bash script
dzhoshkun Oct 14, 2018
4f5a726
Issue #16: added an RTD page linking to the complex pipeline example
dzhoshkun Oct 14, 2018
aae78a2
Issue #16: added the new RTD page to the index
dzhoshkun Oct 14, 2018
291fc3f
Issue #16: fixed cross-reference to NumPy example from new RTD page
dzhoshkun Oct 14, 2018
1531758
Issue #16: added link from new RTD page to example source code on GitHub
dzhoshkun Oct 14, 2018
a7c6535
Issue #16: made the title of the new RTD page more descriptive
dzhoshkun Oct 14, 2018
e78af6f
Issue #16: revised the RTD page wording for clarity
dzhoshkun Oct 14, 2018
2e07b9a
Issue #16: removed line numbers from example on new RTD page
dzhoshkun Oct 14, 2018
3657e01
Issue #16: added a Python script stub for checking multi-threading re…
dzhoshkun Oct 11, 2018
559b955
Issue #16: added a Bash script for building GIFT-Grab and subsequentl…
dzhoshkun Oct 11, 2018
21bd7c0
Issue #16: added a 'Dyer' processing node to multi-threading reliability
dzhoshkun Oct 12, 2018
7b7e8ce
Issue #16: Python script now uses CLI argument for input file
dzhoshkun Oct 12, 2018
da1a82d
Issue #16: added multi-node pipeline producing red- and yellow-dyed o…
dzhoshkun Oct 12, 2018
e63d5e3
Issue #16: added a threaded Histogrammer class stub
dzhoshkun Oct 12, 2018
e9bebfc
Issue #16: added dummy print statement to see Histogrammer is alive
dzhoshkun Oct 12, 2018
7395cbd
Issue #16: factored Histogrammer stub out to HistogrammerRed and Buff…
dzhoshkun Oct 12, 2018
e54ed89
Issue #16: implemented update of BuffererRed
dzhoshkun Oct 12, 2018
0851be6
Issue #16: implemented run of HistogrammerRed
dzhoshkun Oct 12, 2018
3b40ef0
Issue #16: renamed Dyer vars for clarity
dzhoshkun Oct 12, 2018
a05de37
Issue #16: Dyer.update uses lock
dzhoshkun Oct 12, 2018
41bb484
Issue #16: inserted a red bufferer into the pipeline
dzhoshkun Oct 12, 2018
1855e35
Issue #16: fixed call to histogram function
dzhoshkun Oct 12, 2018
6c468c9
Issue #16: Dyer now really dyes instead of fixing color to a value
dzhoshkun Oct 12, 2018
ae82811
Issue #16: histogrammer now displays a redness score instead of histo…
dzhoshkun Oct 12, 2018
a571512
Issue #16: using more sensible values for dyeing
dzhoshkun Oct 12, 2018
42544f9
Issue #16: added a BuffererOrig class, a virtual replica of BuffererRed
dzhoshkun Oct 12, 2018
59bf5b2
Issue #16: BuffererRed now takes buffer as parameter to constructor i…
dzhoshkun Oct 12, 2018
f436ed7
Revert "Issue #16: added a BuffererOrig class, a virtual replica of B…
dzhoshkun Oct 12, 2018
db0527f
Issue #16: renamed BuffererRed => Bufferer
dzhoshkun Oct 12, 2018
85db3b3
Issue #16: HistogrammerRed now takes buffer as a constructor argument…
dzhoshkun Oct 12, 2018
1105daa
Issue #16: HistogrammerRed is now generic Histogrammer
dzhoshkun Oct 12, 2018
0b9296a
Issue #16: Histogrammer now accepts a tag for generically printing wh…
dzhoshkun Oct 12, 2018
5b0e521
Issue #16: inserted an original image histogrammer into the pipeline
dzhoshkun Oct 12, 2018
682dae1
Issue #16: Histogrammer now accepts a frame rate and flag for display…
dzhoshkun Oct 12, 2018
decbde6
Issue #16: now can specify the frequency of coloredness prints
dzhoshkun Oct 12, 2018
a6e4c34
Issue #16: dyeing red more prominently
dzhoshkun Oct 12, 2018
e544b48
Issue #16: frame rate values that reproduced the problem
dzhoshkun Oct 12, 2018
1446b97
Issue #16: using Debug CMake type in build script
dzhoshkun Oct 12, 2018
0b0398b
Issue #16: renamed variable for clarity in run script
dzhoshkun Oct 13, 2018
171ed86
Issue #16: setting ulimit to dump cores when running check
dzhoshkun Oct 13, 2018
382c77a
Issue #16: saving all output in a hierarchical session directory
dzhoshkun Oct 13, 2018
84b4757
Issue #16: added indentation for readability
dzhoshkun Oct 13, 2018
6736a24
Issue #16: can now specify number of reps in check script
dzhoshkun Oct 13, 2018
f1c5d65
Issue #16: can now optionally specify root output dir (e.g. not to fi…
dzhoshkun Oct 13, 2018
bdd466b
Issue #16: logging frequency of exit codes as well
dzhoshkun Oct 13, 2018
4f06fa9
Issue #16: nicer formatting of exit code frequencies log
dzhoshkun Oct 13, 2018
90d10ac
Issue #16: ignoring output folder to avoid an accidental commit of bi…
dzhoshkun Oct 13, 2018
ba7731b
Issue #16: using absolute path expansion if root-dir passed as a CLI …
dzhoshkun Oct 13, 2018
4f5dec2
Issue #16: intermediately writing exit codes every 10 iterations
dzhoshkun Oct 13, 2018
46f2e79
Issue #16: using git-describe to tag the output with the version used
dzhoshkun Oct 13, 2018
8096d0a
Issue #16: querying for update override after the acquisition of GIL
dzhoshkun Oct 13, 2018
bddf3a9
Issue #16: checking update method overridden in Python before actuall…
dzhoshkun Oct 13, 2018
27c2dc1
Issue #16: using Pythonic percentage formatting
dzhoshkun Oct 14, 2018
ab70a44
Issue #16: added a SnapshotSaver class that implements IObserver dire…
dzhoshkun Oct 14, 2018
4009f15
Issue #16: inserted snapshot saver into the pipeline
dzhoshkun Oct 14, 2018
d318f78
Issue #16: fixed timed saving of snapshots
dzhoshkun Oct 14, 2018
9b57f88
Issue #16: renamed buffer => np_buffer as buffer is built-in type
dzhoshkun Oct 14, 2018
1b119b0
Issue #16: renamed global buffers for clarity
dzhoshkun Oct 14, 2018
d1b7ece
Issue #16: commented checker script
dzhoshkun Oct 14, 2018
e3368a1
Issue #16: moved issue-specific comments to shell script
dzhoshkun Oct 14, 2018
5298af2
Issue #16: added synopsis display to shell script
dzhoshkun Oct 14, 2018
075eeac
Issue #16: shell script now shows the current session directory befor…
dzhoshkun Oct 14, 2018
70e8fde
Issue #16: shorter name for Python script
dzhoshkun Oct 14, 2018
18ef69b
Issue #16: shorter name for Bash script
dzhoshkun Oct 14, 2018
cf3c85e
Issue #16: fixed typos
dzhoshkun Oct 14, 2018
38e62ce
Issue #16: reduced snapshot output
dzhoshkun Oct 14, 2018
124e100
Issue #16: fixed calling of Python script from Bash script
dzhoshkun Oct 14, 2018
b194ba8
Issue #16: added an RTD page linking to the complex pipeline example
dzhoshkun Oct 14, 2018
791a83c
Issue #16: added the new RTD page to the index
dzhoshkun Oct 14, 2018
7ea7c47
Issue #16: fixed cross-reference to NumPy example from new RTD page
dzhoshkun Oct 14, 2018
75fb5bd
Issue #16: added link from new RTD page to example source code on GitHub
dzhoshkun Oct 14, 2018
2ec3b25
Issue #16: made the title of the new RTD page more descriptive
dzhoshkun Oct 14, 2018
8ca5d20
Issue #16: revised the RTD page wording for clarity
dzhoshkun Oct 14, 2018
b7cd7b9
Issue #16: removed line numbers from example on new RTD page
dzhoshkun Oct 14, 2018
55665cc
Rebased #16 branch on to #20 branch, to be able to test the #16 fix w…
dzhoshkun Oct 19, 2018
be5620a
Issue #16: checker script now supports Blackmagic DeckLink 4K Extreme…
dzhoshkun Oct 19, 2018
32921fc
Issue #16: revised checker script for more generic variable names
dzhoshkun Oct 19, 2018
3f003c9
Issue #16: added missing variable and removed cropping in checker scr…
dzhoshkun Oct 19, 2018
af2157c
Issue #16: added missing file extension specification when using Deck…
dzhoshkun Oct 19, 2018
a327c37
Issue #16: multi-threading reliability checker now supports Epiphan D…
dzhoshkun Oct 21, 2018
f1179d0
Issue #16: multi-threading reliability launch script now supports Epi…
dzhoshkun Oct 21, 2018
5cdd60a
Issue #16: added a Python script stub for checking multi-threading re…
dzhoshkun Oct 11, 2018
28a40bf
Issue #16: added a Bash script for building GIFT-Grab and subsequentl…
dzhoshkun Oct 11, 2018
b4ab05b
Issue #16: added a 'Dyer' processing node to multi-threading reliability
dzhoshkun Oct 12, 2018
5a59a17
Issue #16: Python script now uses CLI argument for input file
dzhoshkun Oct 12, 2018
10c748f
Issue #16: added multi-node pipeline producing red- and yellow-dyed o…
dzhoshkun Oct 12, 2018
b7078b3
Issue #16: added a threaded Histogrammer class stub
dzhoshkun Oct 12, 2018
836abb0
Issue #16: added dummy print statement to see Histogrammer is alive
dzhoshkun Oct 12, 2018
79ae445
Issue #16: factored Histogrammer stub out to HistogrammerRed and Buff…
dzhoshkun Oct 12, 2018
f6b9a61
Issue #16: implemented update of BuffererRed
dzhoshkun Oct 12, 2018
57e85b0
Issue #16: implemented run of HistogrammerRed
dzhoshkun Oct 12, 2018
ea8e809
Issue #16: renamed Dyer vars for clarity
dzhoshkun Oct 12, 2018
1a8d91c
Issue #16: Dyer.update uses lock
dzhoshkun Oct 12, 2018
6d1ede0
Issue #16: inserted a red bufferer into the pipeline
dzhoshkun Oct 12, 2018
b1b5246
Issue #16: fixed call to histogram function
dzhoshkun Oct 12, 2018
4cc919c
Issue #16: Dyer now really dyes instead of fixing color to a value
dzhoshkun Oct 12, 2018
36ba5c4
Issue #16: histogrammer now displays a redness score instead of histo…
dzhoshkun Oct 12, 2018
1c247f2
Issue #16: using more sensible values for dyeing
dzhoshkun Oct 12, 2018
d001d8f
Issue #16: added a BuffererOrig class, a virtual replica of BuffererRed
dzhoshkun Oct 12, 2018
b1d8310
Issue #16: BuffererRed now takes buffer as parameter to constructor i…
dzhoshkun Oct 12, 2018
1290fad
Revert "Issue #16: added a BuffererOrig class, a virtual replica of B…
dzhoshkun Oct 12, 2018
6fcf20a
Issue #16: renamed BuffererRed => Bufferer
dzhoshkun Oct 12, 2018
66dd339
Issue #16: HistogrammerRed now takes buffer as a constructor argument…
dzhoshkun Oct 12, 2018
60d44a5
Issue #16: HistogrammerRed is now generic Histogrammer
dzhoshkun Oct 12, 2018
07d9ca9
Issue #16: Histogrammer now accepts a tag for generically printing wh…
dzhoshkun Oct 12, 2018
2347e43
Issue #16: inserted an original image histogrammer into the pipeline
dzhoshkun Oct 12, 2018
a947f5b
Issue #16: Histogrammer now accepts a frame rate and flag for display…
dzhoshkun Oct 12, 2018
7e4bfe4
Issue #16: now can specify the frequency of coloredness prints
dzhoshkun Oct 12, 2018
805e659
Issue #16: dyeing red more prominently
dzhoshkun Oct 12, 2018
faf96f7
Issue #16: frame rate values that reproduced the problem
dzhoshkun Oct 12, 2018
36746d2
Issue #16: using Debug CMake type in build script
dzhoshkun Oct 12, 2018
1ef3c35
Issue #16: renamed variable for clarity in run script
dzhoshkun Oct 13, 2018
5483be9
Issue #16: setting ulimit to dump cores when running check
dzhoshkun Oct 13, 2018
fe29300
Issue #16: saving all output in a hierarchical session directory
dzhoshkun Oct 13, 2018
620f0f4
Issue #16: added indentation for readability
dzhoshkun Oct 13, 2018
ee7aa5f
Issue #16: can now specify number of reps in check script
dzhoshkun Oct 13, 2018
94ffd82
Issue #16: can now optionally specify root output dir (e.g. not to fi…
dzhoshkun Oct 13, 2018
f77c463
Issue #16: logging frequency of exit codes as well
dzhoshkun Oct 13, 2018
c3ce578
Issue #16: nicer formatting of exit code frequencies log
dzhoshkun Oct 13, 2018
5072e59
Issue #16: ignoring output folder to avoid an accidental commit of bi…
dzhoshkun Oct 13, 2018
8d88435
Issue #16: using absolute path expansion if root-dir passed as a CLI …
dzhoshkun Oct 13, 2018
43e9512
Issue #16: intermediately writing exit codes every 10 iterations
dzhoshkun Oct 13, 2018
8e07042
Issue #16: using git-describe to tag the output with the version used
dzhoshkun Oct 13, 2018
f0f7bb5
Issue #16: querying for update override after the acquisition of GIL
dzhoshkun Oct 13, 2018
3b96e72
Issue #16: checking update method overridden in Python before actuall…
dzhoshkun Oct 13, 2018
8a41dae
Issue #16: using Pythonic percentage formatting
dzhoshkun Oct 14, 2018
3ac735d
Issue #16: added a SnapshotSaver class that implements IObserver dire…
dzhoshkun Oct 14, 2018
74ee1c8
Issue #16: inserted snapshot saver into the pipeline
dzhoshkun Oct 14, 2018
4b10f04
Issue #16: fixed timed saving of snapshots
dzhoshkun Oct 14, 2018
5e03e83
Issue #16: renamed buffer => np_buffer as buffer is built-in type
dzhoshkun Oct 14, 2018
67e384c
Issue #16: renamed global buffers for clarity
dzhoshkun Oct 14, 2018
3ed391a
Issue #16: commented checker script
dzhoshkun Oct 14, 2018
c66665c
Issue #16: moved issue-specific comments to shell script
dzhoshkun Oct 14, 2018
c9eb7dd
Issue #16: added synopsis display to shell script
dzhoshkun Oct 14, 2018
f76c706
Issue #16: shell script now shows the current session directory befor…
dzhoshkun Oct 14, 2018
a196828
Issue #16: shorter name for Python script
dzhoshkun Oct 14, 2018
9289a48
Issue #16: shorter name for Bash script
dzhoshkun Oct 14, 2018
206efc2
Issue #16: fixed typos
dzhoshkun Oct 14, 2018
db276e8
Issue #16: reduced snapshot output
dzhoshkun Oct 14, 2018
b1bad2e
Issue #16: fixed calling of Python script from Bash script
dzhoshkun Oct 14, 2018
209e918
Issue #16: added an RTD page linking to the complex pipeline example
dzhoshkun Oct 14, 2018
7aa547e
Issue #16: added the new RTD page to the index
dzhoshkun Oct 14, 2018
3da6eea
Issue #16: fixed cross-reference to NumPy example from new RTD page
dzhoshkun Oct 14, 2018
7ead125
Issue #16: added link from new RTD page to example source code on GitHub
dzhoshkun Oct 14, 2018
83dd35d
Issue #16: made the title of the new RTD page more descriptive
dzhoshkun Oct 14, 2018
1b4e3eb
Issue #16: revised the RTD page wording for clarity
dzhoshkun Oct 14, 2018
5a15bc0
Issue #16: removed line numbers from example on new RTD page
dzhoshkun Oct 14, 2018
eee97b9
Issue #16: added a Python script stub for checking multi-threading re…
dzhoshkun Oct 11, 2018
170f789
Issue #16: added a Bash script for building GIFT-Grab and subsequentl…
dzhoshkun Oct 11, 2018
455cc68
Issue #16: added a 'Dyer' processing node to multi-threading reliability
dzhoshkun Oct 12, 2018
9488646
Issue #16: Python script now uses CLI argument for input file
dzhoshkun Oct 12, 2018
20343bb
Issue #16: added multi-node pipeline producing red- and yellow-dyed o…
dzhoshkun Oct 12, 2018
726bb37
Issue #16: added a threaded Histogrammer class stub
dzhoshkun Oct 12, 2018
9fda396
Issue #16: added dummy print statement to see Histogrammer is alive
dzhoshkun Oct 12, 2018
9b55161
Issue #16: factored Histogrammer stub out to HistogrammerRed and Buff…
dzhoshkun Oct 12, 2018
c820adb
Issue #16: implemented update of BuffererRed
dzhoshkun Oct 12, 2018
3d4dfce
Issue #16: implemented run of HistogrammerRed
dzhoshkun Oct 12, 2018
beab3d0
Issue #16: renamed Dyer vars for clarity
dzhoshkun Oct 12, 2018
72e4830
Issue #16: Dyer.update uses lock
dzhoshkun Oct 12, 2018
b8f91ad
Issue #16: inserted a red bufferer into the pipeline
dzhoshkun Oct 12, 2018
2c8fc12
Issue #16: fixed call to histogram function
dzhoshkun Oct 12, 2018
67d370b
Issue #16: Dyer now really dyes instead of fixing color to a value
dzhoshkun Oct 12, 2018
f09e304
Issue #16: histogrammer now displays a redness score instead of histo…
dzhoshkun Oct 12, 2018
91ca884
Issue #16: using more sensible values for dyeing
dzhoshkun Oct 12, 2018
97910f8
Issue #16: added a BuffererOrig class, a virtual replica of BuffererRed
dzhoshkun Oct 12, 2018
b5be85c
Issue #16: BuffererRed now takes buffer as parameter to constructor i…
dzhoshkun Oct 12, 2018
c64f863
Revert "Issue #16: added a BuffererOrig class, a virtual replica of B…
dzhoshkun Oct 12, 2018
8f76661
Issue #16: renamed BuffererRed => Bufferer
dzhoshkun Oct 12, 2018
6655980
Issue #16: HistogrammerRed now takes buffer as a constructor argument…
dzhoshkun Oct 12, 2018
a8e95b6
Issue #16: HistogrammerRed is now generic Histogrammer
dzhoshkun Oct 12, 2018
a409400
Issue #16: Histogrammer now accepts a tag for generically printing wh…
dzhoshkun Oct 12, 2018
5e4df49
Issue #16: inserted an original image histogrammer into the pipeline
dzhoshkun Oct 12, 2018
492cfad
Issue #16: Histogrammer now accepts a frame rate and flag for display…
dzhoshkun Oct 12, 2018
59e4a9a
Issue #16: now can specify the frequency of coloredness prints
dzhoshkun Oct 12, 2018
a80a29c
Issue #16: dyeing red more prominently
dzhoshkun Oct 12, 2018
c032350
Issue #16: frame rate values that reproduced the problem
dzhoshkun Oct 12, 2018
0f3d327
Issue #16: using Debug CMake type in build script
dzhoshkun Oct 12, 2018
c13a24f
Issue #16: renamed variable for clarity in run script
dzhoshkun Oct 13, 2018
a15424a
Issue #16: setting ulimit to dump cores when running check
dzhoshkun Oct 13, 2018
b864abe
Issue #16: saving all output in a hierarchical session directory
dzhoshkun Oct 13, 2018
5c7bde3
Issue #16: added indentation for readability
dzhoshkun Oct 13, 2018
d3534e6
Issue #16: can now specify number of reps in check script
dzhoshkun Oct 13, 2018
22c158b
Issue #16: can now optionally specify root output dir (e.g. not to fi…
dzhoshkun Oct 13, 2018
5795b39
Issue #16: logging frequency of exit codes as well
dzhoshkun Oct 13, 2018
85f4838
Issue #16: nicer formatting of exit code frequencies log
dzhoshkun Oct 13, 2018
d0a3c05
Issue #16: ignoring output folder to avoid an accidental commit of bi…
dzhoshkun Oct 13, 2018
36f0086
Issue #16: using absolute path expansion if root-dir passed as a CLI …
dzhoshkun Oct 13, 2018
c866810
Issue #16: intermediately writing exit codes every 10 iterations
dzhoshkun Oct 13, 2018
5177b08
Issue #16: using git-describe to tag the output with the version used
dzhoshkun Oct 13, 2018
452b0f9
Issue #16: using Pythonic percentage formatting
dzhoshkun Oct 14, 2018
b2f649d
Issue #16: added a SnapshotSaver class that implements IObserver dire…
dzhoshkun Oct 14, 2018
ecd7286
Issue #16: inserted snapshot saver into the pipeline
dzhoshkun Oct 14, 2018
0b90bd7
Issue #16: fixed timed saving of snapshots
dzhoshkun Oct 14, 2018
3f5e56d
Issue #16: renamed buffer => np_buffer as buffer is built-in type
dzhoshkun Oct 14, 2018
5099c9d
Issue #16: renamed global buffers for clarity
dzhoshkun Oct 14, 2018
58a2afe
Issue #16: commented checker script
dzhoshkun Oct 14, 2018
a78214c
Issue #16: moved issue-specific comments to shell script
dzhoshkun Oct 14, 2018
1844626
Issue #16: added synopsis display to shell script
dzhoshkun Oct 14, 2018
8ef5a46
Issue #16: shell script now shows the current session directory befor…
dzhoshkun Oct 14, 2018
ad14262
Issue #16: shorter name for Python script
dzhoshkun Oct 14, 2018
4a32b61
Issue #16: shorter name for Bash script
dzhoshkun Oct 14, 2018
0408f12
Issue #16: fixed typos
dzhoshkun Oct 14, 2018
66b0c33
Issue #16: reduced snapshot output
dzhoshkun Oct 14, 2018
6f3982d
Issue #16: fixed calling of Python script from Bash script
dzhoshkun Oct 14, 2018
f434c03
Issue #16: added an RTD page linking to the complex pipeline example
dzhoshkun Oct 14, 2018
0bd666a
Issue #16: fixed cross-reference to NumPy example from new RTD page
dzhoshkun Oct 14, 2018
144a517
Issue #16: added link from new RTD page to example source code on GitHub
dzhoshkun Oct 14, 2018
c890e4d
Issue #16: made the title of the new RTD page more descriptive
dzhoshkun Oct 14, 2018
0bf6a10
Issue #16: revised the RTD page wording for clarity
dzhoshkun Oct 14, 2018
eaa67d4
Issue #16: removed line numbers from example on new RTD page
dzhoshkun Oct 14, 2018
c6d611a
Issue #16: checker script now supports Blackmagic DeckLink 4K Extreme…
dzhoshkun Oct 19, 2018
41db15f
Issue #16: revised checker script for more generic variable names
dzhoshkun Oct 19, 2018
65b8724
Issue #16: added missing variable and removed cropping in checker scr…
dzhoshkun Oct 19, 2018
9fa8640
Issue #16: added missing file extension specification when using Deck…
dzhoshkun Oct 19, 2018
64f1e8b
Issue #16: multi-threading reliability checker now supports Epiphan D…
dzhoshkun Oct 21, 2018
30a2ed9
Issue #16: multi-threading reliability launch script now supports Epi…
dzhoshkun Oct 21, 2018
6a43bec
After rebasing #16 branch onto master:
dzhoshkun Oct 22, 2018
7e355c7
Issue #16: using the SDI port of Epiphan DVI2PCIe Duo instead of the …
dzhoshkun Oct 22, 2018
c5f590f
Issue #16: using default thread constructor with move semantics to en…
dzhoshkun Oct 23, 2018
8bdc48c
Issue #35, #16: surrounded VideoSourceOpenCV colour conversion with a…
dzhoshkun Oct 23, 2018
0322034
Issue #16: build directory is now relative to calling directory, to p…
dzhoshkun Oct 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ src/build
src/dist
src/*.egg-info
*.swp
src/tests/pipeline/mtr-build
gg-iss-16
23 changes: 23 additions & 0 deletions doc/source/complex.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _Complex:

Multi-threaded complex processing pipelines
===========================================

The example below shows how GIFT-Grab can be used for running complex pipelines with multiple
intermediate processing nodes and threads.
The intermediate processing nodes in this example are built on the same principles as in the
:ref:`SciPy` example.
Running the example requires an `HEVC-encoded MP4 file`_, an `NVENC-capable GPU`_, and `NumPy support`_.

.. _`HEVC-encoded MP4 file`: https://github.com/gift-surg/GIFT-Grab/blob/master/doc/build.md#reading-video-files
.. _`NVENC-capable GPU`: https://github.com/gift-surg/GIFT-Grab/blob/master/doc/build.md#hevc
.. _`NumPy support`: https://github.com/gift-surg/GIFT-Grab/blob/master/doc/build.md#python-api

The full source code of the example is below.
Please follow the comments and the flow of code.
This example is also available on GitHub_:

.. literalinclude:: ../../src/tests/pipeline/complex_pipeline.py
:language: python

.. _GitHub: https://github.com/gift-surg/GIFT-Grab/blob/master/src/tests/pipeline/complex_pipeline.py
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Examples
network
scipy
encoding
complex

Citing GIFT-Grab
^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions src/api/broadcastdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace gg
BroadcastDaemon::BroadcastDaemon(IVideoSource * source)
: _source(source)
, _running(false)
, _thread()
{
if (_source == nullptr)
throw VideoSourceError("Null pointer passed"
Expand Down
20 changes: 18 additions & 2 deletions src/opencv/opencv_video_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,24 @@ bool VideoSourceOpenCV::get_frame(gg::VideoFrame & frame)
_buffer_bgra.cols != _buffer.cols) {
_buffer_bgra = cv::Mat::zeros(_buffer.rows, _buffer.cols, CV_8UC4);
}
// Convert to BGRA
cv::cvtColor(_buffer, _buffer_bgra, CV_BGR2BGRA);
/* This too broad try-catch block is a workaround to
* https://github.com/gift-surg/GIFT-Grab/issues/35
* as OpenCV seems to intermittently throw an assertion
* exception in the form:
* "Can't fetch data from terminated TLS container".
* To make things worse, this exception is unhandled in
* the accompanying BroadcastDaemon thread, and so leads
* to an unspecific abortion of the whole application.
*/
try
{
// Convert to BGRA
cv::cvtColor(_buffer, _buffer_bgra, CV_BGR2BGRA);
}
catch (...)
{
return false;
}
unsigned char * data = nullptr;
size_t data_length = 0;
size_t cols = 0, rows = 0;
Expand Down
11 changes: 7 additions & 4 deletions src/python/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ class IObserverWrapper : public gg::IObserver, public wrapper<gg::IObserver>
{
gg::ScopedPythonGILLock gil_lock;
VideoFrameNumPyWrapper wrapped_frame(&frame);
this->get_override("update")(boost::ref(wrapped_frame));
if (override f = this->get_override("update"))
f(boost::ref(wrapped_frame));
}
};

Expand Down Expand Up @@ -332,11 +333,13 @@ class IObservableObserverWrapper : public gg::IObservable

void update(gg::VideoFrame & frame)
{
if (override f = this->get_override("update"))
{
VideoFrameNumPyWrapper wrapped_frame(&frame);
gg::ScopedPythonGILLock gil_lock;
f(boost::ref(wrapped_frame));
if (override f = this->get_override("update"))
{
VideoFrameNumPyWrapper wrapped_frame(&frame);
f(boost::ref(wrapped_frame));
}
}
notify(frame);
}
Expand Down
247 changes: 247 additions & 0 deletions src/tests/pipeline/complex_pipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Example showing a complex GIFT-Grab pipeline with
multiple intermediate processing nodes.
"""

from time import (sleep, time)
import argparse
import os.path
import threading
import numpy as np
import scipy.misc
from pygiftgrab import (VideoSourceFactory, VideoFrame, Device,
ColourSpace, IObservableObserver,
VideoTargetFactory, Codec, IObserver)


# global NumPy buffers
np_buffer_red, np_buffer_orig = None, None

# mutex protecting frame data passed from node to node
# in the GIFT-Grab processing pipeline
lock = threading.Lock()


class SnapshotSaver(IObserver):
"""A snapshot saver for saving incoming frames to PNG files."""

def __init__(self, root_dir, save_freq=5):
"""
Initialise a snapshot saver with a saving frequency.

:param root_dir: the folder where to save the snapshots
:param save_freq: saving frequency. The default value tells
the saver to save every 5 seconds.
"""
super(SnapshotSaver, self).__init__()
assert 5 <= save_freq # to avoid flooding disk with images
self.save_freq = save_freq
self.root_dir = root_dir
self.last_saved = time()
self.num_saved = 0

def update(self, frame):
"""Implement ``IObserver.update``."""
if time() - self.last_saved >= self.save_freq:
self.num_saved += 1
out_file = os.path.join(self.root_dir,
'frame-{:010d}.png'.format(self.num_saved))
scipy.misc.imsave(out_file, frame.data(True))
self.last_saved = time()


class Bufferer(IObservableObserver):
"""GIFT-Grab processing node that updates a frame buffer."""

def __init__(self, np_buffer):
"""Initialise a bufferer that will update given buffer."""
super(Bufferer, self).__init__()
self.buffer = np_buffer

def update(self, frame):
"""Implement ``IObservableObserver.update``."""
with lock:
data = frame.data(True)
self.buffer[:, :, :] = data[:, :, :]


class Histogrammer(threading.Thread):
"""
GIFT-Grab processing node that computes the histogram of
an image channel and prints how "colored" that channel is.
"""

channels = ('Blue', 'Green', 'Red', 'Alpha')

def __init__(self, np_buffer, channel, tag, frame_rate, display_freq):
"""
:param np_buffer: image buffer to use
:param channel: image channel to compute coloredness for
:param tag: a tag describing what this image is, e.g.
how it's been processed within a GIFT-Grab pipeline
:param frame_rate: the rate at which to compute the
coloredness (unit: frames-per-second)
:param display_freq: how many times to skip the display
of computed coloredness, e.g. if 5 is provided, the
coloredness of every 5th frame will be printed to the
console
"""
super(Histogrammer, self).__init__()
assert channel in range(3)
assert 0 < frame_rate <= 60
assert 0 <= display_freq
self.channel = channel
self.buffer = np_buffer
self.tag = tag
self.display_freq = display_freq
self.num_skipped = 0
self.sleep_interval = 1.0 / frame_rate
self.running = False

def run(self):
"""Override ``Thread.run``."""
if self.running:
return

histogram, num_bins = None, 10
scale = np.array([i for i in range(1, num_bins + 1)], np.float)
self.running = True
while self.running:
with lock:
histogram, _ = np.histogram(
self.buffer[:, :, 2], bins=num_bins, range=(0, 256)
)
if histogram is not None:
coloredness = np.sum(histogram * scale)
coloredness /= np.sum(histogram)
coloredness /= num_bins
if self.num_skipped >= self.display_freq:
print('{}ness of {} image: {:.0%}'.format(
Histogrammer.channels[self.channel],
self.tag, coloredness
))
self.num_skipped = 0
else:
self.num_skipped += 1
sleep(self.sleep_interval)

def stop(self):
"""Stop the thread."""
self.running = False


class Dyer(IObservableObserver):
"""Dyes specified channel of an incoming video frame."""

def __init__(self, channel, increment):
"""
:param channel: image channel to dye
:param increment: how much to dye the image channel
"""
super(Dyer, self).__init__()
assert 0 <= channel < 3
assert 0 <= increment < 256
self.channel = channel
self.increment = increment

def update(self, frame):
"""Implement ``IObservableObserver.update``."""
with lock:
data = frame.data(True)
channel_data = data[:, :, self.channel]
channel_data[channel_data < 255 - self.increment] += self.increment


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', type=str, required=True,
metavar='VIDEO_INPUT',
help='decklink (for grabbing frames from a Blackmagic DeckLink 4K Extreme 12G),\n'
'dvi2pcie (for grabbing frames from an Epiphan DVI2PCIe Duo SDI port\n'
' or a video file (HEVC-encoded MP4)')
args = parser.parse_args()
video_input = args.input

sfac = VideoSourceFactory.get_instance()

if video_input == 'decklink':
filename, ext = 'decklink', '.mp4'

# start acquiring frames from a DeckLink 4K Extreme 12G
source = sfac.get_device(Device.DeckLink4KExtreme12G, ColourSpace.BGRA)
elif video_input == 'dvi2pcie':
filename, ext = 'dvi2pcie', '.mp4'

# start acquirigin frames from an Epiphan DVI2PCIe Duo SDI port
source = sfac.get_device(Device.DVI2PCIeDuo_SDI, ColourSpace.BGRA)
else:
filename = os.path.basename(video_input)
filename, ext = os.path.splitext(filename)
assert filename
assert ext == '.mp4'

# initialise reading of passed file
source = sfac.create_file_reader(video_input, ColourSpace.BGRA)

frame = VideoFrame(ColourSpace.BGRA, False)
source.get_frame(frame)
frame_shape = (frame.rows(), frame.cols(), 4)

# prepare for creating encoders (writers)
tfac = VideoTargetFactory.get_instance()
frame_rate = source.get_frame_rate()

# create a red and green Dyer
red_dyer = Dyer(2, 128)
green_dyer = Dyer(1, 64)

# create the bufferer for the red and green Dyers
np_buffer_red = np.zeros(frame_shape, np.uint8)
bufferer_red = Bufferer(np_buffer_red)
np_buffer_orig = np.zeros_like(np_buffer_red)
bufferer_orig = Bufferer(np_buffer_orig)

# create the histogrammers for the red-dyed and
# the original video frames, and start them
hist_red = Histogrammer(np_buffer_red, 2, 'red-dyed', 60.0, 10)
hist_red.start()
hist_orig = Histogrammer(np_buffer_orig, 2, 'original', 50.0, 10)
hist_orig.start()

# create encoders for the red-dyed and yellow-dyed (as green
# is applied on top of red) video streams
red_file = os.path.join('.', ''.join([filename, '-red', ext]))
red_writer = tfac.create_file_writer(Codec.HEVC, red_file, frame_rate)
yellow_file = os.path.join('.', ''.join([filename, '-yellow', ext]))
yellow_writer = tfac.create_file_writer(Codec.HEVC, yellow_file, frame_rate)

# create a SnapshotSaver for saving a number of yellow-dyed
# video frames
yellow_snapshots = SnapshotSaver('.', 9)

# assemble the GIFT-Grab pipeline
source.attach(bufferer_orig)
bufferer_orig.attach(red_dyer)
red_dyer.attach(red_writer)
red_dyer.attach(bufferer_red)
red_dyer.attach(green_dyer)
green_dyer.attach(yellow_writer)
green_dyer.attach(yellow_snapshots)

sleep(20) # operate pipeline for 20 sec

# stop the histogrammers
hist_red.stop()
hist_orig.stop()

# disassemble the GIFT-Grab pipeline
source.detach(bufferer_orig)
bufferer_orig.detach(red_dyer)
red_dyer.detach(red_writer)
red_dyer.detach(bufferer_red)
red_dyer.detach(green_dyer)
green_dyer.detach(yellow_writer)
green_dyer.detach(yellow_snapshots)
Loading