UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VideoDecoderUtilities.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "HAL/Event.h"
8
9
10namespace AVEncoder
11{
12
13namespace DecoderUtilities
14{
15
17{
18public:
19 FEventSignal(): Event(FPlatformProcess::GetSynchEventFromPool(true))
20 { }
21
22 // Not copyable!
23 FEventSignal(const FEventSignal&) = delete;
25
31
35 void Wait()
36 {
37 Event->Wait();
38 }
39
44 {
45 Event->Wait();
46 Event->Reset();
47 }
48
52 void Signal()
53 {
54 Event->Trigger();
55 }
56
60 void Reset()
61 {
62 Event->Reset();
63 }
64
68 bool IsSignaled() const
69 {
70 return Event->Wait(0);
71 }
72
82
89 {
90 check(InMicroSeconds > 0); // 0 is forbidden. either call Wait() without timeout, or check the signal using IsSignaled()
92 {
93 Event->Reset();
94 return true;
95 }
96 return false;
97 }
98
99private:
100 mutable FEvent* Event;
101};
102
103
104} /* namespace DecoderUtilities */
105
106
107} /* namespace AVEncoder */
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
Definition VideoDecoderUtilities.h:17
bool IsSignaled() const
Definition VideoDecoderUtilities.h:68
void Signal()
Definition VideoDecoderUtilities.h:52
void Wait()
Definition VideoDecoderUtilities.h:35
FEventSignal(const FEventSignal &)=delete
void WaitAndReset()
Definition VideoDecoderUtilities.h:43
FEventSignal & operator=(const FEventSignal &)=delete
~FEventSignal()
Definition VideoDecoderUtilities.h:26
bool WaitTimeout(int64 InMicroSeconds)
Definition VideoDecoderUtilities.h:78
void Reset()
Definition VideoDecoderUtilities.h:60
bool WaitTimeoutAndReset(int64 InMicroSeconds)
Definition VideoDecoderUtilities.h:88
FEventSignal()
Definition VideoDecoderUtilities.h:19
Definition Event.h:21
virtual bool Wait(uint32 WaitTime, const bool bIgnoreThreadIdleStats=false)=0
virtual void Trigger()=0
virtual void Reset()=0
Definition AudioEncoder.cpp:7
Definition AndroidPlatformProcess.h:30
static CORE_API void ReturnSynchEventToPool(FEvent *Event)
Definition GenericPlatformProcess.cpp:589
static FTimespan FromMicroseconds(double Microseconds)
Definition Timespan.h:637