Ocean
DSLiveVideo.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_LIVE_VIDEO_H
9 #define META_OCEAN_MEDIA_DS_LIVE_VIDEO_H
10 
14 
15 #include "ocean/media/LiveVideo.h"
16 
17 namespace Ocean
18 {
19 
20 namespace Media
21 {
22 
23 namespace DirectShow
24 {
25 
26 /**
27  * This class implements a DirectShow live video object.
28  * @ingroup mediads
29  */
30 class OCEAN_MEDIA_DS_EXPORT DSLiveVideo :
31  public virtual DSFrameMedium,
32  public virtual DSLiveMedium,
33  public virtual LiveVideo
34 {
35  friend class DSLibrary;
36 
37  protected:
38 
39  /**
40  * Creates a new live video by a given url.
41  * @param url Url of the live video
42  */
43  explicit DSLiveVideo(const std::string& url);
44 
45  /**
46  * Destructs a DSLiveVideo object.
47  */
48  ~DSLiveVideo() override;
49 
50  /**
51  * @see DSGraphObject::buildGraph().
52  */
53  bool buildGraph() override;
54 
55  /**
56  * @see DSGraphObject::releaseGraph().
57  */
58  void releaseGraph() override;
59 
60  /**
61  * Creates the DirectShow video source filter.
62  * @return True, if succeeded
63  */
65 
66  /**
67  * Collects the preferred video formats.
68  * @param sortableFrameTypes Resulting frame types sorted by their popularity
69  * @return True, if succeeded
70  */
72 
73  /**
74  * Releases the DirectShow video source filter.
75  */
77 
78  /**
79  * Starts a configuration possibility.
80  * @see ConfigMedium::configuration().
81  */
82  bool configuration(const std::string& name, long long data) override;
83 
84  /**
85  * @see ConfigMedium::configs().
86  */
87  ConfigNames configs() const override;
88 
89  protected:
90 
91  /// DirectShow video source filter.
93 
94  /// DirectShow stream config interface.
96 };
97 
98 }
99 
100 }
101 
102 }
103 
104 #endif // META_OCEAN_MEDIA_DS_LIVE_VIDEO_H
std::vector< std::string > ConfigNames
Definition of a vector holding configuration names.
Definition: ConfigMedium.h:44
This is the base class for all DirectShow frame mediums.
Definition: DSFrameMedium.h:35
std::vector< DSSortableFrameType > DSSortableFrameTypes
Definition of a vector holding sortable media type objects.
Definition: DSFrameMedium.h:68
This class implements the DirectShow library.
Definition: DSLibrary.h:30
This class is the base class for all DirectShow live mediums.
Definition: DSLiveMedium.h:36
This class implements a DirectShow live video object.
Definition: DSLiveVideo.h:34
~DSLiveVideo() override
Destructs a DSLiveVideo object.
DSLiveVideo(const std::string &url)
Creates a new live video by a given url.
ScopedIBaseFilter videoSourceFilter_
DirectShow video source filter.
Definition: DSLiveVideo.h:92
ConfigNames configs() const override
bool createVideoSourceFilter()
Creates the DirectShow video source filter.
ScopedIAMStreamConfig videoSourceFilterStreamConfigInterface_
DirectShow stream config interface.
Definition: DSLiveVideo.h:95
bool configuration(const std::string &name, long long data) override
Starts a configuration possibility.
void releaseVideoSourceFilter()
Releases the DirectShow video source filter.
bool collectPreferredVideoFormats(DSSortableFrameTypes &sortableFrameTypes)
Collects the preferred video formats.
This class is the base class for all live videos.
Definition: LiveVideo.h:38
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