Add synchronized MPEG movie audio
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using Age.Engine.Sys4;
|
||||
|
||||
internal readonly record struct MovieAudioInfo(int SampleRate, int Channels);
|
||||
internal sealed record MovieAudioChunk(float[] InterleavedStereo, int FrameCount, long PresentationTimeMs);
|
||||
|
||||
/// <summary>
|
||||
/// Platform-neutral movie playback boundary. Construction is synchronous so metadata needed by the VM is
|
||||
/// available before op 0x236 returns; frame delivery and completion remain asynchronous.
|
||||
@@ -12,15 +14,18 @@ internal interface IMovieDecoder : IDisposable
|
||||
bool IsCompleted { get; }
|
||||
string? Failure { get; }
|
||||
bool TryTakeFrame(out RgbaImage frame);
|
||||
MovieAudioInfo? AudioInfo => null;
|
||||
bool AudioDecodingCompleted => true;
|
||||
bool TryTakeAudioChunk(out MovieAudioChunk chunk)
|
||||
{
|
||||
chunk = default!;
|
||||
return false;
|
||||
}
|
||||
void AdvancePlaybackClock(long elapsedMilliseconds) { }
|
||||
void MarkAudioSubmitted() { }
|
||||
}
|
||||
|
||||
internal interface IMovieDecoderFactory
|
||||
{
|
||||
IMovieDecoder Open(MoviePayload movie);
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
internal sealed class DirectShowMovieDecoderFactory : IMovieDecoderFactory
|
||||
{
|
||||
public IMovieDecoder Open(MoviePayload movie) => new DirectShowMovieDecoder(movie);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user