Ocean
Loading...
Searching...
No Matches
Recorder.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_MEDIA_RECORDER_H
9#define META_OCEAN_MEDIA_RECORDER_H
10
11#include "ocean/media/Media.h"
12
14
15#include <vector>
16
17namespace Ocean
18{
19
20namespace Media
21{
22
23// Forward declaration.
24class Recorder;
25
26/**
27 * Definition of a object reference holding recorder objects.
28 * @ingroup media
29 */
31
32/**
33 * This class is the base class for all recorder.
34 * @ingroup media
35 */
36class OCEAN_MEDIA_EXPORT Recorder
37{
38 friend class ObjectRef<Recorder>;
39
40 public:
41
42 /**
43 * Definition of different recorder types.
44 */
45 enum Type
46 {
47 /// Simple recorder.
48 RECORDER = 0,
49 /// Frame recorder.
50 FRAME_RECORDER = 1,
51 /// Sound recorder.
52 SOUND_RECORDER = 2,
53 /// Explicit recorder.
54 EXPLICIT_RECORDER = 4,
55 /// Implicit recorder.
56 IMPLICIT_RECORDER = 8,
57 /// File recorder.
58 FILE_RECORDER = 16 | EXPLICIT_RECORDER,
59 /// Buffer recorder.
60 BUFFER_RECORDER = 32 | EXPLICIT_RECORDER,
61 /// Streaming recorder.
62 STREAMING_RECORDER = 64 | IMPLICIT_RECORDER,
63 /// Movie recorder.
64 MOVIE_RECORDER = 128 | FRAME_RECORDER | FILE_RECORDER,
65 /// Frame streaming recorder.
66 FRAME_STREAMING_RECORDER = 256 | FRAME_RECORDER | STREAMING_RECORDER,
67 /// Image recorder.
68 IMAGE_RECORDER = 512 | FRAME_RECORDER | FILE_RECORDER,
69 /// Buffer image recorder.
70 BUFFER_IMAGE_RECORDER = 1024 | FRAME_RECORDER | BUFFER_RECORDER,
71 /// Image sequence recorder.
72 IMAGE_SEQUENCE_RECORDER = 2048 | FRAME_RECORDER | FILE_RECORDER,
73 /// Frame memory recorder.
74 FRAME_MEMORY_RECORDER = 4096 | FRAME_RECORDER
75 };
76
77 /**
78 * Definition of a vector holding encoder names.
79 */
80 typedef std::vector<std::string> Encoders;
81
82 public:
83
84 /**
85 * Returns whether this recorder is currently recording.
86 * @return True, if so
87 */
88 virtual bool isRecording() const = 0;
89
90 /**
91 * Returns the type of this recorder.
92 * @return Recorder type
93 */
94 inline Type type() const;
95
96 protected:
97
98 /**
99 * Creates a new recorder.
100 */
102
103 /**
104 * Destructs a recorder.
105 */
106 virtual ~Recorder();
107
108 protected:
109
110 /// Type of this recorder.
112
113 /// Lock of this recorder.
115};
116
118{
119 return recorderType;
120}
121
122}
123
124}
125
126#endif // META_OCEAN_MEDIA_RECORDER_H
This class implements a recursive lock object.
Definition Lock.h:31
This class is the base class for all recorder.
Definition Recorder.h:37
Recorder()
Creates a new recorder.
virtual bool isRecording() const =0
Returns whether this recorder is currently recording.
Lock recorderLock
Lock of this recorder.
Definition Recorder.h:114
virtual ~Recorder()
Destructs a recorder.
Type type() const
Returns the type of this recorder.
Definition Recorder.h:117
Type
Definition of different recorder types.
Definition Recorder.h:46
std::vector< std::string > Encoders
Definition of a vector holding encoder names.
Definition Recorder.h:80
Type recorderType
Type of this recorder.
Definition Recorder.h:111
This template class implements a object reference with an internal reference counter.
Definition base/ObjectRef.h:58
Ocean::ObjectRef< Recorder > RecorderRef
Definition of a object reference holding recorder objects.
Definition Recorder.h:30
The namespace covering the entire Ocean framework.
Definition Accessor.h:15