Fix streaming pipeline: timestamps, buffer release, resolution, orientation

- Fix encoder PTS: use wall-clock relative timestamps to prevent backward
  jumps when transitioning from standby to game frames (MediaCodec drops)
- Suppress standby frames while game is active (500ms timeout) to prevent
  flickering between game video and color bars
- Remove standby color bar pattern, use plain dark background
- Fix vertical flip and BGR→RGB swizzle in composition base pass shader
- Pass buffer index through native pipeline for pool slot release callback
- Start engine for already-LIVE plans when APP_STREAMING mode is active
- Use texture pool dimensions for encoder resolution instead of hardcoded 1920x1080
This commit is contained in:
2026-03-01 14:33:57 +01:00
parent c632e22033
commit ef221ca132
7 changed files with 181 additions and 50 deletions

View File

@@ -155,7 +155,19 @@ class LckControlService : Service() {
override fun startStreamPlan(planId: String): Boolean = runBlocking {
val plan = streamPlanRepository.getPlan(planId) ?: return@runBlocking false
if (plan.status == "LIVE") return@runBlocking true
if (plan.status == "LIVE") {
// Plan already LIVE — ensure streaming engine is running for APP_STREAMING
if (plan.executionMode == "APP_STREAMING" && !streamingManager.isStreaming()) {
Log.d(TAG, "startStreamPlan: plan already LIVE but engine not running, starting engine")
streamingManager.startStreaming(
plan = plan,
config = StreamingConfig(),
width = 1920,
height = 1080,
)
}
return@runBlocking true
}
if (plan.status != "READY") return@runBlocking false
try {
streamPlanRepository.startPlan(planId)
@@ -278,6 +290,11 @@ class LckControlService : Service() {
)
}
}
// Forward buffer release events to AIDL callbacks
streamingManager.onBufferReleased = { bufferIndex ->
streamingServiceImpl?.broadcastBufferReleased(bufferIndex)
}
}
override fun onBind(intent: Intent?): IBinder? {