Debian Codegraph @

libs/gst/base/gsttypefindhelper.h

raw
1 /* GStreamer
2 * Copyright (C) 1999,2000 Erik Walthinsen <[email protected]>
3 * Copyright (C) 2000,2005 Wim Taymans <[email protected]>
4 * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
5 *
6 * gsttypefindhelper.h:
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24 #ifndef __GST_TYPEFINDHELPER_H__
25 #define __GST_TYPEFINDHELPER_H__
26
27 #include <gst/gst.h>
28 #include <gst/base/base-prelude.h>
29
30 G_BEGIN_DECLS
31
32 typedef struct _GstTypeFindData GstTypeFindData;
33
34 GstTypeFindData * gst_type_find_data_new (GstObject * obj,
35 const guint8 * data, gsize size);
36 GstCaps * gst_type_find_data_get_caps (GstTypeFindData * data) G_GNUC_WARN_UNUSED_RESULT;
37 GstTypeFindProbability gst_type_find_data_get_probability (GstTypeFindData * data);
38 GstTypeFind * gst_type_find_data_get_typefind (GstTypeFindData * data) G_GNUC_WARN_UNUSED_RESULT;
39 void gst_type_find_data_free (GstTypeFindData * data);
40
41 GST_BASE_API
42 GstCaps * gst_type_find_helper (GstPad *src, guint64 size);
43
44 GST_BASE_API
45 GstCaps * gst_type_find_helper_for_data (GstObject *obj,
46 const guint8 *data,
47 gsize size,
48 GstTypeFindProbability *prob);
49
50 GST_BASE_API
51 GstCaps * gst_type_find_helper_for_data_with_extension (GstObject *obj,
52 const guint8 *data,
53 gsize size,
54 const gchar *extension,
55 GstTypeFindProbability *prob);
56
57 GST_BASE_API
58 GstCaps * gst_type_find_helper_for_data_with_caps (GstObject *obj,
59 const guint8 *data,
60 gsize size,
61 GstCaps *caps,
62 GstTypeFindProbability *prob);
63
64 GST_BASE_API
65 GstCaps * gst_type_find_helper_for_buffer (GstObject *obj,
66 GstBuffer *buf,
67 GstTypeFindProbability *prob);
68
69 GST_BASE_API
70 GstCaps * gst_type_find_helper_for_buffer_with_extension (GstObject *obj,
71 GstBuffer *buf,
72 const gchar *extension,
73 GstTypeFindProbability *prob);
74
75 GST_BASE_API
76 GstCaps * gst_type_find_helper_for_buffer_with_caps (GstObject *obj,
77 GstBuffer *buf,
78 GstCaps *caps,
79 GstTypeFindProbability *prob);
80
81 GST_BASE_API
82 GstCaps * gst_type_find_helper_for_extension (GstObject * obj,
83 const gchar * extension);
84
85 GST_BASE_API
86 GList * gst_type_find_list_factories_for_caps (GstObject * obj,
87 GstCaps * caps);
88
89 /**
90 * GstTypeFindHelperGetRangeFunction:
91 * @obj: a #GstObject that will handle the getrange request
92 * @parent: (allow-none): the parent of @obj or %NULL
93 * @offset: the offset of the range
94 * @length: the length of the range
95 * @buffer: (out): a memory location to hold the result buffer
96 *
97 * This function will be called by gst_type_find_helper_get_range() when
98 * typefinding functions request to peek at the data of a stream at certain
99 * offsets. If this function returns GST_FLOW_OK, the result buffer will be
100 * stored in @buffer. The contents of @buffer is invalid for any other
101 * return value.
102 *
103 * This function is supposed to behave exactly like a #GstPadGetRangeFunction.
104 *
105 * Returns: GST_FLOW_OK for success
106 */
107 typedef GstFlowReturn (*GstTypeFindHelperGetRangeFunction) (GstObject *obj,
108 GstObject *parent,
109 guint64 offset,
110 guint length,
111 GstBuffer **buffer);
112 GST_BASE_API
113 GstCaps * gst_type_find_helper_get_range (GstObject *obj,
114 GstObject *parent,
115 GstTypeFindHelperGetRangeFunction func,
116 guint64 size,
117 const gchar *extension,
118 GstTypeFindProbability *prob);
119
120 GST_BASE_API
121 GstFlowReturn gst_type_find_helper_get_range_full (GstObject *obj,
122 GstObject *parent,
123 GstTypeFindHelperGetRangeFunction func,
124 guint64 size,
125 const gchar *extension,
126 GstCaps **caps,
127 GstTypeFindProbability *prob);
128
129 G_END_DECLS
130
131 #endif /* __GST_TYPEFINDHELPER_H__ */