Twitch SDK (Internal)
passthroughaudioencoder.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 
13 #include <vector>
14 
15 namespace ttv
16 {
17  namespace broadcast
18  {
19  class PassThroughAudioEncoder;
20  class PassThroughAudioEncoderInternalData;
21  }
22 }
23 
24 
26 {
27 public:
29  virtual ~PassThroughAudioEncoder();
30 
32  TTV_ErrorCode SetSamplesPerFrame(uint32_t samplesPerFrame);
33 
34 public:
35  // IAudioEncoder Implementation
36  virtual std::string GetName() const override;
37  virtual TTV_ErrorCode SetFrameWriter(const std::shared_ptr<IFrameWriter>& frameWriter) override;
38  virtual TTV_ErrorCode GetAudioEncodingFormat(AudioFormat& result) override;
39  virtual TTV_ErrorCode Initialize() override;
40  virtual TTV_ErrorCode Start(uint32_t streamIndex, const AudioParams& audioParams) override;
41  virtual TTV_ErrorCode GetNumInputSamplesPerEncodeFrame(uint32_t& result) override;
42  virtual TTV_ErrorCode Stop() override;
43  virtual TTV_ErrorCode Shutdown() override;
44 
45  virtual TTV_ErrorCode SubmitFrame(const std::shared_ptr<AudioFrame>& audioFrame) override;
46  virtual bool SupportsReceiverProtocol(IAudioFrameReceiver::ReceiverTypeId typeId) const override;
47  virtual std::shared_ptr<IAudioFrameReceiver> GetReceiverImplementation(IAudioFrameReceiver::ReceiverTypeId typeId) override;
48 
49 private:
50  std::shared_ptr<PassThroughAudioEncoderInternalData> mInternalData;
51 };
virtual TTV_ErrorCode SubmitFrame(const std::shared_ptr< AudioFrame > &audioFrame) override
virtual TTV_ErrorCode Stop() override
virtual std::string GetName() const override
virtual TTV_ErrorCode Start(uint32_t streamIndex, const AudioParams &audioParams) override
virtual std::shared_ptr< IAudioFrameReceiver > GetReceiverImplementation(IAudioFrameReceiver::ReceiverTypeId typeId) override
TTV_ErrorCode SetAudioFormat(AudioFormat format)
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Definition: iaudioencoder.h:29
virtual TTV_ErrorCode GetNumInputSamplesPerEncodeFrame(uint32_t &result) override
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
bool SupportsReceiverProtocol() const
Definition: iaudioencoder.h:75
virtual TTV_ErrorCode Initialize() override
virtual TTV_ErrorCode GetAudioEncodingFormat(AudioFormat &result) override
virtual TTV_ErrorCode Shutdown() override
size_t ReceiverTypeId
Definition: iaudioframereceiver.h:28
Definition: iaudioencoder.h:45
TTV_ErrorCode SetSamplesPerFrame(uint32_t samplesPerFrame)
virtual TTV_ErrorCode SetFrameWriter(const std::shared_ptr< IFrameWriter > &frameWriter) override
Definition: passthroughaudioencoder.h:25
AudioFormat
Definition: broadcasttypes.h:166
std::shared_ptr< PassThroughAudioEncoderInternalData > mInternalData
Definition: passthroughaudioencoder.h:50