Skip to content

Add Samsung SEF 3P plugin (JPEG SEFH/SEFT trailer and HEIC sefd box) - #11

Open
DichenZhang1 wants to merge 1 commit into
Developmentfrom
feat/plugin-samsung-sef
Open

DichenZhang1 wants to merge 1 commit into
Developmentfrom
feat/plugin-samsung-sef

Conversation

@DichenZhang1

Copy link
Copy Markdown
Collaborator

Summary

Adds the samsung_sef 3P metadata provider plugin supporting Samsung Extended Format (SEF) Motion Photos across both JPEG (container.trailer with SEFH/SEFT) and HEIC (heic.sefd box paired with mpvd).

Key Changes

  • Plugin Implementation (lib/core/plugins/samsung_sef/):
    • samsung_sef_metadata.proto: Defines SamsungSefMetadata (sef_version, sef_entry_count, has_motion_photo_data, motion_photo_data_magic, video_offset, video_length, primary_image_timestamp_us, sef_keys).
    • SamsungSefProvider: Parses backward-indexed SEFH/SEFT directories (v106 and v107), extracts MotionPhoto_Data (0x0A30), strips 12-byte mpv2/mpv3 headers in JPEG trailers to expose the exact embedded MP4 stream, and resolves heic.sefd pointers to the mpvd box payload.
  • Engine & Splitter Plumbing:
    • Passes HandlerOptions (disable_3p_plugins, enabled_3p_plugins) into MetadataEngine::Parse.
    • Updates JpegContainerSplitter to inspect the 32-byte EOF tail and adjust trailer_start to the earliest SEF record (sefh_offset - max_neg_offset) when SEFT is present.
    • Updates HeifContainerSplitter to emit heic.sefd blocks with associated mpvd bounds.
  • Tests (samsung_sef_provider_test.cc):
    • Unit and end-to-end tests covering Identify, DecodeToSemantic, GetVideoInfo, IsMotionPhoto, SEF v106 (mpv2 & raw MP4) and v107 (mpv3), HEIC sefd+mpvd splitting, primary image/video extraction, HandlerOptions gating, and corrupted/overflow boundary safety.

@DichenZhang1
DichenZhang1 force-pushed the feat/plugin-samsung-sef branch from 7c433e0 to 645a4f2 Compare October 12, 2026 21:37
@DichenZhang1
DichenZhang1 force-pushed the feat/plugin-samsung-sef branch from 645a4f2 to 83fe572 Compare October 12, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant