Base class for video encoders. 更多...
#include <AVEncoder.h>
Public 成员函数 | |
| virtual bool | CopyTexture (FTexture2DRHIRef Texture, FTimespan CaptureTs, FTimespan Duration, FBufferId &OutBufferId, FIntPoint Resolution={0, 0})=0 |
| Copy the specified texture to an internal buffer. 更多... | |
| virtual void | Drop (FBufferId BufferId)=0 |
| Drops an internal buffer that was returned by CopyTexture. 更多... | |
| virtual void | Encode (FBufferId BufferId, bool bForceKeyFrame, uint32 Bitrate=0, TUniquePtr< AVEncoder::FEncoderVideoFrameCookie > Cookie=nullptr)=0 |
| Initiates the encoding of the given buffer. 更多... | |
| virtual FVideoEncoderConfig | GetConfig () const =0 |
| Return the current configuration | |
| virtual const TCHAR * | GetName () const =0 |
| Returns the name of the encoder. 更多... | |
| virtual const TCHAR * | GetType () const =0 |
| Returns just the codec type. 更多... | |
| virtual bool | Initialize (const FVideoEncoderConfig &Config)=0 |
| Initialize the encoder with the specified initial configuration | |
| virtual void | RegisterListener (IVideoEncoderListener &Listener) |
| Register/Unregister listeners. 更多... | |
| virtual bool | SetParameter (const FString &Parameter, const FString &Value)=0 |
| Allows setting encoder parameters not exposed through FVideoEncoderConfig fields. 更多... | |
| virtual void | Shutdown ()=0 |
| Shutdown MUST be called before destroying the encoder | |
Base class for video encoders.
|
pure virtual |
Copy the specified texture to an internal buffer.
This is a bit awkward, but it's somewhat required to account for how webrtc works (for PixelStreaming), where encoding a frame is a two step process : 1st - CopyTexture initiates a copy if the texture to the internal buffers, and returns an Id the caller can use to reference that internal buffer. 2nd - Either a Drop or Encode is required for each CopyTexture call, otherwise the respective internal buffer will stay
| Texture | Texture to copy |
| CaptureTs | Capture timestamp |
| Duration | Delta time from the previous frame |
| OutBufferId | Buffer id on return |
| Resolution | If {0,0}, the copy will be the same size as the passed texture. If not {0,0}, it will use that specified resolution marked as used. |
|
pure virtual |
Drops an internal buffer that was returned by CopyTexture.
This should be used with the application decides that it doesn't want to encode a frame that was already passed to CopyTexture. Once this is called on a valid buffer, do not use it again.
| BufferId | Buffer returned by a CopyTexture call |
|
pure virtual |
Initiates the encoding of the given buffer.
Once this is called on a valid buffer, do not use it again.
| BufferId | Buffer returned by a CopyTexture call |
| bForceKeyFrame | Force this frame to be encoded as a key frame |
| Bitrate | Target bitrate at the moment this frame is sent to the encoder. This allows tweaking bitrate at runtime |
| Cookie | Allows storing custom per-frame state if the application needs it. This is returned back to the application when it receives the encoded frame. |
|
pure virtual |
Returns the name of the encoder.
This normally specifies the codec, and sdk/hardware. E.g : "h264.nvenc", or "h264.amf"
|
pure virtual |
Returns just the codec type.
E.g: "h264"
|
virtual |
Register/Unregister listeners.
Most likely, you only need 1 listener per encoder, but supported several is needed due to some PixelStreaming peculiarities.
|
pure virtual |
Allows setting encoder parameters not exposed through FVideoEncoderConfig fields.
What parameters are valid are encoder dependent. See FVideoEncoderConfig::Options for examples