You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown nick.penwarden
#rb none
Change 3618690 on 2017/08/30 by Max.Preussner
Media: Pass-through of global timecode in tick
Change 3620659 on 2017/08/31 by Max.Preussner
WmfMedia: Added string conversion for stream marker types; updated documentation
Change 3620663 on 2017/08/31 by Max.Preussner
MediaUtils: Always queuing up media events to prevent application from interfering with player state during event callbacks
Change 3620878 on 2017/08/31 by Max.Preussner
Media: Using correct parameter for printing pointers
Change 3621327 on 2017/08/31 by Max.Preussner
Core: Added TQueue.Pop
Change 3621419 on 2017/08/31 by Chris.Babcock
Skip some mediaplayer calls if not prepared and check for completion in stopped state
#jira UE-49054
Change 3622023 on 2017/09/01 by Max.Chen
Sequencer: Fix regression where spawnables don't play because they're defined as temporary editor actors.
#jira UE-48923
Change 3622433 on 2017/09/01 by Chris.Babcock
Reorder Android media player suspend and playbackendreached events so stop is first
Change 3622568 on 2017/09/01 by Max.Chen
Media Player: Move sinks and player guid to PostInitProperties instead of PostLoad to fix issues with newly created players.
#jira UE-49160
Change 3622678 on 2017/09/01 by Max.Chen
Actor Sequence: Move runtime to plugins.
#jira UE-45752
Change 3623243 on 2017/09/01 by Max.Preussner
MfMedia: Resetting media characteristics before trying to reinitialize them
Change 3623246 on 2017/09/01 by Max.Preussner
WmfMedia: Fixed media characteristics not updated when opening media without tracks selected
#jira UE-49214
Change 3623675 on 2017/09/01 by Max.Preussner
MediaUtils: Fixed multichannel downmixing
Change 3623747 on 2017/09/01 by Max.Preussner
WmfMedia: Removed still images from list of supported streams as they require special handling that is currently not implemented
Change 3623757 on 2017/09/01 by Max.Preussner
WmfMedia: Added missing string conversion for Playing state
Change 3623793 on 2017/09/01 by Max.Chen
Sequencer: Fix ensure when deleting sections. Sections were getting removed from the array during iteration.
#jira UE-49220
Change 3623797 on 2017/09/01 by Max.Chen
Sequencer: Add transactions to easing type and setting changes.
#jira UE-49209
Change 3623924 on 2017/09/02 by Max.Preussner
Media: Renamed IMediaPlayer::GetName to GetPlayerName
Change 3623931 on 2017/09/02 by Max.Preussner
Media: Added IMediaPlayer::GetMediaName
Change 3623962 on 2017/09/02 by Max.Preussner
WmfMedia: Consistent logging format
Change 3623963 on 2017/09/02 by Max.Preussner
MfMedia: Consistent logging format
Change 3624190 on 2017/09/03 by Max.Preussner
MediaUtils: Made sink overflow log messages a compile option
Change 3624412 on 2017/09/04 by Richard.Wallis
Trivial fix for Mac Audio Mixer playback through engine using current AV implementation. This fixes up what is already there to get us back to a working Mac Media playback via engine. Although it is still disabled just in case this stream is at a time/feature critical point. Just remove the && 0 in the AUDIO_PLAYBACK_VIA_ENGINE define at the top of AvfMediaTracks.cpp.
Change 3624769 on 2017/09/04 by Max.Preussner
WmfMedia: Fixed some subtle issues with session state changes & track switching
Change 3624811 on 2017/09/04 by Max.Preussner
WmfMedia: Not compiling WMF related libraries on dedicated server
Change 3624813 on 2017/09/04 by Max.Preussner
WmfMedia: Added utility function to copy MF attributes
Change 3624941 on 2017/09/05 by Max.Chen
Sequencer: Added slip functionality for sections. Hold down shift and drag the section left and right (as if you were moving it).
#jira UE-24929
Change 3625131 on 2017/09/05 by Andrew.Rodham
Media: Fixed optional parameter name not being loaded properly for external texture uniform expressions
Change 3625547 on 2017/09/05 by Max.Preussner
AudioMixer: Fixed crash due to legacy int16 audio buffer not initialized
Change 3625569 on 2017/09/05 by Max.Chen
Cine Camera: Added GetFilmbackPresetName(), SetFilmbackPresetByName(), GetLensPresetName(), SetLensPresetByName().
#jira UE-48967
Change 3625668 on 2017/09/05 by Max.Chen
Sequence Recorder: Add drag and drop functionality to sequence recorder
#jira UE-49072
Change 3625738 on 2017/09/05 by Max.Preussner
WmfMedia: showing possible image streams that may be incorrectly returned as video streams in media info
Change 3625751 on 2017/09/05 by Max.Preussner
WmfMedia: Restarting session from beginning on track switching if media doesn't support seeking
Change 3625869 on 2017/09/05 by Andrew.Rodham
Sequencer: Fixed crash caused by manipulating selection while iterating
Change 3625884 on 2017/09/05 by Andrew.Rodham
Sequencer: Optimization pass on key and trajectory rendering when dealing with large numbers of tracks and/or keys
- Memory is reserved where possible on hot code paths
- Reduced amount of sorting and shuffling of arrays where possible
- Key collections (and thus key groups) are now cacheable so we don't have to regenerate them every frame
- Reduced amount of overdraw on keys in sequencer UI
- Added editor preference to limit the number of keys shown around the current time when rendering trajectories in the editor (default=250)
- Optimized various algorithms used for key introspection and manipulation
- Overlapping keys are now highlighted with a red border
#jira UE-42018
Change 3626270 on 2017/09/05 by Max.Preussner
WmfMedia: Added utility function to dump out media type attributes
Change 3626274 on 2017/09/05 by Max.Preussner
WmfMedia: Dumping media type attributes in very verbose debug log
Change 3626275 on 2017/09/05 by Max.Preussner
WmfMedia: Clearing pending topologies before setting new one
Change 3626440 on 2017/09/05 by Max.Preussner
WmfMedia: Resolving stream format types and interlace modes in attribute dump
Change 3626719 on 2017/09/05 by Max.Preussner
MediaAssets: Exposed the OnTracksChanged event on media player assets
Change 3626806 on 2017/09/05 by Chris.Babcock
Fix error returns from rungradle.bat and ant.bat
#jira UE-49305
Change 3626915 on 2017/09/05 by Chris.Babcock
Only use immersive mode if enabled on Android
#jira UE-49308
Change 3626980 on 2017/09/05 by Max.Preussner
MediaAssets: Renamed capture device enumeration filters from Unspecified to Unknown
Change 3627333 on 2017/09/05 by Max.Preussner
MediaUtils: Added utility functions for converting common enum values to string
Change 3627702 on 2017/09/06 by Andrew.Rodham
Sequencer: Fixed crash caused by erroneous persistent references to FSequencer
- Also added an ensure to FSequencer::Tick to ensure this doesn't happen again
#jira UE-48647
#jira UE-48383
#jira UE-47661
Change 3628000 on 2017/09/06 by Andrew.Rodham
Sequencer: Changed ensure for a message log warning
#jira UE-49245
Change 3628548 on 2017/09/06 by Max.Preussner
MediaUtils: Logging media events in player facade
Change 3629189 on 2017/09/06 by Max.Preussner
WmfMedia: Selecting default format and track when initializing media source
#jira UE-49214
Change 3629207 on 2017/09/06 by Max.Preussner
MfMedia: Selecting default format when initializing media source
Change 3629256 on 2017/09/06 by Max.Preussner
MediaUtils: Fixed sample queue count not decremented on Pop
#jira UE-49372
[CL 3631147 by Max Chen in Main branch]
168 lines
3.2 KiB
C++
168 lines
3.2 KiB
C++
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "IMediaModule.h"
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "HAL/RunnableThread.h"
|
|
#include "Misc/ScopeLock.h"
|
|
#include "Modules/ModuleManager.h"
|
|
|
|
#include "IMediaCaptureSupport.h"
|
|
#include "IMediaPlayerFactory.h"
|
|
#include "IMediaTimeSource.h"
|
|
#include "MediaClock.h"
|
|
#include "MediaTicker.h"
|
|
|
|
|
|
/**
|
|
* Implements the Media module.
|
|
*/
|
|
class FMediaModule
|
|
: public IMediaModule
|
|
{
|
|
public:
|
|
|
|
//~ IMediaModule interface
|
|
|
|
virtual const TArray<IMediaCaptureSupport*>& GetCaptureSupports() const override
|
|
{
|
|
return CaptureSupports;
|
|
}
|
|
|
|
virtual IMediaClock& GetClock() override
|
|
{
|
|
return Clock;
|
|
}
|
|
|
|
virtual const TArray<IMediaPlayerFactory*>& GetPlayerFactories() const override
|
|
{
|
|
return PlayerFactories;
|
|
}
|
|
|
|
virtual IMediaPlayerFactory* GetPlayerFactory(const FName& FactoryName) const override
|
|
{
|
|
for (IMediaPlayerFactory* Factory : PlayerFactories)
|
|
{
|
|
if (Factory->GetPlayerName() == FactoryName)
|
|
{
|
|
return Factory;
|
|
}
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
virtual IMediaTicker& GetTicker() override
|
|
{
|
|
return Ticker;
|
|
}
|
|
|
|
virtual void LockToTimecode(bool Locked) override
|
|
{
|
|
TimecodeLocked = Locked;
|
|
}
|
|
|
|
virtual void RegisterCaptureSupport(IMediaCaptureSupport& Support) override
|
|
{
|
|
CaptureSupports.AddUnique(&Support);
|
|
}
|
|
|
|
virtual void RegisterPlayerFactory(IMediaPlayerFactory& Factory) override
|
|
{
|
|
PlayerFactories.AddUnique(&Factory);
|
|
}
|
|
|
|
virtual void SetTimeSource(const TSharedPtr<IMediaTimeSource, ESPMode::ThreadSafe>& NewTimeSource) override
|
|
{
|
|
TimeSource = NewTimeSource;
|
|
}
|
|
|
|
virtual void TickPostEngine() override
|
|
{
|
|
Clock.TickFetch();
|
|
}
|
|
|
|
virtual void TickPostRender() override
|
|
{
|
|
Clock.TickOutput();
|
|
}
|
|
|
|
virtual void TickPreEngine() override
|
|
{
|
|
if (TimeSource.IsValid())
|
|
{
|
|
Clock.UpdateTimecode(TimeSource->GetTimecode(), TimecodeLocked);
|
|
}
|
|
|
|
Clock.TickInput();
|
|
}
|
|
|
|
virtual void TickPreSlate() override
|
|
{
|
|
Clock.TickRender();
|
|
}
|
|
|
|
virtual void UnregisterCaptureSupport(IMediaCaptureSupport& Support) override
|
|
{
|
|
CaptureSupports.Remove(&Support);
|
|
}
|
|
|
|
virtual void UnregisterPlayerFactory(IMediaPlayerFactory& Factory) override
|
|
{
|
|
PlayerFactories.Remove(&Factory);
|
|
}
|
|
|
|
public:
|
|
|
|
//~ IModuleInterface interface
|
|
|
|
virtual void StartupModule() override
|
|
{
|
|
TickerThread = FRunnableThread::Create(&Ticker, TEXT("FMediaTicker"));
|
|
}
|
|
|
|
virtual void ShutdownModule() override
|
|
{
|
|
TickerThread->Kill(true);
|
|
delete TickerThread;
|
|
TickerThread = nullptr;
|
|
|
|
CaptureSupports.Reset();
|
|
PlayerFactories.Reset();
|
|
}
|
|
|
|
virtual bool SupportsDynamicReloading() override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
private:
|
|
|
|
/** The registered capture device support objects. */
|
|
TArray<IMediaCaptureSupport*> CaptureSupports;
|
|
|
|
/** The media clock. */
|
|
FMediaClock Clock;
|
|
|
|
/** Time code of the current frame. */
|
|
FTimespan CurrentTimecode;
|
|
|
|
/** The registered video player factories. */
|
|
TArray<IMediaPlayerFactory*> PlayerFactories;
|
|
|
|
/** High-frequency ticker runnable. */
|
|
FMediaTicker Ticker;
|
|
|
|
/** High-frequency ticker thread. */
|
|
FRunnableThread* TickerThread;
|
|
|
|
/** Whether media objects should lock to the media clock's time code. */
|
|
bool TimecodeLocked;
|
|
|
|
/** The media clock's time source. */
|
|
TSharedPtr<IMediaTimeSource, ESPMode::ThreadSafe> TimeSource;
|
|
};
|
|
|
|
|
|
IMPLEMENT_MODULE(FMediaModule, Media);
|