Ocean
MFMovie.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_MOVIE_H
9 #define META_OCEAN_MEDIA_MF_MOVIE_H
10 
15 
16 #include "ocean/media/Movie.h"
17 
18 namespace Ocean
19 {
20 
21 namespace Media
22 {
23 
24 namespace MediaFoundation
25 {
26 
27 /**
28  * This class implements a MediaFoundation movie object.
29  * @ingroup mediamf
30  */
31 class OCEAN_MEDIA_MF_EXPORT MFMovie :
32  public virtual MFFiniteMedium,
33  public virtual MFFrameMedium,
34  public virtual MFSoundMedium,
35  public virtual Movie
36 {
37  friend class MFLibrary;
38 
39  public:
40 
41  /**
42  * Enables or disables the audio in this movie (has no effect if the movie does not have audio).
43  * @see Movie::setUseSound().
44  */
45  bool setUseSound(const bool state) override;
46 
47  /**
48  * Returns whether the sound of this movie is enabled or disabled.
49  * @see Movie::useSound().
50  */
51  bool useSound() const override;
52 
53  /**
54  * Clones this medium and returns a new independent instance of this medium.
55  * @see Medium::clone().
56  */
57  MediumRef clone() const override;
58 
59  protected:
60 
61  /**
62  * Creates a new movie by a given URL.
63  * @param url The URL of the movie
64  */
65  explicit MFMovie(const std::string& url);
66 
67  /**
68  * Destructs a MFMovie object.
69  */
70  ~MFMovie() override;
71 
72  /**
73  * Creates and builds the topology of this object.
74  * @see MFMedium::createTopology().
75  */
76  bool createTopology(const bool respectPlaybackTime) override;
77 
78  /**
79  * Releases the topology.
80  */
81  void releaseTopology() override;
82 
83  private:
84 
85  /// True, if the movie uses sound.
86  bool useSound_ = true;
87 };
88 
89 }
90 
91 }
92 
93 }
94 
95 #endif // META_OCEAN_MEDIA_MF_MOVIE_H
This class is the base class for all Media Foundation finite mediums.
Definition: MFFiniteMedium.h:34
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 movie object.
Definition: MFMovie.h:36
MFMovie(const std::string &url)
Creates a new movie by a given URL.
bool setUseSound(const bool state) override
Enables or disables the audio in this movie (has no effect if the movie does not have audio).
~MFMovie() override
Destructs a MFMovie object.
MediumRef clone() const override
Clones this medium and returns a new independent instance of this medium.
void releaseTopology() override
Releases the topology.
bool createTopology(const bool respectPlaybackTime) override
Creates and builds the topology of this object.
bool useSound() const override
Returns whether the sound of this movie is enabled or disabled.
This class is the base class for all MediaFoundation sound mediums.
Definition: MFSoundMedium.h:34
This class is the base class for all movies.
Definition: Movie.h:40
This template class implements a object reference with an internal reference counter.
Definition: base/ObjectRef.h:58
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15