Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Eyevinn/mp4ff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Eyevinn/mp4ff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: stream-process
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 15 files changed
  • 1 contributor

Commits on Oct 28, 2025

  1. Configuration menu
    Copy the full SHA
    47233e2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22e6eb4 View commit details
    Browse the repository at this point in the history
  3. feat: add streaming/incremental processing for fragmented MP4 files.

    Add Copy method for StypBox and FtypBox.
    
    Implements support for processing fragmented MP4 files incrementally without
    loading entire files into memory. This is essential for handling large media
    files, live streaming scenarios, and network streams where fragments arrive
    over time.
    
    Key components:
    
    1. StreamFile API (stream.go)
       - DecodeStream/InitDecodeStream: Reads init segment (ftyp, moov) and stops
       - ProcessFragments: Iteratively processes fragments with callbacks
       - Sliding window memory management with configurable retention
       - Fragment lifecycle callbacks for processing and cleanup control
    
    2. BoxSeekReader (boxseekreader.go)
       - Emulates seeking on non-seekable streams using buffered reading
       - Auto-growing buffer sized for current needs
       - Peek operations for looking ahead without consuming data
    
    3. SampleAccessor interface
       - GetSample: Fetch individual samples (1-based indexing)
       - GetSampleRange: Fetch ranges of samples efficiently
       - GetSamples: Fetch all samples for a track
    
    Buffer management:
    - ReadFullBox returns a slice view of the buffer (no copy for performance)
    - Callers must use data immediately before next operation
    - ResetBuffer() explicitly clears buffer after parsing is complete
    - Buffer clearing happens after box parsing, not during ReadFullBox
    - For mdat seeks, ResetBuffer() called after seek to avoid buffer corruption
    
    Testing:
    - Comprehensive test suite using external black-box testing (mp4_test package)
    - Tests cover streaming, callbacks, sliding windows, retention, sample access
    - All tests use public API only per project guidelines
    tobbee committed Oct 28, 2025
    Configuration menu
    Copy the full SHA
    1d446ed View commit details
    Browse the repository at this point in the history
Loading