Skip to content

Commit

Permalink
Added 4.14 sink API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpreussner committed Oct 25, 2016
1 parent cd3c5c5 commit 39f6a85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
42 changes: 13 additions & 29 deletions Source/VlcMedia/Private/Player/VlcMediaOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

FVlcMediaOutput::FVlcMediaOutput()
: AudioSink(nullptr)
, CaptionSink(nullptr)
, Player(nullptr)
, ResumeOrigin(0)
, ResumeTime(FTimespan::Zero())
, SubtitleSink(nullptr)
, OverlaySink(nullptr)
, VideoSink(nullptr)
{ }

Expand Down Expand Up @@ -81,38 +80,23 @@ void FVlcMediaOutput::SetAudioSink(IMediaAudioSink* Sink)
}


void FVlcMediaOutput::SetCaptionSink(IMediaStringSink* Sink)
void FVlcMediaOutput::SetOverlaySink(IMediaOverlaySink* Sink)
{
FScopeLock Lock(&CriticalSection);

if (Sink != CaptionSink)
if (Sink != OverlaySink)
{
if (CaptionSink != nullptr)
if (OverlaySink != nullptr)
{
CaptionSink->ShutdownStringSink();
OverlaySink->ShutdownOverlaySink();
}

CaptionSink = Sink;
SetupCaptionOutput();
}
}

/*
void FVlcMediaOutput::SetSubtitleSink(IMediaStringSink* Sink)
{
FScopeLock Lock(&CriticalSection);
OverlaySink = Sink;

if (Sink != SubtitleSink)
{
if (SubtitleSink != nullptr)
{
SubtitleSink->ShutdownStringSink();
}
SubtitleSink = Sink;
SetupCaptionOutput();
SetupSubtitleOutput();
}
}*/
}


void FVlcMediaOutput::SetVideoSink(IMediaTextureSink* Sink)
Expand Down Expand Up @@ -487,16 +471,16 @@ unsigned FVlcMediaOutput::StaticVideoSetupCallback(void** Opaque, char* Chroma,
Pitches[0] = *Width * 2;
}
else if ((FCStringAnsi::Stricmp(Chroma, "UYVY") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "Y422") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "UYNV") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "HDYC") == 0))
(FCStringAnsi::Stricmp(Chroma, "Y422") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "UYNV") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "HDYC") == 0))
{
SinkFormat = EMediaTextureSinkFormat::CharUYVY;
Pitches[0] = *Width * 2;
}
else if ((FCStringAnsi::Stricmp(Chroma, "YUY2") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "V422") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "YUYV") == 0))
(FCStringAnsi::Stricmp(Chroma, "V422") == 0) ||
(FCStringAnsi::Stricmp(Chroma, "YUYV") == 0))
{
SinkFormat = EMediaTextureSinkFormat::CharYUY2;
Pitches[0] = *Width * 2;
Expand Down
12 changes: 4 additions & 8 deletions Source/VlcMedia/Private/Player/VlcMediaOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class FVlcMediaOutput
//~ IMediaOutput interface

virtual void SetAudioSink(IMediaAudioSink* Sink) override;
virtual void SetCaptionSink(IMediaStringSink* Sink) override;
// virtual void SetSubtitleSink(IMediaStringSink* Sink) override;
virtual void SetOverlaySink(IMediaOverlaySink* Sink) override;
virtual void SetVideoSink(IMediaTextureSink* Sink) override;

protected:
Expand Down Expand Up @@ -117,10 +116,7 @@ class FVlcMediaOutput

/** The audio sink. */
IMediaAudioSink* AudioSink;

/** The caption text sink. */
IMediaStringSink* CaptionSink;


/** Critical section for synchronizing access to sinks. */
FCriticalSection CriticalSection;

Expand All @@ -133,8 +129,8 @@ class FVlcMediaOutput
/** The time at which playback resumed. */
FTimespan ResumeTime;

/** The subtitle sink. */
IMediaStringSink* SubtitleSink;
/** The text overlay sink. */
IMediaOverlaySink* OverlaySink;

/** Dimensions of the current video track. */
FIntPoint VideoDimensions;
Expand Down
2 changes: 1 addition & 1 deletion Source/VlcMedia/Private/VlcMediaPCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "Runtime/CoreUObject/Public/CoreUObject.h"
#include "Runtime/Media/Public/IMediaAudioSink.h"
#include "Runtime/Media/Public/IMediaOptions.h"
#include "Runtime/Media/Public/IMediaStringSink.h"
#include "Runtime/Media/Public/IMediaOverlaySink.h"
#include "Runtime/Media/Public/IMediaTextureSink.h"
#include "Runtime/Projects/Public/Interfaces/IPluginManager.h"

Expand Down

0 comments on commit 39f6a85

Please sign in to comment.