Ocean
Loading...
Searching...
No Matches
DSFileRecorder.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_DS_FILE_RECORDER_H
9#define META_OCEAN_MEDIA_DS_FILE_RECORDER_H
10
13
15
16namespace Ocean
17{
18
19namespace Media
20{
21
22namespace DirectShow
23{
24
25/**
26 * This class implements a DirectShow file recorder.
27 * @ingroup mediads
28 */
29class OCEAN_MEDIA_DS_EXPORT DSFileRecorder :
30 virtual public DSRecorder,
31 virtual public FileRecorder
32{
33 public:
34
35 /**
36 * Sets the filename of this recorder.
37 * @see FileRecroder::setFilename().
38 */
39 bool setFilename(const std::string& filename) override;
40
41 /**
42 * Returns whether this recorder is currently recording.
43 * @see FileRecorder::isRecording().
44 */
45 bool isRecording() const override;
46
47 /**
48 * Sets the recorder.
49 * @see FileRecorder::start().
50 */
51 bool start() override;
52
53 /**
54 * Stops the recorder.
55 * @see FileRecorder::stop().
56 */
57 bool stop() override;
58
59 protected:
60
61 /**
62 * Creates a new DirectShow file recorder.
63 */
64 DSFileRecorder() = default;
65
66 /**
67 * Destructs a DirectShow file recorder.
68 */
69 ~DSFileRecorder() override;
70
71 /**
72 * Inserts an AVI MUX and file writer filter to the filter graph.
73 * The file writer filter should be connected with a MUX filter.
74 * @param outputPin Output pin of e.g. encoder filter which will be connected with the input pin of the file writer filter
75 * @return True, if succeeded
76 */
77 virtual bool insertFileWriterFilter(IPin* outputPin);
78
79 /**
80 * Releases the filter writer filter.
81 */
83
84 protected:
85
86 /// AVI MUX filter.
88
89 /// DirectShow file writer filter.
91
92 /// DirectShow file sink interface.
94};
95
96}
97
98}
99
100}
101
102#endif // META_OCEAN_MEDIA_DS_FILE_RECORDER_H
This class implements a DirectShow file recorder.
Definition DSFileRecorder.h:32
bool start() override
Sets the recorder.
virtual bool insertFileWriterFilter(IPin *outputPin)
Inserts an AVI MUX and file writer filter to the filter graph.
bool stop() override
Stops the recorder.
ScopedIBaseFilter fileWriterFilter_
DirectShow file writer filter.
Definition DSFileRecorder.h:90
bool setFilename(const std::string &filename) override
Sets the filename of this recorder.
ScopedIBaseFilter aviMuxFilter_
AVI MUX filter.
Definition DSFileRecorder.h:87
ScopedIFileSinkFilter fileSinkInterface_
DirectShow file sink interface.
Definition DSFileRecorder.h:93
bool isRecording() const override
Returns whether this recorder is currently recording.
~DSFileRecorder() override
Destructs a DirectShow file recorder.
DSFileRecorder()=default
Creates a new DirectShow file recorder.
void releaseFileWriterFilter()
Releases the filter writer filter.
This class is the base class for all DirectShow recorders.
Definition DSRecorder.h:32
This class is the base class for all file recorders.
Definition FileRecorder.h:37
This class wraps an unmanaged object (or reference) which needs to be released after usage.
Definition ScopedObject.h:166
The namespace covering the entire Ocean framework.
Definition Accessor.h:15