| 1 |
/* gstreamermm - a C++ wrapper for gstreamer |
| 2 |
* |
| 3 |
* Copyright 2011-2016 The gstreamermm Development Team |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free |
| 17 |
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <gstreamermm/miniobject.h> |
| 21 |
#include <gstreamermm/clock.h> |
| 22 |
|
| 23 |
_DEFS(gstreamermm,gst) |
| 24 |
|
| 25 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 26 |
typedef struct _GstDiscovererInfo GstDiscovererInfo; |
| 27 |
typedef GObjectClass GstDiscovererInfoClass; |
| 28 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 29 |
|
| 30 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 31 |
typedef struct _GstDiscovererStreamInfo GstDiscovererStreamInfo; |
| 32 |
typedef GObjectClass GstDiscovererStreamInfoClass; |
| 33 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 34 |
|
| 35 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 36 |
typedef struct _GstDiscovererContainerInfo GstDiscovererContainerInfo; |
| 37 |
typedef GObjectClass GstDiscovererContainerInfoClass; |
| 38 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 39 |
|
| 40 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 41 |
typedef struct _GstDiscovererAudioInfo GstDiscovererAudioInfo; |
| 42 |
typedef GObjectClass GstDiscovererAudioInfoClass; |
| 43 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 44 |
|
| 45 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 46 |
typedef struct _GstDiscovererVideoInfo GstDiscovererVideoInfo; |
| 47 |
typedef GObjectClass GstDiscovererVideoInfoClass; |
| 48 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 49 |
|
| 50 |
namespace Gst |
| 51 |
{ |
| 52 |
|
| 53 |
_WRAP_ENUM(DiscovererResult, GstDiscovererResult) |
| 54 |
_WRAP_ENUM(DiscovererSerializeFlags, GstDiscovererSerializeFlags) |
| 55 |
|
| 56 |
class Caps; |
| 57 |
class DiscovererStreamInfo; |
| 58 |
class Structure; |
| 59 |
class TagList; |
| 60 |
class Toc; |
| 61 |
|
| 62 |
/** DiscovererInfo - Class containing the information of a URI analyzed by |
| 63 |
* Gst::Discoverer. |
| 64 |
*/ |
| 65 |
class DiscovererInfo : public MiniObject |
| 66 |
{ |
| 67 |
_CLASS_OPAQUE_REFCOUNTED(DiscovererInfo, GstDiscovererInfo, gst_discoverer_info_new, g_object_ref, gst_discoverer_info_unref) |
| 68 |
_STRUCT_NOT_HIDDEN |
| 69 |
|
| 70 |
public: |
| 71 |
_WRAP_METHOD(Glib::RefPtr<Gst::DiscovererInfo> copy() const, gst_discoverer_info_copy) |
| 72 |
|
| 73 |
_WRAP_METHOD(ClockTime get_duration() const, gst_discoverer_info_get_duration) |
| 74 |
#m4 _CONVERSION(`const GstStructure*', `Structure', `Glib::wrap(const_cast<GstStructure*>($3), true)') |
| 75 |
|
| 76 |
_WRAP_METHOD(Structure get_misc() const, gst_discoverer_info_get_misc) |
| 77 |
_WRAP_METHOD(DiscovererResult get_result() const, gst_discoverer_info_get_result) |
| 78 |
|
| 79 |
_WRAP_METHOD(Glib::RefPtr<Gst::DiscovererStreamInfo> get_stream_info(), gst_discoverer_info_get_stream_info) |
| 80 |
_WRAP_METHOD(Glib::RefPtr<const Gst::DiscovererStreamInfo> get_stream_info() const, gst_discoverer_info_get_stream_info, constversion) |
| 81 |
|
| 82 |
#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> >', `Glib::ListHandler< Glib::RefPtr<Gst::DiscovererStreamInfo> >::list_to_vector(const_cast<GList*>($3), Glib::OWNERSHIP_DEEP)') |
| 83 |
#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> >', `Glib::ListHandler< Glib::RefPtr<const Gst::DiscovererStreamInfo> >::list_to_vector(const_cast<GList*>($3), Glib::OWNERSHIP_DEEP)') |
| 84 |
|
| 85 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_stream_list(), gst_discoverer_info_get_stream_list) |
| 86 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_stream_list() const, gst_discoverer_info_get_stream_list) |
| 87 |
|
| 88 |
#m4 _CONVERSION(`const GstTagList*',`Gst::TagList',`Glib::wrap_taglist(const_cast<GstTagList*>($3), true)') |
| 89 |
|
| 90 |
_WRAP_METHOD(Gst::TagList get_tags() const, gst_discoverer_info_get_tags) |
| 91 |
|
| 92 |
_WRAP_METHOD(Glib::ustring get_uri() const, gst_discoverer_info_get_uri) |
| 93 |
_WRAP_METHOD(bool get_seekable() const, gst_discoverer_info_get_seekable) |
| 94 |
|
| 95 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_audio_streams(), gst_discoverer_info_get_audio_streams) |
| 96 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_audio_streams() const, gst_discoverer_info_get_audio_streams) |
| 97 |
|
| 98 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_container_streams(), gst_discoverer_info_get_container_streams) |
| 99 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_container_streams() const, gst_discoverer_info_get_container_streams) |
| 100 |
|
| 101 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_streams(GType streamtype), gst_discoverer_info_get_streams) |
| 102 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_streams(GType streamtype) const, gst_discoverer_info_get_streams) |
| 103 |
|
| 104 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_video_streams(), gst_discoverer_info_get_video_streams) |
| 105 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_video_streams() const, gst_discoverer_info_get_video_streams) |
| 106 |
|
| 107 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_subtitle_streams(), gst_discoverer_info_get_subtitle_streams) |
| 108 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_subtitle_streams() const, gst_discoverer_info_get_subtitle_streams) |
| 109 |
|
| 110 |
#m4 _CONVERSION(`const gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)') |
| 111 |
_WRAP_METHOD(std::vector<Glib::ustring> get_missing_elements_installer_details() const, gst_discoverer_info_get_missing_elements_installer_details) |
| 112 |
|
| 113 |
_WRAP_METHOD(Glib::RefPtr<const Gst::Toc> get_toc() const, gst_discoverer_info_get_toc) |
| 114 |
}; |
| 115 |
|
| 116 |
/** DiscovererStreamInfo - Base class for information concerning a media |
| 117 |
* stream. |
| 118 |
* Depending on the stream type, one can find more media-specific information |
| 119 |
* in Gst::DiscovererAudioInfo, Gst::DiscovererVideoInfo, and |
| 120 |
* Gst::DiscovererContainerInfo. |
| 121 |
* |
| 122 |
* The Gst::DiscovererStreamInfo represents the topology of the stream. |
| 123 |
* Siblings can be iterated over with get_next() and get_previous(). Children |
| 124 |
* (sub-streams) of a stream can be accessed using the |
| 125 |
* Gst::DiscovererContainerInfo API. |
| 126 |
* |
| 127 |
* As a simple example, if you run Gst::Discoverer on an AVI file with one |
| 128 |
* audio and one video stream, you will get a Gst::DiscovererContainerInfo |
| 129 |
* corresponding to the AVI container, which in turn will have a |
| 130 |
* Gst::DiscovererAudioInfo sub-stream and a Gst::DiscovererVideoInfo |
| 131 |
* sub-stream for the audio and video streams respectively. |
| 132 |
*/ |
| 133 |
class DiscovererStreamInfo : public MiniObject |
| 134 |
{ |
| 135 |
_CLASS_OPAQUE_REFCOUNTED(DiscovererStreamInfo, GstDiscovererStreamInfo, NONE, gst_discoverer_stream_info_ref, gst_discoverer_stream_info_unref) |
| 136 |
_STRUCT_NOT_HIDDEN |
| 137 |
|
| 138 |
public: |
| 139 |
_WRAP_METHOD(Glib::RefPtr<Gst::Caps> get_caps(), gst_discoverer_stream_info_get_caps) |
| 140 |
_WRAP_METHOD(Glib::RefPtr<const Gst::Caps> get_caps() const, gst_discoverer_stream_info_get_caps, constversion) |
| 141 |
|
| 142 |
_WRAP_METHOD(Structure get_misc() const, gst_discoverer_stream_info_get_misc) |
| 143 |
|
| 144 |
_WRAP_METHOD(Glib::RefPtr<Gst::DiscovererStreamInfo> get_next(), gst_discoverer_stream_info_get_next) |
| 145 |
_WRAP_METHOD(Glib::RefPtr<const Gst::DiscovererStreamInfo> get_next() const, gst_discoverer_stream_info_get_next, constversion) |
| 146 |
|
| 147 |
_WRAP_METHOD(Glib::RefPtr<Gst::DiscovererStreamInfo> get_previous(), gst_discoverer_stream_info_get_previous) |
| 148 |
_WRAP_METHOD(Glib::RefPtr<Gst::DiscovererStreamInfo> get_previous() const, gst_discoverer_stream_info_get_previous, constversion) |
| 149 |
|
| 150 |
_WRAP_METHOD(Gst::TagList get_tags() const, gst_discoverer_stream_info_get_tags) |
| 151 |
|
| 152 |
_WRAP_METHOD(Glib::ustring get_stream_type_nick() const, gst_discoverer_stream_info_get_stream_type_nick) |
| 153 |
_WRAP_METHOD(Glib::ustring get_stream_id() const, gst_discoverer_stream_info_get_stream_id) |
| 154 |
|
| 155 |
_WRAP_METHOD(Glib::RefPtr<const Gst::Toc> get_toc() const, gst_discoverer_stream_info_get_toc) |
| 156 |
}; |
| 157 |
|
| 158 |
/** DiscovererContainerInfo - Gst::DiscovererStreamInfo specific to container |
| 159 |
* streams. |
| 160 |
*/ |
| 161 |
class DiscovererContainerInfo : public DiscovererStreamInfo |
| 162 |
{ |
| 163 |
_CLASS_OPAQUE_REFCOUNTED(DiscovererContainerInfo, GstDiscovererContainerInfo, NONE, gst_discoverer_stream_info_ref, gst_discoverer_stream_info_unref) |
| 164 |
_STRUCT_NOT_HIDDEN |
| 165 |
|
| 166 |
public: |
| 167 |
_WRAP_METHOD(std::vector< Glib::RefPtr<Gst::DiscovererStreamInfo> > get_streams(), gst_discoverer_container_info_get_streams) |
| 168 |
_WRAP_METHOD(std::vector< Glib::RefPtr<const Gst::DiscovererStreamInfo> > get_streams() const, gst_discoverer_container_info_get_streams) |
| 169 |
}; |
| 170 |
|
| 171 |
|
| 172 |
/** DiscovererAudioInfo - Gst::DiscovererStreamInfo specific to audio streams. |
| 173 |
*/ |
| 174 |
class DiscovererAudioInfo : public DiscovererStreamInfo |
| 175 |
{ |
| 176 |
_CLASS_OPAQUE_REFCOUNTED(DiscovererAudioInfo, GstDiscovererAudioInfo, NONE, gst_discoverer_stream_info_ref, gst_discoverer_stream_info_unref) |
| 177 |
_STRUCT_NOT_HIDDEN |
| 178 |
|
| 179 |
public: |
| 180 |
_WRAP_METHOD(guint get_bitrate() const, gst_discoverer_audio_info_get_bitrate) |
| 181 |
_WRAP_METHOD(guint get_channels() const, gst_discoverer_audio_info_get_channels) |
| 182 |
_WRAP_METHOD(guint get_depth() const, gst_discoverer_audio_info_get_depth) |
| 183 |
_WRAP_METHOD(guint get_max_bitrate() const, gst_discoverer_audio_info_get_max_bitrate) |
| 184 |
_WRAP_METHOD(guint get_sample_rate() const, gst_discoverer_audio_info_get_sample_rate) |
| 185 |
_WRAP_METHOD(Glib::ustring get_language() const, gst_discoverer_audio_info_get_language) |
| 186 |
}; |
| 187 |
|
| 188 |
/** DiscovererVideoInfo - Gst::DiscovererStreamInfo specific to video streams |
| 189 |
* (this includes images). |
| 190 |
*/ |
| 191 |
class DiscovererVideoInfo : public DiscovererStreamInfo |
| 192 |
{ |
| 193 |
_CLASS_OPAQUE_REFCOUNTED(DiscovererVideoInfo, GstDiscovererVideoInfo, NONE, gst_discoverer_stream_info_ref, gst_discoverer_stream_info_unref) |
| 194 |
_STRUCT_NOT_HIDDEN |
| 195 |
|
| 196 |
public: |
| 197 |
_WRAP_METHOD(guint get_bitrate() const, gst_discoverer_video_info_get_bitrate) |
| 198 |
_WRAP_METHOD(guint get_depth() const, gst_discoverer_video_info_get_depth) |
| 199 |
_WRAP_METHOD(guint get_framerate_denom() const, gst_discoverer_video_info_get_framerate_denom) |
| 200 |
_WRAP_METHOD(guint get_framerate_num() const, gst_discoverer_video_info_get_framerate_num) |
| 201 |
_WRAP_METHOD(guint get_height() const, gst_discoverer_video_info_get_height) |
| 202 |
_WRAP_METHOD(bool is_interlaced() const, gst_discoverer_video_info_is_interlaced) |
| 203 |
_WRAP_METHOD(bool is_image() const, gst_discoverer_video_info_is_image) |
| 204 |
_WRAP_METHOD(guint get_max_bitrate() const, gst_discoverer_video_info_get_max_bitrate) |
| 205 |
_WRAP_METHOD(guint get_par_denom() const, gst_discoverer_video_info_get_par_denom) |
| 206 |
_WRAP_METHOD(guint get_par_num() const, gst_discoverer_video_info_get_par_num) |
| 207 |
_WRAP_METHOD(guint get_width() const, gst_discoverer_video_info_get_width) |
| 208 |
}; |
| 209 |
|
| 210 |
} //namespace Gst |