Open Reality Reference Guide
fbvideo.h
Go to the documentation of this file.
1 #ifndef __FBVIDEO_H__
2 #define __FBVIDEO_H__
3 /**************************************************************************
4 Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6 
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12 
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16 
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25 
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
48 #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbsdk/fbcomponent.h>
52 #include <fbsdk/fbcore.h>
53 
54 #ifdef FBSDKUseNamespace
55 namespace FBSDKNamespace {
56 #endif
57 
59  FB_DEFINE_COMPONENT( FBSDK_DLL, VideoIn );
60  FB_DEFINE_COMPONENT( FBSDK_DLL, VideoOut );
61  FB_DEFINE_COMPONENT( FBSDK_DLL, VideoClip );
62  FB_DEFINE_COMPONENT( FBSDK_DLL, VideoClipImage );
63  FB_DEFINE_COMPONENT( FBSDK_DLL, VideoClipImageDDS );
64  FB_DEFINE_COMPONENT( FBSDK_DLL, VideoSwitcher );
65 
70 #define FBVideoDeclare( ClassName, Parent ) \
71  FBClassDeclare( ClassName,Parent ); \
72 public: \
73  ClassName(const char* pName):Parent(pName) { FBClassInit; } \
74 private:
75 
79 #define FBVideoImplementation( ThisComponent ) \
80  FBClassImplementation( ThisComponent )
81 
83  // FBVideo
87 
93  };
94 
100  };
101 
109  };
110 
113  kFBVideoFormat_Any,
114  kFBVideoFormat_Other,
115  kFBVideoFormat_RGBA_32,
116  kFBVideoFormat_RGB_24,
117  kFBVideoFormat_BGRA_32,
118  kFBVideoFormat_BGR_24,
119  kFBVideoFormat_BGR_16,
120  kFBVideoFormat_ABGR_32,
121  kFBVideoFormat_ARGB_32,
122  kFBVideoFormat_422
123  };
124 
127  {
128  kFBVideo_RES_FULL = 0,
129  kFBVideo_RES_1,
130  kFBVideo_RES_2,
131  kFBVideo_RES_4,
132  kFBVideo_RES_8,
133  kFBVideo_RES_16,
134  kFBVideo_RES_32,
135  kFBVideo_RES_64,
136  kFBVideo_RES_128,
137  kFBVideo_RES_256,
138  kFBVideo_RES_512,
139  kFBVideo_RES_1K,
140  kFBVideo_RES_2K,
141  kFBVideo_RES_4K,
142  kFBVideo_RES_8K,
143  kFBVideo_RES_16K
144  };
145 
146  FB_DEFINE_ENUM( FBSDK_DLL, TimeMode );
147  FB_DEFINE_ENUM( FBSDK_DLL, VideoProxyMode );
148  FB_DEFINE_ENUM( FBSDK_DLL, VideoStorageMode );
149  FB_DEFINE_ENUM( FBSDK_DLL, VideoInterlaceMode );
150  FB_DEFINE_ENUM( FBSDK_DLL, VideoFormat );
151  FB_DEFINE_ENUM( FBSDK_DLL, VideoResolution );
152 
154  // FBVideo
156 
172  class FBSDK_DLL FBVideo : public FBBox {
174  public:
182  FBVideo(const char* pName, HIObject pObject=NULL);
183 
185  };
186 
188  // FBVideoClip
190 
192  class FBSDK_DLL FBVideoClip : public FBVideo {
194  public:
202  FBVideoClip(const char* pName, HIObject pObject=NULL);
203 
204  virtual void FBDelete() override;
205 
209  bool IsValid();
210 
211  //--- Video (generic) properties.
214  FBPropertyVideoProxyMode ProxyMode;
215  FBPropertyVideoStorageMode StorageMode;
220  FBPropertyVideoInterlaceMode InterlaceMode;
221  FBPropertyVideoFormat Format;
222 
223  //--- Video (clip) properties
231 
237 
239 
247  virtual void DrawImage(int pX = 0, int pY = 0, int pW = -1, int pH = -1, int pFrame = -1);
248 
253  virtual unsigned char* GetImage(int pFrame = -1 );
254 
257  virtual void ImageIncUpdateID();
258 
262  virtual unsigned char* GetPowerOfTwoImage();
263 
268 
274  virtual bool GetEmbeddedTimecode( int pFrame, FBTimeCode& pTimeCode );
275  };
276 
278  // FBVideoClipImage
281 
285  public:
290  FBVideoClipImage(const char* pName, HIObject pObject=NULL);
291 
300  FBPropertyVideoResolution MaxMipMapResolution;
301  };
302 
304  // FBVideoClipImageDDS
307 
311  public:
316  FBVideoClipImageDDS( const char* pName, HIObject pObject = nullptr );
317  };
318 
320  // FBVideoMemory
323 
332  class FBSDK_DLL FBVideoMemory : public FBVideo {
334  public:
339  FBVideoMemory(const char* pName, HIObject pObject=NULL);
340 
345  virtual void SetObjectImageSize(int pW,int pH);
346 
348  };
349 
351  // FBVideoIn
354 
359  };
360 
362  class FBSDK_DLL FBVideoIn : public FBVideo {
364  public:
368  FBVideoIn(HIObject pObject=NULL);
369 
374 
379  virtual bool LiveSetCompressor(int pCompressorIndex);
380 
384  virtual int LiveGetCompressor();
385 
389  virtual int LiveGetCompressorCount();
390 
394  virtual const char* LiveGetCompressorName(int pCompressorIndex);
395 
399  virtual void LiveSetResolutionFR(int pIndex);
400 
404  virtual int LiveGetResolutionFR();
405 
410 
415  virtual const char* LiveGetResolutionFRName(int pIndex);
416 
421  };
422 
424  // FBVideoOut
427 
429  class FBSDK_DLL FBVideoOut : public FBVideo {
431  public:
435  FBVideoOut(HIObject pObject=NULL);
437  };
438 
439 
441  // FBVideoSwitcher
445 
447  enum FBClipEnd {
450  };
452  enum FBPlayMode {
458  };
459 
460  FB_DEFINE_ENUM( FBSDK_DLL, ClipEnd );
461  FB_DEFINE_ENUM( FBSDK_DLL, PlayMode );
462 
465  {
466  public:
470  FBEventVideoSwitcher( HKEventBase pEvent );
471 
472  FBPropertyVideoSwitcher VideoSwitcher;
474  FBPropertyClipEnd EndType;
475  };
476 
479  {
481  public:
486  FBVideoSwitcher( const char* pName = NULL, HIObject pObject = NULL );
487 
490  virtual void ResetVideoSwitcher();
493  virtual void FinishCurrentVideo();
496  virtual void PrepareNextFrame();
500  virtual void SwapCurrent( FBVideo* pVideo );
505  virtual void SetNextClip( FBVideo* pVideo, FBPlayMode pMode );
506 
509  virtual bool IsSDKSwitcher();
510 
512  FBPropertyPlayMode PlayMode;
514 
515  FBPropertyVideo CurrentVideo;
517  FBPropertyDevice DeviceOwner;
519  };
520 
522  // FBPropertyListVideoClip
526  {
527  public:
533  FBVideoClip* operator[](int pIndex);
534  };
535 
537  // FBPropertyListVideoIn
541  {
542  public:
548  FBVideoIn* operator[](int pIndex);
549  };
550 
552  // FBPropertyListVideoOut
556  {
557  public:
563  FBVideoOut* operator[](int pIndex);
564  };
565 
566 #ifdef FBSDKUseNamespace
567 }
568 #endif
569 #endif
A box is a fundamental building block in the application architecture.
Definition: fbcore.h:218
Base Event class.
Definition: fbcomponent.h:940
Video switcher callback event.
Definition: fbvideo.h:465
FBEventVideoSwitcher(HKEventBase pEvent)
Constructor.
FBPropertykReference Reference
Read Only Property: Data.
Definition: fbvideo.h:473
FBPropertyVideoSwitcher VideoSwitcher
Read Only Property: Video switcher.
Definition: fbvideo.h:472
FBPropertyClipEnd EndType
Read Only Property: Clip end action.
Definition: fbvideo.h:474
PropertyEvent: Base event class.
Definition: fbproperties.h:515
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:536
PropertyList: VideoClip
Definition: fbvideo.h:526
FBVideoClip * operator[](int pIndex)
Get the video at pIndex.
PropertyList: VideoIn
Definition: fbvideo.h:541
FBVideoIn * operator[](int pIndex)
Get the video at pIndex.
PropertyList: VideoOut
Definition: fbvideo.h:556
FBVideoOut * operator[](int pIndex)
Get the video at pIndex.
Property class: const char * (String).
TimeCode data structure.
Definition: fbtime.h:282
Video clip media class.
Definition: fbvideo.h:192
FBPropertyVideoProxyMode ProxyMode
Read Write Property: Proxy mode.
Definition: fbvideo.h:214
FBPropertyVideoFormat Format
Read Only Property: Video format.
Definition: fbvideo.h:221
FBPropertyInt CurrentFrame
Read Write Property: Current frame.
Definition: fbvideo.h:233
FBPropertyTime LastFrameTime
Read Only Property: Time of last frame
Definition: fbvideo.h:235
virtual bool GetEmbeddedTimecode(int pFrame, FBTimeCode &pTimeCode)
Get the embedded timecode associated to a video clip frame.
FBPropertyInt Height
Read Only Property: Height of image.
Definition: fbvideo.h:217
virtual void FBDelete() override
Open Reality deletion function.
FBPropertyTime FrameTime
Read Only Property: Inverse of FPS, time per frame
Definition: fbvideo.h:232
FBPropertyBool Loop
Read Write Property: Loop video clip?
Definition: fbvideo.h:230
FBPropertyTime CurrentFrameTimeCode
Read Only Property: Embedded timecode from current frame in clip. Use the method GetEmbeddedTimecode ...
Definition: fbvideo.h:238
FBPropertyDouble PlaySpeed
Read Write Property: Playback speed.
Definition: fbvideo.h:228
FBPropertyInt StopFrame
Read Write Property: Frame to end video playback at.
Definition: fbvideo.h:226
FBPropertyTime TimeOffset
Read Write Property: Temporal offset for beginning of video.
Definition: fbvideo.h:224
FBVideoClip(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyBool FreeRunning
Read Write Property: Is free Running on?
Definition: fbvideo.h:229
FBPropertyString RelativePath
Read Only Property: Relative path of media.
Definition: fbvideo.h:213
virtual unsigned char * GetPowerOfTwoImage()
Get the current image buffer resized with width and height power of two.
int GetTextureID()
Get the texture ID.
bool IsValid()
Verifies the validity of the FBVideo object.
FBPropertyVideoStorageMode StorageMode
Read Write Property: Storage mode.
Definition: fbvideo.h:215
FBPropertyInt PowerOfTwoHeight
Read Only Property: Closest power of two value superior to height of image.
Definition: fbvideo.h:219
FBPropertyInt LastFrame
Read Only Property: Last frame in clip.
Definition: fbvideo.h:234
FBPropertyInt PowerOfTwoWidth
Read Only Property: Closest power of two value superior to width of image.
Definition: fbvideo.h:218
FBPropertyDouble FrameRate
Read Write Property: Frame rate.
Definition: fbvideo.h:227
virtual void DrawImage(int pX=0, int pY=0, int pW=-1, int pH=-1, int pFrame=-1)
Draw a frame of the image to the current view.
FBPropertyString Filename
Read Write Property: Filename of media.
Definition: fbvideo.h:212
FBPropertyInt Width
Read Only Property: Width of image.
Definition: fbvideo.h:216
FBPropertyInt StartFrame
Read Write Property: Frame to begin video playback from.
Definition: fbvideo.h:225
virtual unsigned char * GetImage(int pFrame=-1)
Get the current image buffer.
virtual void ImageIncUpdateID()
Increase Image update id after modification to trigger internal state refresh.
FBPropertyVideoInterlaceMode InterlaceMode
Read Write Property: Interlace mode.
Definition: fbvideo.h:220
FBPropertyTime CurrentFrameTime
Read Write Property: Current time in clip.
Definition: fbvideo.h:236
Video clip image media class for DDS images.
Definition: fbvideo.h:309
FBVideoClipImageDDS(const char *pName, HIObject pObject=nullptr)
Constructor.
Video clip image media class. Used for a variety of image types. For DDS images, use the FBVideoClipI...
Definition: fbvideo.h:283
FBVideoClipImage(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyVideoResolution MaxMipMapResolution
Read Write Property: Maximum MipMap resolution will be loaded into GPU.
Definition: fbvideo.h:300
FBPropertyBool ImageSequence
Read Write Property: Clip is an image sequence?
Definition: fbvideo.h:298
FBPropertyBool UseSystemFrameRate
Read Write Property: Clip is using system frame rate?
Definition: fbvideo.h:299
Video media class.
Definition: fbvideo.h:172
FBPropertyBool KeepOnGPU
Read Write Property: Don't auto flush from GPU if true. session runtime flag, won't be saved.
Definition: fbvideo.h:184
FBVideo(const char *pName, HIObject pObject=NULL)
Constructor.
Basic video input class, supporting webcam and DV device.
Definition: fbvideo.h:362
FBPropertyString FilePath
Read Write Property: Location of the generated movie file after a recording session.
Definition: fbvideo.h:373
FBPropertyBool Recording
Read Write Property: If true, the device will record during a recording session.
Definition: fbvideo.h:371
virtual void LiveSetResolutionFR(int pIndex)
Set the current resolution and frame rate for the device.
virtual int LiveGetCompressor()
Get the current compressor index.
virtual bool LiveSetCompressor(int pCompressorIndex)
Set the current compressor to be used when recording.
virtual FBVideoLiveType LiveGetType()
Get the type of the video input device.
FBPropertyBool RecordAudio
Read Write Property: If true, the device will also record audio during a recording session.
Definition: fbvideo.h:372
virtual int LiveGetResolutionFRCount()
Get the number of resolution and frame rate available for the device.
virtual const char * LiveGetCompressorName(int pCompressorIndex)
Get the compressor name at a particular index.
virtual const char * LiveGetResolutionFRName(int pIndex)
Get the resolution and frame rate string description at the specified index.
virtual int LiveGetResolutionFR()
Get the current resolution and frame rate index.
FBVideoIn(HIObject pObject=NULL)
Constructor.
virtual int LiveGetCompressorCount()
Get the compressor count.
FBPropertyBool Online
Read Write Property: If true, the device is online and will display the current video feed.
Definition: fbvideo.h:370
FBVideoMemory allow external media source (which can't be supported by MoBu natively)
Definition: fbvideo.h:332
virtual void SetObjectImageSize(int pW, int pH)
Set image size to allow MoBu preview texture with proper dimension / aspect.
FBVideoMemory(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyInt TextureOGLId
Read Write Property: OpenGL texture buffer object id (GL_TEXTURE_2D type).
Definition: fbvideo.h:347
Video media class.
Definition: fbvideo.h:429
FBVideoOut(HIObject pObject=NULL)
Constructor.
FBPropertyBool Online
Read Write Property: If true, the device is online and will output display.
Definition: fbvideo.h:436
Video Switcher class.
Definition: fbvideo.h:479
FBPropertyInt CurrentFrame
Read Write Property: Current frame.
Definition: fbvideo.h:511
virtual void PrepareNextFrame()
Prepare the next frame.
virtual void SwapCurrent(FBVideo *pVideo)
Swap the current video.
virtual void ResetVideoSwitcher()
Reset the video switcher (clear all clips).
FBPropertyEvent OnClipEnd
Event: Clip end event.
Definition: fbvideo.h:516
FBPropertyVideo CurrentVideo
Read Only Property: Current video.
Definition: fbvideo.h:515
FBVideoSwitcher(const char *pName=NULL, HIObject pObject=NULL)
Constructor.
FBPropertyPlayMode PlayMode
Read Write Property: Current play mode.
Definition: fbvideo.h:512
FBPropertyDevice DeviceOwner
Read Write Property: Hook onto owner device.
Definition: fbvideo.h:517
virtual void FinishCurrentVideo()
Finish the current video.
virtual void SetNextClip(FBVideo *pVideo, FBPlayMode pMode)
Set the next clip.
FBPropertyBool UsingSystemTime
Read Write Property: Using the system time?
Definition: fbvideo.h:518
FBPropertyTime TimeRemaining
Read Only Property: Time remaining.
Definition: fbvideo.h:513
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
Contains definitions for devices, boxes and models.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
class K_DLLIMPORT FBPropertyBase< kReference, kFBPT_kReference > FBPropertykReference
Property: kReference
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:150
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbvideo.h:48
FBVideoInterlaceMode
Video interlace modes.
Definition: fbvideo.h:103
@ kFBVideoInterlaceHalfFrameOdd
Half frame (odd field).
Definition: fbvideo.h:106
@ kFBVideoInterlaceNone
No interacling.
Definition: fbvideo.h:104
@ kFBVideoInterlaceFullFrameEven
Full frame (even field).
Definition: fbvideo.h:107
@ kFBVideoInterlaceFullFrameOdd
Full frame (odd field).
Definition: fbvideo.h:108
@ kFBVideoInterlaceHalfFrameEven
Half frame (even field).
Definition: fbvideo.h:105
FBClipEnd
Clip end actions.
Definition: fbvideo.h:447
@ kFBClipEndLoop
On clip end loop clip.
Definition: fbvideo.h:449
@ kFBClipEndEnd
On clip end stop clip.
Definition: fbvideo.h:448
FBPlayMode
Play modes.
Definition: fbvideo.h:452
@ kFBPlayModeNoPlay
No play (most common).
Definition: fbvideo.h:453
@ kFBPlayModePlayToEnd
Play clip to end.
Definition: fbvideo.h:457
@ kFBPlayModeLoop
Loop clip.
Definition: fbvideo.h:456
@ kFBPlayModePreviewToEnd
Preview clip until end.
Definition: fbvideo.h:454
@ kFBPlayModePlay
Play clip.
Definition: fbvideo.h:455
FBVideoProxyMode
Video proxy modes.
Definition: fbvideo.h:89
@ kFBVideoProxyOnPlay
Video proxy on play.
Definition: fbvideo.h:91
@ kFBVideoProxyAlways
Always video proxy.
Definition: fbvideo.h:92
@ kFBVideoProxyNone
No video proxy.
Definition: fbvideo.h:90
FBVideoStorageMode
Video storage modes.
Definition: fbvideo.h:96
@ kFBVideoStorageDiskAsync
Storage on disk async access.
Definition: fbvideo.h:99
@ kFBVideoStorageDisk
Storage on disk.
Definition: fbvideo.h:97
@ kFBVideoStorageMemory
Storage in memory.
Definition: fbvideo.h:98
FBVideoLiveType
Video Live type.
Definition: fbvideo.h:356
@ kFBVideoLiveDefault
Generic video input, type not specified.
Definition: fbvideo.h:357
@ kFBVideoLiveBasic
Basic video input, like webcam and dv camera.
Definition: fbvideo.h:358
FBVideoFormat
Video color modes.
Definition: fbvideo.h:112
FBVideoResolution
Video Resolution (1D)
Definition: fbvideo.h:127