Ocean
Loading...
Searching...
No Matches
DSMedium.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_MEDIUM_H
9#define META_OCEAN_MEDIA_DS_MEDIUM_H
10
13
14#include "ocean/media/Medium.h"
15
16DISABLE_WARNINGS_BEGIN
17 #include <Dshow.h>
18DISABLE_WARNINGS_END
19
20namespace Ocean
21{
22
23namespace Media
24{
25
26namespace DirectShow
27{
28
29/**
30 * This is the base class for all direct show mediums.
31 * @ingroup mediads
32 */
33class OCEAN_MEDIA_DS_EXPORT DSMedium :
34 virtual public DSGraphObject,
35 virtual public Medium
36{
37 public:
38
39 /**
40 * Returns whether the medium is started currently.
41 * @see Medium::isStarted().
42 */
43 bool isStarted() const override;
44
45 /**
46 * Returns the start timestamp.
47 * @see FiniteMedium::startTimestamp().
48 */
49 Timestamp startTimestamp() const override;
50
51 /**
52 * Returns the pause timestamp.
53 * @see FiniteMedium::pauseTimestamp().
54 */
55 Timestamp pauseTimestamp() const override;
56
57 /**
58 * Returns the stop timestamp.
59 * @see FiniteMedium::stopTimestamp().
60 */
61 Timestamp stopTimestamp() const override;
62
63 protected:
64
65 /**
66 * Creates a new medium by a given url.
67 * @param url Url of the medium
68 */
69 explicit DSMedium(const std::string& url);
70
71 /**
72 * Starts the medium.
73 * @see Medium::start().
74 */
75 bool start() override;
76
77 /**
78 * Pauses the medium.
79 * @see Medium::pause().
80 */
81 bool pause() override;
82
83 /**
84 * Stops the medium.
85 * @see Medium::stop().
86 */
87 bool stop() override;
88
89 /**
90 * Specifies whether the media playback time will be respected or whether the media content will be provided as fast as possible.
91 * @param respectPlaybackTime True, to deliver the media content based on the presentation time; False, to ignore the presentation clock and to deliver the media content as fast as possible
92 */
93 virtual bool setRespectPlaybackTime(const bool respectPlaybackTime);
94
95 protected:
96
97 /// Start timestamp.
99
100 /// Pause timestamp.
102
103 /// Stop timestamp.
105};
106
107}
108
109}
110
111}
112
113#endif // META_OCEAN_MEDIA_DS_MEDIUM_H
DSGraphObject()=default
Creates a new DSGraphObject element.
Timestamp startTimestamp_
Start timestamp.
Definition DSMedium.h:98
bool stop() override
Stops the medium.
virtual bool setRespectPlaybackTime(const bool respectPlaybackTime)
Specifies whether the media playback time will be respected or whether the media content will be prov...
Timestamp stopTimestamp_
Stop timestamp.
Definition DSMedium.h:104
DSMedium(const std::string &url)
Creates a new medium by a given url.
Timestamp startTimestamp() const override
Returns the start timestamp.
bool start() override
Starts the medium.
bool isStarted() const override
Returns whether the medium is started currently.
Timestamp pauseTimestamp_
Pause timestamp.
Definition DSMedium.h:101
Timestamp pauseTimestamp() const override
Returns the pause timestamp.
Timestamp stopTimestamp() const override
Returns the stop timestamp.
bool pause() override
Pauses the medium.
Medium(const Medium &medium)=delete
Disabled copy constructor.
const std::string & url() const
Returns the url of the medium.
Definition Medium.h:236
This class implements a timestamp.
Definition Timestamp.h:64
Namespace of the Media DirectShow library.
Definition DirectShow.h:24
Namespace of the Media library.
Definition AAudio.h:26
The namespace covering the entire Ocean framework.
Definition Accessor.h:15