Twitch SDK (Internal)
passthroughaudiocapture.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 
14 
15 #include <vector>
16 
17 
18 namespace ttv
19 {
20  class IThread;
21 
22  namespace broadcast
23  {
24  class PassThroughAudioCapture;
25  }
26 }
27 
29 {
30 public:
32  virtual ~PassThroughAudioCapture();
33 
35  TTV_ErrorCode SetNumChannels(uint32_t numChannels);
36  TTV_ErrorCode EnqueueAudioPacket(std::vector<uint8_t>&& videoPacket, uint64_t timestamp);
37 
38 public:
39  // IAudioCapture implementation
40  virtual std::string GetName() const override;
41  virtual uint32_t GetNumChannels() const override;
42  virtual TTV_ErrorCode Process(const std::shared_ptr<IAudioMixer>& mixer, uint64_t& lastSampleTime) override;
43  virtual TTV_ErrorCode Stop() override;
44 
45 private:
46  struct QueueEntry
47  {
48  std::vector<uint8_t> packet;
49  uint64_t timestamp;
50  };
51 
54  uint32_t mNumChannels;
55 };
Definition: passthroughaudiocapture.h:28
std::vector< uint8_t > packet
Definition: passthroughaudiocapture.h:48
virtual uint32_t GetNumChannels() const override
uint64_t timestamp
Definition: passthroughaudiocapture.h:49
virtual std::string GetName() const override
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
TTV_ErrorCode EnqueueAudioPacket(std::vector< uint8_t > &&videoPacket, uint64_t timestamp)
ConcurrentQueue< std::shared_ptr< QueueEntry > > mAudioPacketQueue
Definition: passthroughaudiocapture.h:52
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
Definition: audiocapturebase.h:25
Definition: passthroughaudiocapture.h:46
Definition: concurrentqueue.h:16
TTV_ErrorCode SetNumChannels(uint32_t numChannels)
uint32_t mNumChannels
Definition: passthroughaudiocapture.h:54
AudioFormat
Definition: broadcasttypes.h:166
virtual TTV_ErrorCode Process(const std::shared_ptr< IAudioMixer > &mixer, uint64_t &lastSampleTime) override
virtual TTV_ErrorCode Stop() override
AudioFormat mAudioFormat
Definition: passthroughaudiocapture.h:53
TTV_ErrorCode SetAudioFormat(AudioFormat format)