-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecordingContextFactory.h
executable file
·53 lines (44 loc) · 1.37 KB
/
RecordingContextFactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* @file RecordingContextFactory.h
* @ingroup Kinect
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
* @copyright All right reserved.
*/
#ifndef __RECORDING_CONTEXT_FACTORY_H__
#define __RECORDING_CONTEXT_FACTORY_H__
#include "KinectRecording.h"
#include "RawKinectRecording.h"
class RecordingContextFactory
{
public:
enum ContextType { DummyRecContext, VideoRecContext, BodyReccontext, FaceRecContext, AudioRecContext };
static KinectRecording * CreateContextRecording(const Omiscid::SimpleString& Prefix, const Omiscid::SimpleString& _FrameType, ContextType TypeOfContext)
{
switch(TypeOfContext)
{
case DummyRecContext:
return &EmptyRecContext;
case VideoRecContext:
{
RawKinectRecording * pTmp = new RawKinectRecording();
if ( pTmp != nullptr )
{
pTmp->Init( Prefix, _FrameType );
pTmp->AllocateBuffer( 5*1024*1024 + 2 ); // Max image size, + 2 for padding if necessary
// memset( pTmp->BufferData, 0, 10*1024*1024 + 2 );
}
return pTmp;
}
default:
fprintf( stderr, "Unkown ContextType in RecordingContextFactory::CreateContextRecording\n" );
return nullptr;
}
}
static KinectRecording& GetEmptyRecContext()
{
return EmptyRecContext;
}
protected:
static KinectRecording EmptyRecContext;
};
#endif // __RECORDING_CONTEXT_FACTORY_H__