Commit Graph

21 Commits

Author SHA1 Message Date
Stu
20c4b5d177 Harden drag handler: check data/text and recover 2025-12-13 22:37:27 -05:00
Stu
5cd4c22764 Fix IdleAdd return handling 2025-12-13 22:35:54 -05:00
Stu
aac6d6eb95 Guard meta update idle callback to avoid panic 2025-12-13 22:35:00 -05:00
Stu
32434dbc28 Guard drag handler with recover and nil checks 2025-12-13 22:33:56 -05:00
Stu
fdb0f44fa7 Fix drag target setup crash (require non-empty target list) 2025-12-13 22:32:35 -05:00
Stu
6fc4d80e6c Use TargetEntry drag setup for GTK draw area 2025-12-13 22:31:30 -05:00
Stu
2239c5cf3a Fix drag URI handling to prevent crash 2025-12-13 22:30:37 -05:00
Stu
93bd8a1424 Fix TargetEntryNew return handling 2025-12-13 22:25:50 -05:00
Stu
4d33e1ec71 Fix drag targets and force X11 backend for embedded mpv 2025-12-13 22:24:07 -05:00
Stu
bec66816df Fix drag target setup for gtkplayer 2025-12-13 22:22:33 -05:00
Stu
aba4d14f57 GTK/mpv embed: fix locale, add CSS theme, drag-and-drop support 2025-12-13 22:21:44 -05:00
Stu
19c3d1e3ad Handle GetWindow error return for mpv embed 2025-12-13 21:48:16 -05:00
Stu
2e4b433f01 Rewrite gtkplayer entry cleanly 2025-12-13 21:46:59 -05:00
Stu
a4653dd116 Fix GetWindow return handling 2025-12-13 21:45:25 -05:00
Stu
1c40324cd6 Simplify GTK window retrieval for mpv embed 2025-12-13 21:44:19 -05:00
Stu
bab96baee8 Handle gdk window retrieval without boolean conversion 2025-12-13 21:42:35 -05:00
Stu
e3305ce80c Fix Gtk window checks for mpv embed 2025-12-13 21:41:48 -05:00
Stu
08e0da1d45 Fix GTK window handle calls for mpv embed 2025-12-13 21:40:04 -05:00
Stu
ba1db9e16f Fix GTK/mpv player build issues (imports, window ID, polling) 2025-12-13 21:39:04 -05:00
Stu
26c48ab981 Vendor gotk3, add mpv cgo wrapper, and GTK mpv player stub 2025-12-13 18:58:03 -05:00
1618558314 Implement keyframe detection system (Commit 4)
Core implementation:
- Create internal/keyframe package with detector.go
- Implement DetectKeyframes() using ffprobe packet flags
- Use 'K' flag in packet data to identify I-frames
- Binary search for FindNearestKeyframe() (before/after/nearest)
- EstimateFrameNumber() for frame calculations

Caching system:
- Save/load keyframe index to ~/.cache/vt_player/keyframes/
- Binary format: ~12 bytes per keyframe (~3KB for 4min video)
- Cache key based on file path + modification time
- Auto-invalidation when file changes
- DetectKeyframesWithCache() for automatic cache management

Performance:
- 265 keyframes detected in 0.60s for 4min video (441 kf/sec)
- FindNearestKeyframe: 67ns per lookup (binary search)
- Memory: ~3KB cache per video
- Exceeds target: <5s for 1-hour video

Integration:
- Add KeyframeIndex field to videoSource
- EnsureKeyframeIndex() method for lazy loading
- Ready for frame-accurate navigation features

Testing:
- Comprehensive unit tests (all passing)
- Benchmark tests for search performance
- cmd/test_keyframes utility for validation
- Tested on real video files

Prepares for Commits 5-10:
- Frame-by-frame navigation (Commit 5)
- Keyframe jump controls (Commit 5)
- Timeline with keyframe markers (Commit 6-7)
- In/out point marking (Commit 8)
- Lossless cut export (Commit 9-10)

References: DEV_SPEC Phase 2 (lines 54-119)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 14:11:45 -05:00