Updated VideoPlayerWidget to play new IVideo data
Added optional padding to video frames because that's what VideoPlayerWidget expects. Keeping the option to not use padding for other use-cases like converting frames to PNG.
This commit is contained in:
committed by
Matthias Mailänder
parent
ee29d0f9c7
commit
c4ab7041b8
@@ -15,15 +15,15 @@ namespace OpenRA.Video
|
||||
{
|
||||
public interface IVideoLoader
|
||||
{
|
||||
bool TryParseVideo(Stream s, out IVideo video);
|
||||
bool TryParseVideo(Stream s, bool useFramePadding, out IVideo video);
|
||||
}
|
||||
|
||||
public static class VideoLoader
|
||||
{
|
||||
public static IVideo GetVideo(Stream stream, IVideoLoader[] loaders)
|
||||
public static IVideo GetVideo(Stream stream, bool useFramePadding, IVideoLoader[] loaders)
|
||||
{
|
||||
foreach (var loader in loaders)
|
||||
if (loader.TryParseVideo(stream, out var video))
|
||||
if (loader.TryParseVideo(stream, useFramePadding, out var video))
|
||||
return video;
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user