Twitch SDK (Internal)
intelvideoencoder.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
12 #include <vector>
13 #include <memory>
14 
15 namespace ttv
16 {
17  namespace broadcast
18  {
19  class IFrameWriter;
20  class IntelVideoEncoder;
21  class IntelVideoEncoderInternalData;
22  struct Packet;
23  }
24 }
25 
26 
28 {
29 public:
31  virtual ~IntelVideoEncoder();
32 
33 public:
34  // IVideoEncoder
35  virtual std::string GetName() const override;
36  virtual bool SupportsBitRateAdjustment() const override;
37  virtual TTV_ErrorCode SetFrameWriter(const std::shared_ptr<IFrameWriter>& frameWriter) override;
38  virtual TTV_ErrorCode ValidateVideoParams(const VideoParams& videoParams) const override;
39  virtual TTV_ErrorCode Initialize() override;
40  virtual TTV_ErrorCode Shutdown() override;
41  virtual TTV_ErrorCode Start(uint32_t streamIndex, const VideoParams& videoParams) override;
42  virtual TTV_ErrorCode SubmitFrame(const std::shared_ptr<VideoFrame>& videoFrame) override;
43  virtual TTV_ErrorCode Stop() override;
44  virtual TTV_ErrorCode GetSpsPps(std::vector<uint8_t>& sps, std::vector<uint8_t>& pps) override;
45  virtual TTV_ErrorCode ValidateFrame(const std::shared_ptr<VideoFrame>& videoframe) override;
46  virtual TTV_ErrorCode SetTargetBitRate(uint32_t kbps) override;
47  virtual bool SupportsReceiverProtocol(IVideoFrameReceiver::ReceiverTypeId typeId) const override;
48  virtual std::shared_ptr<IVideoFrameReceiver> GetReceiverImplementation(IVideoFrameReceiver::ReceiverTypeId typeId) override;
49 
50 private:
51  void FlushFrames();
52  void InternalStop();
53  void SetupEncoderParams(const VideoParams& videoParams);
54  void DestroyEncodeTaskPool();
55 
56 private:
57  std::shared_ptr<IntelVideoEncoderInternalData> mInternalData;
58 };
virtual TTV_ErrorCode Initialize() override
bool SupportsReceiverProtocol() const
Definition: ivideoencoder.h:100
virtual TTV_ErrorCode Shutdown() override
virtual TTV_ErrorCode Stop() override
virtual TTV_ErrorCode SetFrameWriter(const std::shared_ptr< IFrameWriter > &frameWriter) override
Definition: intelvideoencoder.h:27
std::shared_ptr< IntelVideoEncoderInternalData > mInternalData
Definition: intelvideoencoder.h:57
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
virtual std::string GetName() const override
virtual TTV_ErrorCode ValidateVideoParams(const VideoParams &videoParams) const override
void SetupEncoderParams(const VideoParams &videoParams)
Definition: broadcasttypes.h:80
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
virtual std::shared_ptr< IVideoFrameReceiver > GetReceiverImplementation(IVideoFrameReceiver::ReceiverTypeId typeId) override
Definition: ivideoencoder.h:40
virtual TTV_ErrorCode ValidateFrame(const std::shared_ptr< VideoFrame > &videoframe) override
virtual TTV_ErrorCode Start(uint32_t streamIndex, const VideoParams &videoParams) override
virtual TTV_ErrorCode SetTargetBitRate(uint32_t kbps) override
virtual TTV_ErrorCode GetSpsPps(std::vector< uint8_t > &sps, std::vector< uint8_t > &pps) override
virtual TTV_ErrorCode SubmitFrame(const std::shared_ptr< VideoFrame > &videoFrame) override
virtual bool SupportsBitRateAdjustment() const override
size_t ReceiverTypeId
Definition: ivideoframereceiver.h:28