Ocean
MFLiveVideo.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_MF_LIVE_VIDEO_H
9 #define META_OCEAN_MEDIA_MF_LIVE_VIDEO_H
10 
13 
14 #include "ocean/media/Library.h"
15 #include "ocean/media/LiveVideo.h"
16 
17 namespace Ocean
18 {
19 
20 namespace Media
21 {
22 
23 namespace MediaFoundation
24 {
25 
26 /**
27  * This class implements a MediaFoundation live video object allowing to access e.g., webcams.
28  * @ingroup mediamf
29  */
30 class OCEAN_MEDIA_MF_EXPORT MFLiveVideo :
31  public virtual MFFrameMedium,
32  public virtual LiveVideo
33 {
34  friend class MFLibrary;
35 
36  public:
37 
38  /**
39  * Returns the supported stream types.
40  * @see LiveVideo::supportedStreamTypes().
41  */
43 
44  /**
45  * Returns the supported stream configurations for a given stream type.
46  * @see supportedStreamConfigurations().
47  */
49 
50  /**
51  * Enumerates all currently available video devices.
52  * @param definitions The resulting video devices
53  * @return True, if succeeded
54  */
55  static bool enumerateVideoDevices(Library::Definitions& definitions);
56 
57  protected:
58 
59  /**
60  * Creates a new live video by a given URL.
61  * @param url The URL of the live video
62  * @param symbolicLink Optional the symbolic link of the live video, if known
63  */
64  explicit MFLiveVideo(const std::string& url, const std::string& symbolicLink);
65 
66  /**
67  * Destructs a MFLiveVideo object.
68  */
69  ~MFLiveVideo() override;
70 
71  /**
72  * Creates and builds the topology of this object.
73  * @see MFMedium::createTopology().
74  */
75  bool createTopology(const bool respectPlaybackTime) override;
76 
77  /**
78  * Creates the media source object.
79  * @see MFMedium::createTopology().
80  */
81  bool createMediaSource() override;
82 
83  /**
84  * Releases the topology.
85  */
86  void releaseTopology() override;
87 
88  protected:
89 
90  /// The symbolic link of the device.
91  std::string symbolicLink_;
92 };
93 
94 }
95 
96 }
97 
98 }
99 
100 #endif // META_OCEAN_MEDIA_MF_LIVE_VIDEO_H
std::vector< Definition > Definitions
Definition of a vector holding medium definition objects.
Definition: media/Library.h:111
This class is the base class for all live videos.
Definition: LiveVideo.h:38
StreamType
Definition of individual stream types.
Definition: LiveVideo.h:59
std::vector< StreamConfiguration > StreamConfigurations
Definition of a vector holding stream configurations.
Definition: LiveVideo.h:148
std::vector< StreamType > StreamTypes
Definition of a vector holding stream types.
Definition: LiveVideo.h:73
This is the base class for all Media Foundation frame mediums.
Definition: MFFrameMedium.h:35
This class implements the MediaFoundation library.
Definition: MFLibrary.h:30
This class implements a MediaFoundation live video object allowing to access e.g.,...
Definition: MFLiveVideo.h:33
bool createMediaSource() override
Creates the media source object.
bool createTopology(const bool respectPlaybackTime) override
Creates and builds the topology of this object.
StreamConfigurations supportedStreamConfigurations(const StreamType streamType) const override
Returns the supported stream configurations for a given stream type.
static bool enumerateVideoDevices(Library::Definitions &definitions)
Enumerates all currently available video devices.
StreamTypes supportedStreamTypes() const override
Returns the supported stream types.
void releaseTopology() override
Releases the topology.
std::string symbolicLink_
The symbolic link of the device.
Definition: MFLiveVideo.h:91
MFLiveVideo(const std::string &url, const std::string &symbolicLink)
Creates a new live video by a given URL.
~MFLiveVideo() override
Destructs a MFLiveVideo object.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15