rockbox/firmware/target/arm/s5l8702/ipod6g/vpu-6g.h
David Cormier e0136bc7f4 ipod6g: add hardware H.264 video playback
Add S5L8702 VPU-B initialization, reset, bitstream input, frame output,
and cache maintenance to the iPod 6G target. Advertise it with
HAVE_HW_H264 and append a capability-gated decoder interface to the
plugin API.

Keep MP4 parsing, AAC decode and mixer output, A/V synchronization,
playback controls, resume state, and presentation in the multi-file
h264_player plugin. The target layer exposes decoder operations only.

Accept non-fragmented MP4/M4V containing Constrained Baseline H.264
through level 3.0, up to 640x480 at 30 fps, with optional AAC-LC audio.
Validate codec configuration and all sample-table relationships before
activating the hardware.

Read MP4 tables in bulk, boost the CPU while preparing them, and report
staged loading progress so long movies do not appear to hang during
startup.

Register the viewer and document its format limits and controls. The
libm4a compatibility fixes needed by video-first containers remain in
the preceding standalone change.

Tested on an iPod Classic 6G through an isolated Rolo nightly runtime:
H.264/AAC playback and M4V startup succeeded. Normal and
isolated-runtime iPod 6G builds also complete, and git diff --check is
clean.

Change-Id: I1e96c65c7d0b4231a94f602f8052f1b26d6e4a80
2026-09-13 08:07:59 -04:00

48 lines
1.8 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
*
* S5L8702 VPU-B IRQ completion for H.264 hardware decoder.
*
* VPU-B asserts IRQ 35 (VIC1 bit 3, edge-triggered) on decode completion.
* These functions provide semaphore-based synchronous wait, replacing
* the sleep(200ms) polling approach.
*
* Copyright (C) 2025-2026 David Cormier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef VPU_6G_H
#define VPU_6G_H
#include <stdint.h>
/* Initialize VPU-B IRQ 35: setup semaphore, configure edge trigger.
* Call once before first decode. */
void vpu_irq_init(void);
/* Arm for next decode: drain stale semaphore signal, clear pending
* edge, enable IRQ 35. Call BEFORE triggering VPU decode. */
void vpu_irq_arm(void);
/* Wait for VPU decode completion. Blocks until ISR fires or timeout.
* Disables IRQ 35 after return. Returns OBJ_WAIT_TIMEDOUT on timeout,
* OBJ_WAIT_SUCCEEDED on success. */
int vpu_irq_wait(int timeout_ticks);
/* Get STATUS1 value captured by ISR during last completion. */
uint32_t vpu_irq_status1(void);
#endif /* VPU_6G_H */