summaryrefslogtreecommitdiff
path: root/gst-libs/gst/media-info/media-info.h
blob: 4ff6281981e374dc61f4c39c28a6208287104532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* GStreamer
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


#ifndef __GST_MEDIA_INFO_H__
#define __GST_MEDIA_INFO_H__

#include <gst/gst.h>

G_BEGIN_DECLS

typedef struct GstMediaInfoPriv		GstMediaInfoPriv;
typedef struct _GstMediaInfo            GstMediaInfo;
typedef struct _GstMediaInfoClass       GstMediaInfoClass;

struct _GstMediaInfo
{
  GObject parent;

  GstMediaInfoPriv *priv;

  GST_OBJECT_PADDING
};

struct _GstMediaInfoClass
{
  GObjectClass parent_class;

  /* signals */
  void (*media_info_signal) 		(GstMediaInfo *gst_media_info);

  GST_CLASS_PADDING
};

/* structure for "physical" stream,
 * which can contain multiple sequential ones */
typedef struct
{
  gboolean seekable;
  gchar *mime;
  gchar *path;
  GstCaps2 *caps;		/* properties of the complete bitstream */

  guint64 length_time;
  glong length_tracks;
  glong bitrate;

  GList *tracks;
} GstMediaInfoStream;

/* structure for "logical" stream or track,
 * or one of a set of sequentially muxed streams */
typedef struct
{
  GstCaps2 *metadata;		/* changeable metadata or tags */
  GstCaps2 *streaminfo;		/* codec property stuff */
  GstCaps2 *format;		/* properties of the logical stream */

  guint64 length_time;

  GList *con_streams;		/* list of concurrent streams in this
				   sequential stream */
} GstMediaInfoTrack;

typedef struct
{
  GstCaps2 *caps;		/* properties of the muxed concurrent stream */
} GstMediaInfoConcurrent;

#define GST_MEDIA_INFO_ERROR		gst_media_info_error_quark ()

#define GST_MEDIA_INFO_TYPE		(gst_media_info_get_type ())
#define GST_MEDIA_INFO(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_MEDIA_INFO_TYPE, GstMediaInfo))
#define GST_MEDIA_INFO_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_MEDIA_INFO_TYPE, GstMediaInfoClass))
#define IS_GST_MEDIA_INFO(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_MEDIA_INFO_TYPE))
#define IS_GST_MEDIA_INFO_CLASS(obj)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_MEDIA_INFO_TYPE))
#define GST_MEDIA_INFO_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_MEDIA_INFO_TYPE, GstMediaInfoClass))

#define GST_MEDIA_INFO_STREAM		1 << 1
#define GST_MEDIA_INFO_MIME		1 << 2
#define GST_MEDIA_INFO_METADATA		1 << 3
#define GST_MEDIA_INFO_STREAMINFO	1 << 4
#define GST_MEDIA_INFO_FORMAT		1 << 5
#define GST_MEDIA_INFO_ALL		((1 << 6) - 1)

GType           gst_media_info_get_type		(void);

GstMediaInfo *	gst_media_info_new		(const char *source_element);

void		gst_media_info_read_with_idler	(GstMediaInfo *media_info,
						 const char *location,
						 guint16 GST_MEDIA_INFO_FLAGS);
gboolean	gst_media_info_read_idler	(GstMediaInfo *media_info,
						 GstMediaInfoStream **streamp);
GstMediaInfoStream *
		gst_media_info_read		(GstMediaInfo *media_info,
						 const char *location,
						 guint16 GST_MEDIA_INFO_FLAGS);
gboolean	gst_media_info_read_many	(GstMediaInfo *media_info,
						 GList *locations,
						 guint16 GST_MEDIA_INFO_FLAGS,
						 GError **error);
GstCaps2 *	gst_media_info_get_next		(GstMediaInfo *media_info,
						 GError **error);
/*
 * FIXME: reset ?
gboolean	gst_media_info_write	(GstMediaInfo *media_info,
                                         const char *location,
					 GstCaps2 *media_info);
					 */

G_END_DECLS

#endif /* __GST_MEDIA_INFO_H__ */