expand tabs
[platform/upstream/gstreamer.git] / gst / playback / gststreaminfo.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __GST_STREAMINFO_H__
22 #define __GST_STREAMINFO_H__
23
24 #include <gst/gst.h>
25
26 G_BEGIN_DECLS
27
28 #define GST_TYPE_STREAM_INFO            (gst_stream_info_get_type())
29 #define GST_STREAM_INFO(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STREAM_INFO,GstStreamInfo))
30 #define GST_STREAM_INFO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STREAM_INFO,GstStreamInfoClass))
31 #define GST_IS_STREAM_INFO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STREAM_INFO))
32 #define GST_IS_STREAM_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STREAM_INFO))
33
34 typedef struct _GstStreamInfo GstStreamInfo;
35 typedef struct _GstStreamInfoClass GstStreamInfoClass;
36
37 typedef enum {
38   GST_STREAM_TYPE_UNKNOWN = 0,
39   GST_STREAM_TYPE_AUDIO   = 1,  /* an audio stream */
40   GST_STREAM_TYPE_VIDEO   = 2,  /* a video stream */
41   GST_STREAM_TYPE_TEXT    = 3,  /* a subtitle/text stream */
42   GST_STREAM_TYPE_ELEMENT = 4,  /* stream handled by an element */
43 } GstStreamType;
44
45 struct _GstStreamInfo {
46   GObject        parent;
47
48   GstObject     *object;        /* pad/element providing/handling this stream */
49   GstStreamType  type;          /* the type of the provided stream */
50   gchar         *decoder;       /* string describing the decoder */
51   gboolean       mute;          /* is the stream muted or not */
52   GstObject     *origin;        /* the real object providing this stream, this can
53                                    be different from the object as the object can be
54                                    a queue pad, inserted for preroll. */
55   GstCaps       *caps;          /* the caps of the stream */
56
57   /* this is tream information cached here because the streaminfo may be
58    * created before the app can know about it. */
59   gchar         *langcode,
60                 *codec;
61 };
62
63 struct _GstStreamInfoClass {
64   GObjectClass   parent_class;
65
66   /* signals */
67   void (*muted) (GstStreamInfo *info, gboolean mute);
68 };
69
70 GType gst_stream_info_get_type (void);
71
72 GstStreamInfo*  gst_stream_info_new             (GstObject     *object,
73                                                  GstStreamType  type,
74                                                  const gchar   *decoder,
75                                                  const GstCaps *caps);
76
77 gboolean        gst_stream_info_set_mute        (GstStreamInfo *stream_info, 
78                                                  gboolean mute);
79 gboolean        gst_stream_info_is_mute         (GstStreamInfo *stream_info);
80
81
82 G_END_DECLS
83
84 #endif /* __GST_STREAMINFO_H__ */
85