Twitch SDK (Internal)
videoframe.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 <functional>
13 
14 namespace ttv
15 {
16  namespace broadcast
17  {
18  class VideoFrame;
19  }
20 }
21 
26 {
27 public:
28  typedef std::function<void()> UnlockFunc;
29 
30 public:
31  virtual ~VideoFrame();
32 
33  void SetTimeStamp(uint64_t timeStamp) { mTimeStamp = timeStamp; }
34  uint64_t GetTimeStamp() const { return mTimeStamp; }
35 
36  void SetIsKeyFrame(bool isKeyFrame) { mIsKeyFrame = isKeyFrame; }
37  bool IsKeyFrame() const { return mIsKeyFrame; }
38 
39  void SetVerticalFlip(bool flip) { mVerticalFlip = flip; }
40  bool GetVerticalFlip() const { return mVerticalFlip; }
41 
42  void SetFrameIndex(uint32_t frameIndex) { mFrameIndex = frameIndex; }
43  uint32_t GetFrameIndex() const { return mFrameIndex; }
44 
45 
50 
51 protected:
53 
54  void SetUnlockCallback(UnlockFunc callback) { mUnlockCallback = callback; }
55 
56 private:
57  UnlockFunc mUnlockCallback;
59  uint64_t mTimeStamp;
60  uint32_t mFrameIndex;
63 };
IVideoFrameReceiver::ReceiverTypeId GetReceiverTypeId() const
Definition: videoframe.h:49
void SetUnlockCallback(UnlockFunc callback)
Definition: videoframe.h:54
bool IsKeyFrame() const
Definition: videoframe.h:37
IVideoFrameReceiver::ReceiverTypeId mReceiverTypeId
Definition: videoframe.h:58
UnlockFunc mUnlockCallback
Definition: videoframe.h:57
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
VideoFrame(IVideoFrameReceiver::ReceiverTypeId receiverTypeId)
bool GetVerticalFlip() const
Definition: videoframe.h:40
uint32_t mFrameIndex
Definition: videoframe.h:60
void SetIsKeyFrame(bool isKeyFrame)
Definition: videoframe.h:36
std::function< void()> UnlockFunc
Definition: videoframe.h:28
void SetVerticalFlip(bool flip)
Definition: videoframe.h:39
uint64_t GetTimeStamp() const
Definition: videoframe.h:34
void SetFrameIndex(uint32_t frameIndex)
Definition: videoframe.h:42
uint32_t GetFrameIndex() const
Definition: videoframe.h:43
size_t ReceiverTypeId
Definition: ivideoframereceiver.h:28
Definition: videoframe.h:25
uint64_t mTimeStamp
Definition: videoframe.h:59
void SetTimeStamp(uint64_t timeStamp)
Definition: videoframe.h:33
bool mIsKeyFrame
Definition: videoframe.h:61
bool mVerticalFlip
Definition: videoframe.h:62