mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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.
This commit is contained in:
parent
8aea40af0b
commit
f6aeac7868
11 changed files with 3913 additions and 72 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2008-10-08 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||
|
||||
* 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.
|
||||
|
||||
2008-10-08 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
|
||||
* gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_send_data),
|
||||
|
|
|
@ -259,7 +259,6 @@ AG_GST_CHECK_PLUGIN(h264parse)
|
|||
AG_GST_CHECK_PLUGIN(librfb)
|
||||
AG_GST_CHECK_PLUGIN(modplug)
|
||||
AG_GST_CHECK_PLUGIN(mpegdemux)
|
||||
AG_GST_CHECK_PLUGIN(mpegtsparse)
|
||||
AG_GST_CHECK_PLUGIN(mpegtsmux)
|
||||
AG_GST_CHECK_PLUGIN(mpeg4videoparse)
|
||||
AG_GST_CHECK_PLUGIN(mpegvideoparse)
|
||||
|
@ -1413,7 +1412,6 @@ gst/librfb/Makefile
|
|||
gst/modplug/Makefile
|
||||
gst/modplug/libmodplug/Makefile
|
||||
gst/mpegdemux/Makefile
|
||||
gst/mpegtsparse/Makefile
|
||||
gst/mpegtsmux/Makefile
|
||||
gst/mpegtsmux/tsmux/Makefile
|
||||
gst/mpeg4videoparse/Makefile
|
||||
|
|
|
@ -93,7 +93,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_libdir}/gstreamer-%{majorminor}/libgstdvdspu.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstfestival.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstflvdemux.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstmpegtsparse.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgststereo.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstvcdsrc.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstdvb.so
|
||||
|
|
|
@ -9,7 +9,9 @@ libgstmpegdemux_la_SOURCES = \
|
|||
gstmpegdesc.c \
|
||||
gstmpegtsdemux.c \
|
||||
gstpesfilter.c \
|
||||
gstsectionfilter.c
|
||||
gstsectionfilter.c \
|
||||
mpegtsparse.c \
|
||||
mpegtspacketizer.c
|
||||
|
||||
libgstmpegdemux_la_CFLAGS = $(GST_CFLAGS) $(LIBOIL_CFLAGS)
|
||||
libgstmpegdemux_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(LIBOIL_LIBS)
|
||||
|
@ -24,5 +26,7 @@ noinst_HEADERS = \
|
|||
flutspatinfo.h \
|
||||
flutspmtinfo.h \
|
||||
flutspmtstreaminfo.h \
|
||||
gstsectionfilter.h
|
||||
gstsectionfilter.h \
|
||||
mpegtspacketizer.h \
|
||||
mpegtsparse.h
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
#include "gstmpegdemux.h"
|
||||
#include "gstmpegtsdemux.h"
|
||||
#include "mpegtsparse.h"
|
||||
#include "mpegtspacketizer.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_EXTERN (gstflupesfilter_debug);
|
||||
GST_DEBUG_CATEGORY_EXTERN (gstflusectionfilter_debug);
|
||||
|
@ -62,7 +64,8 @@ plugin_init (GstPlugin * plugin)
|
|||
return FALSE;
|
||||
if (!gst_fluts_demux_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_mpegtsparse_plugin_init (plugin))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)");
|
||||
}
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/*
|
||||
* 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
|
||||
|
@ -15,23 +9,6 @@
|
|||
* 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.
|
||||
|
@ -39,6 +16,17 @@
|
|||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GST_MPEG_DESC_H__
|
||||
|
@ -154,6 +142,7 @@
|
|||
/* 0x7D and 0x7E are reserved for future use */
|
||||
#define DESC_DVB_EXTENSION 0x7F
|
||||
/* 0x80 - 0xFE are user defined */
|
||||
#define DESC_DTG_LOGICAL_CHANNEL 0x83 /* from DTG D-Book */
|
||||
/* 0xFF is forbidden */
|
||||
|
||||
/* common for all descriptors */
|
||||
|
@ -255,17 +244,78 @@
|
|||
#define DESC_DVB_NETWORK_NAME_length(desc) (GST_READ_UINT8((desc)+1))
|
||||
#define DESC_DVB_NETWORK_NAME_text(desc) (desc+2)
|
||||
|
||||
/* DVB Service Descriptor */
|
||||
#define DESC_DVB_SERVICE_type(desc) (desc[2])
|
||||
#define DESC_DVB_SERVICE_provider_name_length(desc) (desc[3])
|
||||
#define DESC_DVB_SERVICE_provider_name_text(desc) (desc+4)
|
||||
#define DESC_DVB_SERVICE_name_length(desc) (desc[4 + DESC_DVB_SERVICE_provider_name_length(desc)])
|
||||
#define DESC_DVB_SERVICE_name_text(desc) (desc + 5 + DESC_DVB_SERVICE_provider_name_length(desc))
|
||||
|
||||
/* DVB Component Descriptor */
|
||||
#define DESC_DVB_COMPONENT_stream_content(desc) (desc[2] & 0x0F)
|
||||
#define DESC_DVB_COMPONENT_type(desc) (desc[3])
|
||||
#define DESC_DVB_COMPONENT_tag(desc) (desc[4])
|
||||
#define DESC_DVB_COMPONENT_language(desc) (desc + 5)
|
||||
|
||||
/* DVB Bouquet Name Descriptor */
|
||||
#define DESC_DVB_BOUQUET_NAME_text(desc) (desc + 2)
|
||||
|
||||
/* DVB Short Event Descriptor */
|
||||
#define DESC_DVB_SHORT_EVENT_name_text(desc) (desc + 6)
|
||||
#define DESC_DVB_SHORT_EVENT_name_length(desc) (desc[5])
|
||||
#define DESC_DVB_SHORT_EVENT_description_text(desc) (desc + 6 + DESC_DVB_SHORT_EVENT_name_length(desc) + 1)
|
||||
#define DESC_DVB_SHORT_EVENT_description_length(desc) (desc[6 + DESC_DVB_SHORT_EVENT_name_length(desc)])
|
||||
|
||||
/* DVB Extended Event Descriptor */
|
||||
#define DESC_DVB_EXTENDED_EVENT_descriptor_number(desc) ((desc[2] & 0xF0) >> 4)
|
||||
#define DESC_DVB_EXTENDED_EVENT_last_descriptor_number(desc) (desc[2] & 0x0F)
|
||||
#define DESC_DVB_EXTENDED_EVENT_iso639_language_code(desc) (desc + 3)
|
||||
#define DESC_DVB_EXTENDED_EVENT_items_length(desc) (desc[6])
|
||||
#define DESC_DVB_EXTENDED_EVENT_items(desc) (desc + 7)
|
||||
#define DESC_DVB_EXTENDED_EVENT_text_length(desc) (desc[7 + DESC_DVB_EXTENDED_EVENT_items_length(desc)])
|
||||
#define DESC_DVB_EXTENDED_EVENT_text(desc) (desc + 7 + DESC_DVB_EXTENDED_EVENT_items_length(desc) + 1)
|
||||
|
||||
/* DVB Satellite Delivery System Descriptor */
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_frequency(desc) (desc + 2)
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_orbital_position(desc) (desc + 6)
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_west_east_flag(desc) ((desc[8] & 0x80) == 0x80)
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_polarization(desc) ((desc[8] & 0x60) >> 5)
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_modulation(desc) (desc[8] & 0x1F)
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_symbol_rate(desc) (desc + 9)
|
||||
#define DESC_DVB_SATELLITE_DELIVERY_SYSTEM_fec_inner(desc) (desc[12] & 0x0F)
|
||||
|
||||
/* DVB Terrestrial Delivery System Descriptor */
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_frequency(desc) (GST_READ_UINT32_BE((desc) + 2))
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_bandwidth(desc) (desc[6] & 0xE0)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_constellation(desc) (desc[7] & 0xC0)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_hierarchy(desc) (desc[7] & 0x38)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_code_rate_hp(desc) (desc[7] & 0x07)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_code_rate_lp(desc) (desc[8] & 0xE0)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_guard_interval(desc) (desc[8] & 0x18)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_transmission_mode(desc) (desc[8] & 0x06)
|
||||
#define DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_other_frequency(desc) ((desc[8] & 0x01) == 0x01)
|
||||
|
||||
/* DVB Cable Delivery System Descriptor */
|
||||
#define DESC_DVB_CABLE_DELIVERY_SYSTEM_frequency(desc) (desc + 2)
|
||||
#define DESC_DVB_CABLE_DELIVERY_SYSTEM_fec_outer(desc) (desc[7] & 0x0F)
|
||||
#define DESC_DVB_CABLE_DELIVERY_SYSTEM_modulation(desc) (desc[8])
|
||||
#define DESC_DVB_CABLE_DELIVERY_SYSTEM_symbol_rate(desc) (desc + 9)
|
||||
#define DESC_DVB_CABLE_DELIVERY_SYSTEM_fec_inner(desc) (desc[12] & 0x0F)
|
||||
|
||||
typedef struct {
|
||||
guint n_desc;
|
||||
guint8 data_length;
|
||||
guint8 *data;
|
||||
} GstMPEGDescriptor;
|
||||
|
||||
void gst_mpegtsdesc_init_debug ();
|
||||
GstMPEGDescriptor* gst_mpeg_descriptor_parse (guint8 *data, guint size);
|
||||
void gst_mpeg_descriptor_free (GstMPEGDescriptor *desc);
|
||||
|
||||
guint gst_mpeg_descriptor_n_desc (GstMPEGDescriptor *desc);
|
||||
guint8* gst_mpeg_descriptor_find (GstMPEGDescriptor *desc, gint tag);
|
||||
GArray* gst_mpeg_descriptor_find_all (GstMPEGDescriptor * desc, gint tag);
|
||||
|
||||
guint8* gst_mpeg_descriptor_nth (GstMPEGDescriptor *desc, guint i);
|
||||
|
||||
#endif /* __GST_MPEG_DESC_H__ */
|
||||
|
|
2234
gst/mpegdemux/mpegtspacketizer.c
Normal file
2234
gst/mpegdemux/mpegtspacketizer.c
Normal file
File diff suppressed because it is too large
Load diff
135
gst/mpegdemux/mpegtspacketizer.h
Normal file
135
gst/mpegdemux/mpegtspacketizer.h
Normal file
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* mpegtspacketizer.h -
|
||||
* Copyright (C) 2007 Alessandro Decina
|
||||
*
|
||||
* Authors:
|
||||
* Alessandro Decina <alessandro@nnva.org>
|
||||
*
|
||||
* 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_MPEGTS_PACKETIZER_H
|
||||
#define GST_MPEGTS_PACKETIZER_H
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPEGTS_PACKETIZER \
|
||||
(mpegts_packetizer_get_type())
|
||||
#define GST_MPEGTS_PACKETIZER(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MPEGTS_PACKETIZER,MpegTSPacketizer))
|
||||
#define GST_MPEGTS_PACKETIZER_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MPEGTS_PACKETIZER,MpegTSPacketizerClass))
|
||||
#define GST_IS_MPEGTS_PACKETIZER(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MPEGTS_PACKETIZER))
|
||||
#define GST_IS_MPEGTS_PACKETIZER_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEGTS_PACKETIZER))
|
||||
|
||||
|
||||
typedef struct _MpegTSPacketizer MpegTSPacketizer;
|
||||
typedef struct _MpegTSPacketizerClass MpegTSPacketizerClass;
|
||||
|
||||
struct _MpegTSPacketizer {
|
||||
GObject object;
|
||||
|
||||
GstAdapter *adapter;
|
||||
/* streams hashed by pid */
|
||||
GHashTable *streams;
|
||||
gboolean disposed;
|
||||
};
|
||||
|
||||
struct _MpegTSPacketizerClass {
|
||||
GObjectClass object_class;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GstBuffer *buffer;
|
||||
gint16 pid;
|
||||
guint8 payload_unit_start_indicator;
|
||||
guint8 adaptation_field_control;
|
||||
guint8 continuity_counter;
|
||||
guint8 *payload;
|
||||
|
||||
guint8 *data_start;
|
||||
guint8 *data_end;
|
||||
guint8 *data;
|
||||
|
||||
} MpegTSPacketizerPacket;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gboolean complete;
|
||||
GstBuffer *buffer;
|
||||
gint16 pid;
|
||||
guint8 table_id;
|
||||
guint16 subtable_extension;
|
||||
guint section_length;
|
||||
guint8 version_number;
|
||||
guint8 current_next_indicator;
|
||||
} MpegTSPacketizerSection;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint8 table_id;
|
||||
/* the spec says sub_table_extension is the fourth and fifth byte of a
|
||||
* section when the section_syntax_indicator is set to a value of "1". If
|
||||
* section_syntax_indicator is 0, sub_table_extension will be set to 0 */
|
||||
guint16 subtable_extension;
|
||||
guint8 version_number;
|
||||
} MpegTSPacketizerStreamSubtable;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint continuity_counter;
|
||||
GstAdapter *section_adapter;
|
||||
guint8 section_table_id;
|
||||
guint section_length;
|
||||
GSList *subtables;
|
||||
} MpegTSPacketizerStream;
|
||||
|
||||
|
||||
GType gst_mpegts_packetizer_get_type(void);
|
||||
|
||||
void mpegts_packetizer_init_debug ();
|
||||
MpegTSPacketizer *mpegts_packetizer_new ();
|
||||
void mpegts_packetizer_clear (MpegTSPacketizer *packetizer);
|
||||
void mpegts_packetizer_push (MpegTSPacketizer *packetizer, GstBuffer *buffer);
|
||||
gboolean mpegts_packetizer_has_packets (MpegTSPacketizer *packetizer);
|
||||
gboolean mpegts_packetizer_next_packet (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerPacket *packet);
|
||||
void mpegts_packetizer_clear_packet (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerPacket *packet);
|
||||
|
||||
gboolean mpegts_packetizer_push_section (MpegTSPacketizer *packetzer,
|
||||
MpegTSPacketizerPacket *packet, MpegTSPacketizerSection *section);
|
||||
GstStructure *mpegts_packetizer_parse_pat (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerSection *section);
|
||||
GstStructure *mpegts_packetizer_parse_pmt (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerSection *section);
|
||||
GstStructure *mpegts_packetizer_parse_nit (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerSection *section);
|
||||
GstStructure *mpegts_packetizer_parse_sdt (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerSection *section);
|
||||
GstStructure *mpegts_packetizer_parse_eit (MpegTSPacketizer *packetizer,
|
||||
MpegTSPacketizerSection *section);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GST_MPEGTS_PACKETIZER_H */
|
1293
gst/mpegdemux/mpegtsparse.c
Normal file
1293
gst/mpegdemux/mpegtsparse.c
Normal file
File diff suppressed because it is too large
Load diff
83
gst/mpegdemux/mpegtsparse.h
Normal file
83
gst/mpegdemux/mpegtsparse.h
Normal file
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* mpegts_parse.h - GStreamer MPEG transport stream parser
|
||||
* Copyright (C) 2007 Alessandro Decina
|
||||
*
|
||||
* Authors:
|
||||
* Alessandro Decina <alessandro@nnva.org>
|
||||
*
|
||||
* 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_MPEG_TS_PARSE_H
|
||||
#define GST_MPEG_TS_PARSE_H
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "mpegtspacketizer.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_MPEGTS_PARSE \
|
||||
(mpegts_parse_get_type())
|
||||
#define GST_MPEGTS_PARSE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MPEGTS_PARSE,MpegTSParse))
|
||||
#define GST_MPEGTS_PARSE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MPEGTS_PARSE,MpegTSParseClass))
|
||||
#define GST_IS_MPEGTS_PARSE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MPEGTS_PARSE))
|
||||
#define GST_IS_MPEGTS_PARSE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEGTS_PARSE))
|
||||
|
||||
typedef struct _MpegTSParse MpegTSParse;
|
||||
typedef struct _MpegTSParseClass MpegTSParseClass;
|
||||
|
||||
struct _MpegTSParse {
|
||||
GstElement element;
|
||||
|
||||
GstPad *sinkpad;
|
||||
|
||||
/* the following vars must be protected with the OBJECT_LOCK as they can be
|
||||
* accessed from the application thread and the streaming thread */
|
||||
gchar *program_numbers;
|
||||
GList *pads_to_add;
|
||||
GList *pads_to_remove;
|
||||
GHashTable *programs;
|
||||
guint req_pads;
|
||||
|
||||
GstStructure *pat;
|
||||
MpegTSPacketizer *packetizer;
|
||||
GHashTable *psi_pids;
|
||||
gboolean disposed;
|
||||
};
|
||||
|
||||
struct _MpegTSParseClass {
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (*pat_info) (GstStructure *pat);
|
||||
void (*pmt_info) (GstStructure *pmt);
|
||||
void (*nit_info) (GstStructure *nit);
|
||||
void (*sdt_info) (GstStructure *sdt);
|
||||
void (*eit_info) (GstStructure *eit);
|
||||
};
|
||||
|
||||
GType gst_mpegts_parse_get_type(void);
|
||||
|
||||
gboolean gst_mpegtsparse_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GST_MPEG_TS_PARSE_H */
|
Loading…
Reference in a new issue