Independent HDR bridge implementation

Original implementation interface (historical; see the rename record below):
package de.bur0k.videoEditApp.hdr; public final class NativeHdrBridge
static native long createSession()
static native void transcode(long handle, int inputFd, long inputOffset,
    long inputLength, String outputPath, ProgressListener progress)
    throws IOException
static native void cancelSession(long handle) throws IOException
static native void releaseSession(long handle) throws IOException
static native String ffmpegVersion()
static native String ffmpegConfiguration()
ProgressListener.onProgress(long sourceTimeUs), synchronous on calling worker.
java.io.InterruptedIOException identifies explicit native user cancellation.
Load library "independent_hdr_bridge". One transcode per session. Cancel is
sticky. Release rejects a running session; join transcode before releasing.
Invalid or released handles fail explicitly with IOException.

Inputs and independence boundaries:
- The behavior specification supplied in the implementation task.
- General knowledge of Java, JNI, C++17/POSIX and public FFmpeg APIs.
- Public FFmpeg headers installed on host (queried through pkg-config).
- Official FFmpeg n8.0 public avcodec.h, avformat.h, buffersink.h retrieved from
  https://raw.githubusercontent.com/FFmpeg/FFmpeg/n8.0/ for initial API checks.
- Parent-supplied build facts: FFmpeg 8.1.3 release URL and SHA256, zimg 3.0.6,
  Android NDK 28.2.13676358, LGPL-only encoders/filters and public link libraries.
- https://ffmpeg.org/releases/ffmpeg-8.1.3.tar.xz retrieved directly from the
  official release host. Verified SHA256:
  7138d28c96d9d3e3af4ee3d8cad72741f8ffb40da90c1112235dea3ecd3178a3
  Its public API headers were used for the final strict syntax compilation.
  No fftools implementation source was consulted.
- The installed official FFmpeg CLI, used ONLY to generate owned synthetic test
  media and independently inspect output, never as the conversion implementation.
- Public JNI headers supplied by the installed JDK, for host validation.
No app repository, AGENTS files, earlier conversation/checkpoints, other session
files, third-party wrapper source/binaries, FFmpegKit/Arthenica source or assets
are implementation inputs. No wrapper implementation was consulted or translated.
This records an independently authored implementation boundary, not legal
certification. FFmpeg licensing and build distribution are integration concerns.

Build requirements:
C++17; JNI; Android API28+; arm64-v8a or x86_64; FFmpeg 8.x public
libavformat, libavcodec, libavfilter, libavutil and libswresample.
Enable file protocol, MP4 muxer, source demuxers/decoders, native mpeg4 and aac
encoders, buffer/buffersink/format/zscale/tonemap filters, and zimg. No fftools,
command interpreter, networking API, hardware or GPL encoder is used.
The app owns source URI grants and partial-output deletion. It must keep input
FD alive until transcode joins and call from a non-main thread. Native duplicates
the FD but a dup shares its seek offset: do not concurrently read/seek that open
file description. Seekable sources use pread, avoiding shared-position changes.
Output pathname must be a new caller-owned local file. Output files are never
deleted by native. Callback exceptions propagate unchanged, including during
cancel races. Error messages contain stages/numeric errors, not file paths.
Output pathname must be absolute ASCII; unrepresentable JNI modified-UTF8 names
are explicitly rejected. No arbitrary protocols or command execution.
Mono/stereo unspecified channel order is resolved to its unambiguous standard
layout; unknown multichannel layouts fail explicitly.
R8: keep native entrypoint names/class and ProgressListener.onProgress(long).
There are no app-class FindClass strings or private Java helper lookups.

Execution evidence and scope:
Host FFmpeg n9.0.2 public shared libraries supplied actual host execution.
FFmpeg 8.1.3 public headers supplied a separate -Werror syntax check; the only
generated architecture header (avconfig.h) came from the installed host SDK.
All media fixtures were newly generated synthetic test patterns/sine tones.
Test Java uses only JDK public APIs plus host-only FileDescriptor reflection;
the production facade/native component does not reflect Java descriptor fields.
No Android device, parent build artifacts or app repository was inspected.
See BUILD.txt and VALIDATION.txt. Parent owns actual 8.1.3 Android linking,
distribution/licensing compliance, API28/modern-device and R8 integration tests.

Additional implementation input and delivery:
Parent supplied a black-box encoded-output requirement: MPEG-4 GOP size 12
matches the established output baseline. Explicit gop_size was changed to 12.
No wrapper implementation information was supplied or consulted.
Parent reports successful official FFmpeg 8.1.3 dependency builds for arm64-v8a
and x86_64; this report is not a claim of this component's Android runtime tests.
Parent supplied only official installed FFmpeg 8.1.3 public headers in the
permitted public-ffmpeg-8.1.3 subdirectory. Final GOP-12 source passed a strict
C++17 -Wall -Wextra -Wpedantic -Werror syntax check against those headers.
The Java facade, C++ implementation and this provenance are delivered as new
files to these three explicitly authorized WRITE-ONLY repository-relative locations:
app/src/main/java/de/bur0k/videoEditApp/hdr/NativeHdrBridge.java
app/src/main/cpp/native_hdr_bridge.cpp
third_party/native-hdr/PROVENANCE.txt
No repository files, AGENTS or other session material were read for delivery.
Source copies remain in the independent-hdr-bridge output directory.
The load name remains independent_hdr_bridge. This provenance records the
independent implementation boundary, not formal legal certification.

Integration dependency update (2026-11-09):
The Android integration now pins the unmodified official FFmpeg 9.0.2 release:
https://ffmpeg.org/releases/ffmpeg-9.0.2.tar.xz
SHA256: 8c3850283eb25fa026482078a04051e0be17347b09ef81a0849bec15a96e002e
The official download page identifies 9.0.2 (2026-09-18) as the latest stable
release on the 9.0 branch. Its detached release signature verified with the
FFmpeg release key, fingerprint FCF986EA15E6E293A5644F10B4322F04D67658D8,
retrieved from https://ffmpeg.org/ffmpeg-devel.asc. This verifies consistency
with that published key, not independent certification of its ownership.
The original implementation-input and execution records above are historical;
this dependency update does not rewrite those boundaries or reintroduce a
third-party wrapper.

Application identity rename (2026-11-11):
The app is now LunarSnip, with Android namespace/application ID app.lunarsnip.
The Java facade moved to app/src/main/java/app/lunarsnip/hdr/NativeHdrBridge.java
and its package is app.lunarsnip.hdr. The six corresponding JNI entrypoints now
use the Java_app_lunarsnip_hdr_NativeHdrBridge_ prefix; R8 rules follow the new
package. Methods, callback behavior and the independent_hdr_bridge library name
are unchanged. The original interface and delivery paths above remain historical
implementation-input records, not current integration instructions.
