HTTP transport to the Kdenlive scripting fork — the JVM boundary.
Strata: Pure routes/request (kdenlive.routes, portable) Port IKdenlive — call a catalog route, get data back Boundary HttpKdenlive — java.net.http, JSON wire Seam kdenlive — read at call time; rebind in tests
The wire encoding is JSON. Requests carry the route's :body as a JSON
object, built by ->json here.
Responses are NOT decoded. -call answers
{:ok {:status int :body "<raw JSON string>"}}, because this namespace has
no JSON reader: ->json writes, and nothing reads. A caller that needs a
field out of the answer (hive-creator's :finish binds [:ids 0] and [:id]
to thread ids between steps) therefore cannot use this transport yet; the
headless document transport answers parsed data and is what such callers
run against today. This docstring previously claimed responses came back
"decoded to Clojure data with keyword keys", which was never true.
Tracked as a card: give this transport a JSON reader, and with it the :timeline/insert-clip trim, which the fork cannot do in one call (its scriptInsertClip binds binId/trackId/position only) and which therefore needs a following :clip/resize to match what the headless transport does.
HTTP transport to the Kdenlive scripting fork — the JVM boundary.
Strata:
Pure routes/request (kdenlive.routes, portable)
Port IKdenlive — call a catalog route, get data back
Boundary HttpKdenlive — java.net.http, JSON wire
Seam *kdenlive* — read at call time; rebind in tests
The wire encoding is JSON. Requests carry the route's :body as a JSON
object, built by `->json` here.
Responses are NOT decoded. `-call` answers
{:ok {:status int :body "<raw JSON string>"}}, because this namespace has
no JSON reader: `->json` writes, and nothing reads. A caller that needs a
field out of the answer (hive-creator's :finish binds [:ids 0] and [:id]
to thread ids between steps) therefore cannot use this transport yet; the
headless document transport answers parsed data and is what such callers
run against today. This docstring previously claimed responses came back
"decoded to Clojure data with keyword keys", which was never true.
Tracked as a card: give this transport a JSON reader, and with it the
:timeline/insert-clip trim, which the fork cannot do in one call (its
scriptInsertClip binds binId/trackId/position only) and which therefore
needs a following :clip/resize to match what the headless transport does.The IKdenlive call dispatches through. Rebind with a recording stub in
tests; the delay keeps the default lazy so importing this ns never opens a
connection.
The IKdenlive `call` dispatches through. Rebind with a recording stub in tests; the delay keeps the default lazy so importing this ns never opens a connection.
(->json m)Encode m as JSON. Delegates to hive-kdenlive.kdenlive.json/write.
Kept as a name because callers and tests use it. It used to live here and
handled a FLAT map of scalars only, rendering anything else with str,
which turned :paths ["a" "b"] into a Clojure literal and :params {...} into one too. Those are the shapes hive-creator sends.
Encode `m` as JSON. Delegates to `hive-kdenlive.kdenlive.json/write`.
Kept as a name because callers and tests use it. It used to live here and
handled a FLAT map of scalars only, rendering anything else with `str`,
which turned `:paths ["a" "b"]` into a Clojure literal and `:params
{...}` into one too. Those are the shapes hive-creator sends.(call route-id & {:as params})Invoke catalog route route-id with params through *kdenlive*.
Invoke catalog route `route-id` with `params` through `*kdenlive*`.
(endpoint env)Where the scripting fork listens, from an environment map, read with the fork's OWN variable names (kdenlive/src/scripting/scriptingserver.cpp), so one environment configures both sides:
KDENLIVE_SCRIPTING_ADDRESS default 127.0.0.1 KDENLIVE_SCRIPTING_PORT default 9876 KDENLIVE_SCRIPTING_SECRET default none; sent as X-Kdenlive-Secret
The base URL carries /api/v1. The fork also accepts paths without it, but /api/v1 is the documented prefix and survives a stricter server.
Where the scripting fork listens, from an environment map, read with the fork's OWN variable names (kdenlive/src/scripting/scriptingserver.cpp), so one environment configures both sides: KDENLIVE_SCRIPTING_ADDRESS default 127.0.0.1 KDENLIVE_SCRIPTING_PORT default 9876 KDENLIVE_SCRIPTING_SECRET default none; sent as X-Kdenlive-Secret The base URL carries /api/v1. The fork also accepts paths without it, but /api/v1 is the documented prefix and survives a stricter server.
(http-kdenlive)(http-kdenlive base-url)(http-kdenlive base-url secret)An IKdenlive against the scripting fork. With no argument, where the fork's
own environment variables say it listens (see endpoint); with a base URL
and optional secret, exactly there.
An IKdenlive against the scripting fork. With no argument, where the fork's own environment variables say it listens (see `endpoint`); with a base URL and optional secret, exactly there.
(-call client route-id params)Invoke catalog route route-id with params.
{:ok data} | {:error :kdenlive/... :status int}
Invoke catalog route `route-id` with `params`.
{:ok data} | {:error :kdenlive/... :status int}(ping)True when the scripting fork answers. GET /project is the cheapest read the route table registers, so it doubles as the health probe.
True when the scripting fork answers. GET /project is the cheapest read the route table registers, so it doubles as the health probe.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |