summaryrefslogtreecommitdiffstats
path: root/gst/mpegdemux/gstmpegdesc.c
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2008-10-08 15:25:24 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-10-08 15:25:24 +0000
commitf6aeac78682cf50372612b368747eabc008d13a8 (patch)
treef90b0f951fc117c647becf5e45ff22fe61985f95 /gst/mpegdemux/gstmpegdesc.c
parent8aea40af0b39499ef68524e932c8ebe4b12b404f (diff)
downloadgst-plugins-bad-f6aeac78682cf50372612b368747eabc008d13a8.tar.gz
gst-plugins-bad-f6aeac78682cf50372612b368747eabc008d13a8.tar.bz2
gst-plugins-bad-f6aeac78682cf50372612b368747eabc008d13a8.zip
Move of mpegtsparse to mpegdemux.
Original commit message from CVS: * configure.ac: * gst-plugins-bad.spec.in: * gst/mpegdemux/Makefile.am: * gst/mpegdemux/flumpegdemux.c: * gst/mpegdemux/gstmpegdesc.c: * gst/mpegdemux/gstmpegdesc.h: * gst/mpegdemux/mpegtspacketizer.c: * gst/mpegdemux/mpegtspacketizer.h: * gst/mpegdemux/mpegtsparse.c: * gst/mpegdemux/mpegtsparse.h: Move of mpegtsparse to mpegdemux. Fixes #555193.
Diffstat (limited to 'gst/mpegdemux/gstmpegdesc.c')
-rw-r--r--gst/mpegdemux/gstmpegdesc.c111
1 files changed, 69 insertions, 42 deletions
diff --git a/gst/mpegdemux/gstmpegdesc.c b/gst/mpegdemux/gstmpegdesc.c
index 1bab07ba..727b3e8a 100644
--- a/gst/mpegdemux/gstmpegdesc.c
+++ b/gst/mpegdemux/gstmpegdesc.c
@@ -1,45 +1,33 @@
- /*
- * This library is licensed under 2 different licenses and you
- * can choose to use it under the terms of either one of them. The
- * two licenses are the MPL 1.1 and the LGPL.
- *
- * MPL:
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * LGPL:
- *
- * 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.
- *
- * The Original Code is Fluendo MPEG Demuxer plugin.
- *
- * The Initial Developer of the Original Code is Fluendo, S.L.
- * Portions created by Fluendo, S.L. are Copyright (C) 2005
- * Fluendo, S.L. All Rights Reserved.
- *
- * Contributor(s): Wim Taymans <wim@fluendo.com>
- */
+/*
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is Fluendo MPEG Demuxer plugin.
+ *
+ * The Initial Developer of the Original Code is Fluendo, S.L.
+ * Portions created by Fluendo, S.L. are Copyright (C) 2005
+ * Fluendo, S.L. All Rights Reserved.
+ *
+ * Contributor(s): Wim Taymans <wim@fluendo.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU Lesser General Public License Version 2 or later (the "LGPL"),
+ * in which case the provisions of the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of the MPL or the LGPL.
+ */
#include <string.h>
@@ -47,6 +35,9 @@
#include "gstmpegdesc.h"
+GST_DEBUG_CATEGORY (gstmpegtsdesc_debug);
+#define GST_CAT_DEFAULT (gstmpegtsdesc_debug)
+
void
gst_mpeg_descriptor_free (GstMPEGDescriptor * desc)
{
@@ -149,6 +140,34 @@ gst_mpeg_descriptor_find (GstMPEGDescriptor * desc, gint tag)
return NULL;
}
+/* array needs freeing afterwards */
+GArray *
+gst_mpeg_descriptor_find_all (GstMPEGDescriptor * desc, gint tag)
+{
+ GArray *all;
+
+ gint length;
+ guint8 *current;
+ guint size;
+
+ g_return_val_if_fail (desc != NULL, NULL);
+ all = g_array_new (TRUE, TRUE, sizeof (guint8 *));
+
+ current = desc->data;
+ length = desc->data_length;
+
+ while (length > 0) {
+ if (DESC_TAG (current) == tag)
+ g_array_append_val (all, current);
+ size = DESC_LENGTH (current) + 2;
+
+ current += size;
+ length -= size;
+ }
+
+ return all;
+}
+
guint8 *
gst_mpeg_descriptor_nth (GstMPEGDescriptor * desc, guint i)
{
@@ -173,6 +192,14 @@ gst_mpeg_descriptor_nth (GstMPEGDescriptor * desc, guint i)
current += size;
length -= size;
i--;
+
}
return NULL;
}
+
+void
+gst_mpegtsdesc_init_debug ()
+{
+ GST_DEBUG_CATEGORY_INIT (gstmpegtsdesc_debug, "mpegtsdesc", 0,
+ "MPEG transport stream parser (descriptor)");
+}