C++/CLI Sample
Demonstrates how to create a C++/CLI library using the VideoXpert SDK
CPPCli::Clip Class Reference

The Clip class represents a contiguous duration of stored media originating from a single DataSource. More...

#include <Clip.h>

Public Types

enum  RecordingFramerates {
  RecordingFramerates::Unknown,
  RecordingFramerates::Low,
  RecordingFramerates::Normal
}
 Values that represent the video framerate level. More...
 
enum  RecordingTypes {
  RecordingTypes::Unknown,
  RecordingTypes::Alarm,
  RecordingTypes::Analytic,
  RecordingTypes::Event,
  RecordingTypes::Manual,
  RecordingTypes::Motion,
  RecordingTypes::Timed
}
 Values that represent the type of trigger that caused the recording. More...
 
enum  RetentionPriorities {
  RetentionPriorities::Unknown,
  RetentionPriorities::Low,
  RetentionPriorities::Medium,
  RetentionPriorities::High
}
 Values that represent how long the recording device should attempt to retain the clip. More...
 

Public Member Functions

 Clip (VxSdk::IVxClip *vxClip)
 Constructor. More...
 
virtual ~Clip ()
 Destructor. More...
 
 !Clip ()
 Finaliser. More...
 
System::String^ GetSnapshotEndpoint (SnapshotFilter^ filter)
 Gets the endpoint URI for snapshots. More...
 

Package Functions

System::Collections::Generic::List< DataInterface^ >^ _GetDataInterfaces ()
 

Package Attributes

VxSdk::IVxClip_clip
 

Properties

System::Collections::Generic::List< DataInterface^ >^ DataInterfaces [get]
 Gets the data interfaces available for retrieval of the stored media this clip represents. More...
 
System::String^  DataSourceId [get]
 Gets the unique identifier of the clips data source. More...
 
System::String^  DataSourceName [get]
 Gets the friendly name of the clips data source. More...
 
System::String^  DataStorageId [get]
 Gets the unique identifier of the data storage on which the media for this clip is stored. More...
 
System::DateTime EndTime [get]
 Gets the end time of the clip. More...
 
RecordingTypes EventType [get]
 Gets the event type that triggered the recording of the clip. More...
 
RecordingFramerates Framerate [get]
 Gets the framerate of the clip. More...
 
System::String^  MediaType [get]
 Gets the type of media contained in the clip. More...
 
RetentionPriorities Priority [get]
 Gets the recording retention priority of the clip. More...
 
System::String^  SourceDataStorageId [get]
 Gets the unique identifier of the data storage on which the media for this clip was originally stored. If different than DataStorageId, indicates that this clip was copied to the data storage from another data storage. More...
 
System::DateTime StartTime [get]
 Gets the start time of the clip. More...
 

Detailed Description

The Clip class represents a contiguous duration of stored media originating from a single DataSource.

Definition at line 14 of file Clip.h.

Member Enumeration Documentation

Values that represent the video framerate level.

Enumerator
Unknown 

An error or unknown value was returned.

Low 

Low framerate.

Normal 

Normal framerate.

Definition at line 20 of file Clip.h.

20  {
22  Unknown,
23 
25  Low,
26 
28  Normal
29  };

Values that represent the type of trigger that caused the recording.

Enumerator
Unknown 

An error or unknown value was returned.

Alarm 

Hardware or software alarm.

Analytic 

Video analytic (non-motion).

Event 

General system event.

Manual 

Manual user initiation.

Motion 

Motion anayltic.

Timed 

Time-based (continuous); no event.

Definition at line 34 of file Clip.h.

34  {
36  Unknown,
37 
39  Alarm,
40 
42  Analytic,
43 
45  Event,
46 
48  Manual,
49 
51  Motion,
52 
54  Timed
55  };

Values that represent how long the recording device should attempt to retain the clip.

Enumerator
Unknown 

An error or unknown value was returned.

Low 

Low retention priority.

Medium 

Medium retention priority.

High 

High retention priority.

Definition at line 61 of file Clip.h.

61  {
63  Unknown,
64 
66  Low,
67 
69  Medium,
70 
72  High
73  };

Constructor & Destructor Documentation

CPPCli::Clip::Clip ( VxSdk::IVxClip vxClip)

Constructor.

Parameters
vxClipThe vx clip.

Definition at line 8 of file Clip.cpp.

8  {
9  _clip = vxClip;
10 }
VxSdk::IVxClip * _clip
Definition: Clip.h:200
virtual CPPCli::Clip::~Clip ( )
inlinevirtual

Destructor.

Definition at line 84 of file Clip.h.

84  {
85  this->!Clip();
86  }
Clip(VxSdk::IVxClip *vxClip)
Constructor.
Definition: Clip.cpp:8
CPPCli::Clip::!Clip ( )

Finaliser.

Definition at line 12 of file Clip.cpp.

12  {
13  _clip->Delete();
14  _clip = nullptr;
15 }
VxSdk::IVxClip * _clip
Definition: Clip.h:200
virtual VxResult::Value Delete() const =0

Member Function Documentation

List< CPPCli::DataInterface^ > CPPCli::Clip::_GetDataInterfaces ( )
package

Definition at line 17 of file Clip.cpp.

17  {
18  // Create a list of managed export objects
19  List<DataInterface^>^ mlist = gcnew List<DataInterface^>();
20  for (int i = 0; i < _clip->dataInterfaceSize; i++)
21  mlist->Add(gcnew DataInterface(_clip->dataInterfaces[i]));
22 
23  return mlist;
24 }
VxSdk::IVxClip * _clip
Definition: Clip.h:200
IVxDataInterface ** dataInterfaces
System::String CPPCli::Clip::GetSnapshotEndpoint ( SnapshotFilter filter)

Gets the endpoint URI for snapshots.

Returns
The snapshot endpoint.

Definition at line 45 of file Clip.cpp.

45  {
46  // Get the filter count
47  const int filterSize = GetFilterSize(filter);
48  // Create a VxSnapshotFilter object
49  VxSdk::VxSnapshotFilter* vxFilter;
50 
51  // If there are filters present add them to vxFilter, otherwise set it to nullptr
52  if (filterSize > 0) {
53  vxFilter = new VxSdk::VxSnapshotFilter[filterSize];
54 
55  // If a filter has been set, add the the filter item with its value
56  int filterPosition = 0;
57  if (filter->EndTime != System::DateTime::MinValue) {
58  vxFilter[filterPosition].key = VxSdk::VxSnapshotFilterItem::kEndTime;
59  VxSdk::Utilities::StrCopySafe(vxFilter[filterPosition].value, Utils::ConvertDateTimeToChar(filter->EndTime));
60  filterPosition++;
61  }
62  if (filter->StartTime != System::DateTime::MinValue) {
63  vxFilter[filterPosition].key = VxSdk::VxSnapshotFilterItem::kStartTime;
64  VxSdk::Utilities::StrCopySafe(vxFilter[filterPosition].value, Utils::ConvertDateTimeToChar(filter->StartTime));
65  filterPosition++;
66  }
67  if (filter->Offset != NULL) {
68  vxFilter[filterPosition].key = VxSdk::VxSnapshotFilterItem::kOffset;
69  VxSdk::Utilities::StrCopySafe(vxFilter[filterPosition].value, Utils::ConvertSysString(filter->Offset.ToString()));
70  filterPosition++;
71  }
72  if (filter->Width != NULL) {
73  vxFilter[filterPosition].key = VxSdk::VxSnapshotFilterItem::kWidth;
74  VxSdk::Utilities::StrCopySafe(vxFilter[filterPosition].value, Utils::ConvertSysString(filter->Width.ToString()));
75  }
76  }
77  else {
78  vxFilter = nullptr;
79  }
80 
81  char* snapshotEndpoint = nullptr;
82  int size = 0;
83 
84  // If the rtsp uri is not available on the datasource the result will return VxSdk::VxResult::kActionUnavailable,
85  // otherwise VxSdk::VxResult::kInsufficientSize
86  VxSdk::VxResult::Value result = _clip->GetSnapshotEndpoint(vxFilter, filterSize, snapshotEndpoint, size);
87  if (result == VxSdk::VxResult::kInsufficientSize) {
88  // Allocate enough space for rtspEndpoint
89  snapshotEndpoint = new char[size];
90  // The result should now be kOK since we have allocated enough space
91  _clip->GetSnapshotEndpoint(vxFilter, filterSize, snapshotEndpoint, size);
92  }
93  return gcnew System::String(snapshotEndpoint);
94 }
VxSdk::IVxClip * _clip
Definition: Clip.h:200
static void StrCopySafe(char(&dst)[dstSize], const char *src)
int GetFilterSize(CPPCli::SnapshotFilter^ filter)
Definition: Clip.cpp:26
static const char * ConvertDateTimeToChar(System::DateTime dateTime)
Convert a DateTime to a char.
Definition: Utils.h:280
virtual VxResult::Value GetSnapshotEndpoint(VxSnapshotFilter *filter, int filterSize, char *endpoint, int &size) const =0
static const char * ConvertSysString(System::String^ sysString)
Convert a system string to a char.
Definition: Utils.h:233
VxSnapshotFilterItem::Value key

Member Data Documentation

VxSdk::IVxClip* CPPCli::Clip::_clip
package

Definition at line 200 of file Clip.h.

Property Documentation

System:: Collections:: Generic:: List< DataInterface^>^ CPPCli::Clip::DataInterfaces
get

Gets the data interfaces available for retrieval of the stored media this clip represents.

A List of the data interfaces.

Definition at line 103 of file Clip.h.

System:: String^ CPPCli::Clip::DataSourceId
get

Gets the unique identifier of the clips data source.

The unique identifier.

Definition at line 112 of file Clip.h.

System:: String^ CPPCli::Clip::DataSourceName
get

Gets the friendly name of the clips data source.

The friendly name of the data source.

Definition at line 121 of file Clip.h.

System:: String^ CPPCli::Clip::DataStorageId
get

Gets the unique identifier of the data storage on which the media for this clip is stored.

The unique identifier.

Definition at line 130 of file Clip.h.

System:: DateTime CPPCli::Clip::EndTime
get

Gets the end time of the clip.

The end time.

Definition at line 139 of file Clip.h.

RecordingTypes CPPCli::Clip::EventType
get

Gets the event type that triggered the recording of the clip.

The recording event type.

Definition at line 148 of file Clip.h.

RecordingFramerates CPPCli::Clip::Framerate
get

Gets the framerate of the clip.

The framerate.

Definition at line 157 of file Clip.h.

System:: String^ CPPCli::Clip::MediaType
get

Gets the type of media contained in the clip.

The media type.

Definition at line 166 of file Clip.h.

RetentionPriorities CPPCli::Clip::Priority
get

Gets the recording retention priority of the clip.

The priority level.

Definition at line 175 of file Clip.h.

System:: String^ CPPCli::Clip::SourceDataStorageId
get

Gets the unique identifier of the data storage on which the media for this clip was originally stored. If different than DataStorageId, indicates that this clip was copied to the data storage from another data storage.

The unique identifier.

Definition at line 185 of file Clip.h.

System:: DateTime CPPCli::Clip::StartTime
get

Gets the start time of the clip.

The start time.

Definition at line 194 of file Clip.h.


The documentation for this class was generated from the following files: