AMF + NVENC control and support

This commit is contained in:
KingKDot
2026-07-11 14:55:26 -05:00
parent 62cd920936
commit 424ed348e3
31 changed files with 761 additions and 35 deletions
+5 -2
View File
@@ -5,7 +5,10 @@ import (
"sync/atomic"
)
const inputMarker uintptr = 0x00D5E7B00B5
// Keep the full marker on 64-bit builds and let the runtime conversion retain
// its low 32 bits on 32-bit builds. dwExtraInfo is pointer-sized, so the sender
// and the low-level hooks observe the same value on either architecture.
var inputMarkerValue uint64 = 0x00D5E7B00B5
type Manager struct {
mu sync.Mutex
@@ -51,4 +54,4 @@ func (m *Manager) Disable() {
func Start() error { return Get().Enable() }
func Stop() { Get().Disable() }
func IsEnabled() bool { return Get().IsEnabled() }
func InputMarker() uintptr { return inputMarker }
func InputMarker() uintptr { return uintptr(inputMarkerValue) }
@@ -0,0 +1,19 @@
package privacy
import (
"strconv"
"testing"
)
func TestInputMarkerFitsPointerWidth(t *testing.T) {
marker := InputMarker()
if marker == 0 {
t.Fatal("input marker must not be zero")
}
if strconv.IntSize == 32 && uint64(marker) != inputMarkerValue&0xffffffff {
t.Fatalf("32-bit marker = %#x, want low bits %#x", marker, inputMarkerValue&0xffffffff)
}
if strconv.IntSize == 64 && uint64(marker) != inputMarkerValue {
t.Fatalf("64-bit marker = %#x, want %#x", marker, inputMarkerValue)
}
}