gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
/* GStreamer
|
2008-11-25 18:03:02 +00:00
|
|
|
* Copyright (C) <2006> Wim Taymans <wim.taymans@gmail.com>
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gst/tag/tag.h>
|
|
|
|
#include <gst/rtp/gstrtpbuffer.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "gstrtptheoradepay.h"
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (rtptheoradepay_debug);
|
|
|
|
#define GST_CAT_DEFAULT (rtptheoradepay_debug)
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_rtp_theora_depay_sink_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("application/x-rtp, "
|
|
|
|
"media = (string) \"video\", "
|
2007-01-24 12:22:51 +00:00
|
|
|
"payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", "
|
2010-05-25 15:05:12 +00:00
|
|
|
"clock-rate = (int) 90000, " "encoding-name = (string) \"THEORA\""
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
/* All required parameters
|
|
|
|
*
|
2007-05-14 17:10:12 +00:00
|
|
|
* "sampling = (string) { "YCbCr-4:2:0", "YCbCr-4:2:2", "YCbCr-4:4:4" } "
|
|
|
|
* "width = (string) [1, 1048561] (multiples of 16) "
|
|
|
|
* "height = (string) [1, 1048561] (multiples of 16) "
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
* "delivery-method = (string) { inline, in_band, out_band/<specific_name> } "
|
|
|
|
* "configuration = (string) ANY"
|
|
|
|
*/
|
|
|
|
/* All optional parameters
|
|
|
|
*
|
|
|
|
* "configuration-uri ="
|
|
|
|
*/
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_rtp_theora_depay_src_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-theora")
|
|
|
|
);
|
|
|
|
|
|
|
|
GST_BOILERPLATE (GstRtpTheoraDepay, gst_rtp_theora_depay, GstBaseRTPDepayload,
|
|
|
|
GST_TYPE_BASE_RTP_DEPAYLOAD);
|
|
|
|
|
|
|
|
static gboolean gst_rtp_theora_depay_setcaps (GstBaseRTPDepayload * depayload,
|
|
|
|
GstCaps * caps);
|
|
|
|
static GstBuffer *gst_rtp_theora_depay_process (GstBaseRTPDepayload * depayload,
|
|
|
|
GstBuffer * buf);
|
|
|
|
|
|
|
|
static void gst_rtp_theora_depay_finalize (GObject * object);
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_rtp_theora_depay_base_init (gpointer klass)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_rtp_theora_depay_sink_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_rtp_theora_depay_src_template));
|
|
|
|
|
2010-03-18 13:31:35 +00:00
|
|
|
gst_element_class_set_details_simple (element_class, "RTP Theora depayloader",
|
2010-12-21 15:58:47 +00:00
|
|
|
"Codec/Depayloader/Network/RTP",
|
2010-03-18 13:31:35 +00:00
|
|
|
"Extracts Theora video from RTP packets (draft-01 of RFC XXXX)",
|
|
|
|
"Wim Taymans <wim.taymans@gmail.com>");
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_rtp_theora_depay_class_init (GstRtpTheoraDepayClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
|
|
|
|
|
|
|
|
gobject_class->finalize = gst_rtp_theora_depay_finalize;
|
|
|
|
|
|
|
|
gstbasertpdepayload_class->process = gst_rtp_theora_depay_process;
|
|
|
|
gstbasertpdepayload_class->set_caps = gst_rtp_theora_depay_setcaps;
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (rtptheoradepay_debug, "rtptheoradepay", 0,
|
|
|
|
"Theora RTP Depayloader");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_rtp_theora_depay_init (GstRtpTheoraDepay * rtptheoradepay,
|
|
|
|
GstRtpTheoraDepayClass * klass)
|
|
|
|
{
|
|
|
|
rtptheoradepay->adapter = gst_adapter_new ();
|
|
|
|
}
|
2009-03-18 13:50:17 +00:00
|
|
|
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
static void
|
|
|
|
gst_rtp_theora_depay_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstRtpTheoraDepay *rtptheoradepay = GST_RTP_THEORA_DEPAY (object);
|
|
|
|
|
|
|
|
g_object_unref (rtptheoradepay->adapter);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_rtp_theora_depay_parse_configuration (GstRtpTheoraDepay * rtptheoradepay,
|
2010-04-22 10:28:22 +00:00
|
|
|
GstBuffer * confbuf)
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
|
|
|
guint32 num_headers;
|
|
|
|
guint8 *data;
|
2010-04-22 10:28:22 +00:00
|
|
|
guint size;
|
2007-05-14 17:10:12 +00:00
|
|
|
gint i, j;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2010-04-22 10:28:22 +00:00
|
|
|
data = GST_BUFFER_DATA (confbuf);
|
|
|
|
size = GST_BUFFER_SIZE (confbuf);
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2010-05-01 10:25:26 +00:00
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "config size %u", size);
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
|
|
|
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Number of packed headers |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Packed header |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Packed header |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | .... |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*/
|
|
|
|
if (size < 4)
|
|
|
|
goto too_small;
|
|
|
|
|
|
|
|
num_headers = GST_READ_UINT32_BE (data);
|
|
|
|
size -= 4;
|
|
|
|
data += 4;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "have %u headers", num_headers);
|
|
|
|
|
|
|
|
/* 0 1 2 3
|
|
|
|
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2007-05-14 17:10:12 +00:00
|
|
|
* | Ident | length ..
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .. | n. of headers | length1 | length2 ..
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2007-05-14 17:10:12 +00:00
|
|
|
* .. | Identification Header ..
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2007-05-14 17:10:12 +00:00
|
|
|
* .................................................................
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .. | Comment Header ..
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .................................................................
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .. Comment Header |
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Setup Header ..
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2007-05-14 17:10:12 +00:00
|
|
|
* .................................................................
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
* .. Setup Header |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*/
|
|
|
|
for (i = 0; i < num_headers; i++) {
|
|
|
|
guint32 ident;
|
|
|
|
guint16 length;
|
2007-05-14 17:10:12 +00:00
|
|
|
guint8 n_headers, b;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
GstRtpTheoraConfig *conf;
|
2007-05-14 17:10:12 +00:00
|
|
|
guint *h_sizes;
|
2010-05-07 13:31:03 +00:00
|
|
|
guint extra = 1;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
if (size < 6)
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
goto too_small;
|
|
|
|
|
|
|
|
ident = (data[0] << 16) | (data[1] << 8) | data[2];
|
|
|
|
length = (data[3] << 8) | data[4];
|
2007-05-14 17:10:12 +00:00
|
|
|
n_headers = data[5];
|
|
|
|
size -= 6;
|
|
|
|
data += 6;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay,
|
2010-05-01 10:25:26 +00:00
|
|
|
"header %d, ident 0x%08x, length %u, left %u", i, ident, length, size);
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2010-04-22 10:28:22 +00:00
|
|
|
/* FIXME check if we already got this ident */
|
|
|
|
|
2010-05-07 13:31:03 +00:00
|
|
|
/* length might also include count of following size fields */
|
|
|
|
if (size < length && size + 1 != length)
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
goto too_small;
|
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
/* read header sizes we read 2 sizes, the third size (for which we allocate
|
|
|
|
* space) must be derived from the total packed header length. */
|
|
|
|
h_sizes = g_newa (guint, n_headers + 1);
|
|
|
|
for (j = 0; j < n_headers; j++) {
|
|
|
|
guint h_size;
|
|
|
|
|
|
|
|
h_size = 0;
|
|
|
|
do {
|
|
|
|
if (size < 1)
|
|
|
|
goto too_small;
|
|
|
|
b = *data++;
|
|
|
|
size--;
|
2010-05-07 13:31:03 +00:00
|
|
|
extra++;
|
2007-05-14 17:10:12 +00:00
|
|
|
h_size = (h_size << 7) | (b & 0x7f);
|
|
|
|
} while (b & 0x80);
|
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "headers %d: size: %u", j, h_size);
|
|
|
|
h_sizes[j] = h_size;
|
|
|
|
length -= h_size;
|
|
|
|
}
|
|
|
|
/* last header length is the remaining space */
|
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "last header size: %u", length);
|
|
|
|
h_sizes[j] = length;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "preparing headers");
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
conf = g_new0 (GstRtpTheoraConfig, 1);
|
|
|
|
conf->ident = ident;
|
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
for (j = 0; j <= n_headers; j++) {
|
|
|
|
guint h_size;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
h_size = h_sizes[j];
|
2010-05-07 13:31:03 +00:00
|
|
|
if (size < h_size) {
|
|
|
|
if (j != n_headers || size + extra != h_size) {
|
|
|
|
goto too_small;
|
|
|
|
} else {
|
|
|
|
/* otherwise means that overall length field contained total length,
|
|
|
|
* including extra fields */
|
|
|
|
h_size -= extra;
|
|
|
|
}
|
|
|
|
}
|
2007-05-14 17:10:12 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "reading header %d, size %u", j,
|
|
|
|
h_size);
|
|
|
|
|
|
|
|
buf = gst_buffer_new_and_alloc (h_size);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), data, h_size);
|
|
|
|
conf->headers = g_list_append (conf->headers, buf);
|
|
|
|
data += h_size;
|
|
|
|
size -= h_size;
|
|
|
|
}
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
rtptheoradepay->configs = g_list_append (rtptheoradepay->configs, conf);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
too_small:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "configuration too small");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-22 10:28:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_rtp_theora_depay_parse_inband_configuration (GstRtpTheoraDepay *
|
2010-05-07 13:31:03 +00:00
|
|
|
rtptheoradepay, guint ident, guint8 * configuration, guint size,
|
|
|
|
guint length)
|
2010-04-22 10:28:22 +00:00
|
|
|
{
|
|
|
|
GstBuffer *confbuf;
|
|
|
|
guint8 *conf;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (size < 4))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* transform inline to out-of-band and parse that one */
|
2010-05-07 13:31:03 +00:00
|
|
|
confbuf = gst_buffer_new_and_alloc (size + 9);
|
2010-04-22 10:28:22 +00:00
|
|
|
conf = GST_BUFFER_DATA (confbuf);
|
|
|
|
/* 1 header */
|
|
|
|
GST_WRITE_UINT32_BE (conf, 1);
|
|
|
|
/* write Ident */
|
|
|
|
GST_WRITE_UINT24_BE (conf + 4, ident);
|
2010-05-07 13:31:03 +00:00
|
|
|
/* write sort-of-length */
|
|
|
|
GST_WRITE_UINT16_BE (conf + 7, length);
|
2010-04-22 10:28:22 +00:00
|
|
|
/* copy remainder */
|
2010-05-07 13:31:03 +00:00
|
|
|
memcpy (conf + 9, configuration, size);
|
2010-04-22 10:28:22 +00:00
|
|
|
|
|
|
|
return gst_rtp_theora_depay_parse_configuration (rtptheoradepay, confbuf);
|
|
|
|
}
|
|
|
|
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
static gboolean
|
|
|
|
gst_rtp_theora_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GstRtpTheoraDepay *rtptheoradepay;
|
|
|
|
GstCaps *srccaps;
|
|
|
|
const gchar *configuration;
|
gst/rtp/gstrtpL16depay.c: Check if clock-rate and channels are valid.
Original commit message from CVS:
* gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_setcaps),
(gst_rtp_L16_depay_process):
Check if clock-rate and channels are valid.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpac3depay.c: (gst_rtp_ac3_depay_setcaps),
(gst_rtp_ac3_depay_process):
Don't ignore the return value of set_caps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_setcaps),
(gst_rtp_amr_depay_process):
* gst/rtp/gstrtpamrdepay.h:
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set output caps on the buffers, the base class does that for
us.
The subclass will make sure we are negotiated.
* gst/rtp/gstrtpdvdepay.c: (gst_rtp_dv_depay_setcaps),
(gst_rtp_dv_depay_process), (gst_rtp_dv_depay_reset):
* gst/rtp/gstrtpdvdepay.h:
Clean up caps negotiation.
The subclass will make sure we are negotiated.
* gst/rtp/gstrtpg726depay.c: (gst_rtp_g726_depay_setcaps),
(gst_rtp_g726_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpg729depay.c: (gst_rtp_g729_depay_init),
(gst_rtp_g729_depay_setcaps), (gst_rtp_g729_depay_process):
* gst/rtp/gstrtpg729depay.h:
The subclass will make sure we are negotiated.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_setcaps),
(gst_rtp_gsm_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpgsmpay.c: (gst_rtp_gsm_pay_setcaps):
Clean up caps negotiation.
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtph263depay.c: (gst_rtp_h263_depay_setcaps),
(gst_rtp_h263_depay_process):
Clean up caps negotiation.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph263pay.c: (gst_rtp_h263_pay_setcaps),
(gst_rtp_h263_pay_flush), (gst_rtp_h263_pay_handle_buffer):
* gst/rtp/gstrtph263pay.h:
Don't ignore the return value of set_outcaps.
Do some more timestamps.
* gst/rtp/gstrtph263pdepay.c: (gst_rtp_h263p_depay_setcaps),
(gst_rtp_h263p_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph263ppay.c: (gst_rtp_h263p_pay_class_init),
(gst_rtp_h263p_pay_setcaps), (gst_rtp_h263p_pay_flush),
(gst_rtp_h263p_pay_handle_buffer):
* gst/rtp/gstrtph263ppay.h:
Don't ignore the return value of set_outcaps.
Do some more timestamps.
* gst/rtp/gstrtph264depay.c: (gst_rtp_h264_depay_setcaps),
(gst_rtp_h264_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
Fix possible caps leak.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph264pay.c: (gst_rtp_h264_pay_setcaps):
Add some more debug info.
* gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps),
(gst_rtp_ilbc_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_sink_setcaps):
Clean up caps negotiation.
* gst/rtp/gstrtpmp1sdepay.c: (gst_rtp_mp1s_depay_setcaps),
(gst_rtp_mp1s_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_setcaps),
(gst_rtp_mp2t_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4adepay.c: (gst_rtp_mp4a_depay_setcaps),
(gst_rtp_mp4a_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpmp4apay.c: (gst_rtp_mp4a_pay_new_caps),
(gst_rtp_mp4a_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmp4gdepay.c: (gst_rtp_mp4g_depay_setcaps),
(gst_rtp_mp4g_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize),
(gst_rtp_mp4g_pay_new_caps), (gst_rtp_mp4g_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmp4vdepay.c: (gst_rtp_mp4v_depay_setcaps),
(gst_rtp_mp4v_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4vpay.c: (gst_rtp_mp4v_pay_new_caps),
(gst_rtp_mp4v_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmpadepay.c: (gst_rtp_mpa_depay_setcaps),
(gst_rtp_mpa_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpmpapay.c: (gst_rtp_mpa_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmpvdepay.c: (gst_rtp_mpv_depay_setcaps),
(gst_rtp_mpv_depay_process):
Clean up caps negotiation.
Actually set output caps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpmpvpay.c: (gst_rtp_mpv_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_setcaps),
(gst_rtp_pcma_depay_process):
Clean up caps negotiation.
Set output buffer duration because we can.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtppcmapay.c: (gst_rtp_pcma_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_setcaps),
(gst_rtp_pcmu_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtppcmupay.c: (gst_rtp_pcmu_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpspeexdepay.c: (gst_rtp_speex_depay_init),
(gst_rtp_speex_depay_setcaps), (gst_rtp_speex_depay_process):
Clean up caps negotiation.
Set output caps on the pad and header buffers.
Set duration on output buffers because we can.
* gst/rtp/gstrtpspeexpay.c: (gst_rtp_speex_pay_parse_ident):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpsv3vdepay.c: (gst_rtp_sv3v_depay_setcaps),
(gst_rtp_sv3v_depay_process):
Clean up caps negotiation.
No need to validate the buffer, the base class does that for us.
No need to set caps out output buffers, subclass does that.
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_process):
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_class_init),
(gst_rtp_theora_pay_flush_packet), (encode_base64),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpvorbisdepay.c: (gst_rtp_vorbis_depay_setcaps),
(gst_rtp_vorbis_depay_process):
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpvorbispay.c: (gst_rtp_vorbis_pay_finish_headers):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpvrawdepay.c: (gst_rtp_vraw_depay_setcaps):
Clean up caps negotiation, don't ignore setcaps return.
* gst/rtp/gstrtpvrawpay.c: (gst_rtp_vraw_pay_setcaps):
Don't ignore the return value of set_outcaps.
2008-10-27 11:03:53 +00:00
|
|
|
gboolean res;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
|
|
|
rtptheoradepay = GST_RTP_THEORA_DEPAY (depayload);
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
2010-04-22 10:28:22 +00:00
|
|
|
/* read and parse configuration string */
|
|
|
|
configuration = gst_structure_get_string (structure, "configuration");
|
2010-05-11 17:18:42 +00:00
|
|
|
if (configuration) {
|
2010-04-22 10:28:22 +00:00
|
|
|
GstBuffer *confbuf;
|
|
|
|
guint8 *data;
|
|
|
|
gsize size;
|
|
|
|
|
|
|
|
/* configure string should be in the caps */
|
|
|
|
if (configuration == NULL)
|
|
|
|
goto no_configuration;
|
|
|
|
|
|
|
|
/* deserialize base64 to buffer */
|
|
|
|
data = g_base64_decode (configuration, &size);
|
|
|
|
|
|
|
|
confbuf = gst_buffer_new ();
|
|
|
|
GST_BUFFER_DATA (confbuf) = data;
|
|
|
|
GST_BUFFER_MALLOCDATA (confbuf) = data;
|
|
|
|
GST_BUFFER_SIZE (confbuf) = size;
|
|
|
|
|
|
|
|
if (!gst_rtp_theora_depay_parse_configuration (rtptheoradepay, confbuf))
|
|
|
|
goto invalid_configuration;
|
2010-05-25 15:05:12 +00:00
|
|
|
}
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
|
|
|
/* set caps on pad and on header */
|
|
|
|
srccaps = gst_caps_new_simple ("video/x-theora", NULL);
|
gst/rtp/gstrtpL16depay.c: Check if clock-rate and channels are valid.
Original commit message from CVS:
* gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_setcaps),
(gst_rtp_L16_depay_process):
Check if clock-rate and channels are valid.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpac3depay.c: (gst_rtp_ac3_depay_setcaps),
(gst_rtp_ac3_depay_process):
Don't ignore the return value of set_caps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_setcaps),
(gst_rtp_amr_depay_process):
* gst/rtp/gstrtpamrdepay.h:
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set output caps on the buffers, the base class does that for
us.
The subclass will make sure we are negotiated.
* gst/rtp/gstrtpdvdepay.c: (gst_rtp_dv_depay_setcaps),
(gst_rtp_dv_depay_process), (gst_rtp_dv_depay_reset):
* gst/rtp/gstrtpdvdepay.h:
Clean up caps negotiation.
The subclass will make sure we are negotiated.
* gst/rtp/gstrtpg726depay.c: (gst_rtp_g726_depay_setcaps),
(gst_rtp_g726_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpg729depay.c: (gst_rtp_g729_depay_init),
(gst_rtp_g729_depay_setcaps), (gst_rtp_g729_depay_process):
* gst/rtp/gstrtpg729depay.h:
The subclass will make sure we are negotiated.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_setcaps),
(gst_rtp_gsm_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpgsmpay.c: (gst_rtp_gsm_pay_setcaps):
Clean up caps negotiation.
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtph263depay.c: (gst_rtp_h263_depay_setcaps),
(gst_rtp_h263_depay_process):
Clean up caps negotiation.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph263pay.c: (gst_rtp_h263_pay_setcaps),
(gst_rtp_h263_pay_flush), (gst_rtp_h263_pay_handle_buffer):
* gst/rtp/gstrtph263pay.h:
Don't ignore the return value of set_outcaps.
Do some more timestamps.
* gst/rtp/gstrtph263pdepay.c: (gst_rtp_h263p_depay_setcaps),
(gst_rtp_h263p_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph263ppay.c: (gst_rtp_h263p_pay_class_init),
(gst_rtp_h263p_pay_setcaps), (gst_rtp_h263p_pay_flush),
(gst_rtp_h263p_pay_handle_buffer):
* gst/rtp/gstrtph263ppay.h:
Don't ignore the return value of set_outcaps.
Do some more timestamps.
* gst/rtp/gstrtph264depay.c: (gst_rtp_h264_depay_setcaps),
(gst_rtp_h264_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
Fix possible caps leak.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph264pay.c: (gst_rtp_h264_pay_setcaps):
Add some more debug info.
* gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps),
(gst_rtp_ilbc_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_sink_setcaps):
Clean up caps negotiation.
* gst/rtp/gstrtpmp1sdepay.c: (gst_rtp_mp1s_depay_setcaps),
(gst_rtp_mp1s_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_setcaps),
(gst_rtp_mp2t_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4adepay.c: (gst_rtp_mp4a_depay_setcaps),
(gst_rtp_mp4a_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpmp4apay.c: (gst_rtp_mp4a_pay_new_caps),
(gst_rtp_mp4a_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmp4gdepay.c: (gst_rtp_mp4g_depay_setcaps),
(gst_rtp_mp4g_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize),
(gst_rtp_mp4g_pay_new_caps), (gst_rtp_mp4g_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmp4vdepay.c: (gst_rtp_mp4v_depay_setcaps),
(gst_rtp_mp4v_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4vpay.c: (gst_rtp_mp4v_pay_new_caps),
(gst_rtp_mp4v_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmpadepay.c: (gst_rtp_mpa_depay_setcaps),
(gst_rtp_mpa_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpmpapay.c: (gst_rtp_mpa_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmpvdepay.c: (gst_rtp_mpv_depay_setcaps),
(gst_rtp_mpv_depay_process):
Clean up caps negotiation.
Actually set output caps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpmpvpay.c: (gst_rtp_mpv_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_setcaps),
(gst_rtp_pcma_depay_process):
Clean up caps negotiation.
Set output buffer duration because we can.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtppcmapay.c: (gst_rtp_pcma_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_setcaps),
(gst_rtp_pcmu_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtppcmupay.c: (gst_rtp_pcmu_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpspeexdepay.c: (gst_rtp_speex_depay_init),
(gst_rtp_speex_depay_setcaps), (gst_rtp_speex_depay_process):
Clean up caps negotiation.
Set output caps on the pad and header buffers.
Set duration on output buffers because we can.
* gst/rtp/gstrtpspeexpay.c: (gst_rtp_speex_pay_parse_ident):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpsv3vdepay.c: (gst_rtp_sv3v_depay_setcaps),
(gst_rtp_sv3v_depay_process):
Clean up caps negotiation.
No need to validate the buffer, the base class does that for us.
No need to set caps out output buffers, subclass does that.
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_process):
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_class_init),
(gst_rtp_theora_pay_flush_packet), (encode_base64),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpvorbisdepay.c: (gst_rtp_vorbis_depay_setcaps),
(gst_rtp_vorbis_depay_process):
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpvorbispay.c: (gst_rtp_vorbis_pay_finish_headers):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpvrawdepay.c: (gst_rtp_vraw_depay_setcaps):
Clean up caps negotiation, don't ignore setcaps return.
* gst/rtp/gstrtpvrawpay.c: (gst_rtp_vraw_pay_setcaps):
Don't ignore the return value of set_outcaps.
2008-10-27 11:03:53 +00:00
|
|
|
res = gst_pad_set_caps (depayload->srcpad, srccaps);
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
gst_caps_unref (srccaps);
|
|
|
|
|
2008-01-11 17:21:30 +00:00
|
|
|
/* Clock rate is always 90000 according to draft-barbato-avt-rtp-theora-01 */
|
|
|
|
depayload->clock_rate = 90000;
|
|
|
|
|
gst/rtp/gstrtpL16depay.c: Check if clock-rate and channels are valid.
Original commit message from CVS:
* gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_setcaps),
(gst_rtp_L16_depay_process):
Check if clock-rate and channels are valid.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpac3depay.c: (gst_rtp_ac3_depay_setcaps),
(gst_rtp_ac3_depay_process):
Don't ignore the return value of set_caps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_setcaps),
(gst_rtp_amr_depay_process):
* gst/rtp/gstrtpamrdepay.h:
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set output caps on the buffers, the base class does that for
us.
The subclass will make sure we are negotiated.
* gst/rtp/gstrtpdvdepay.c: (gst_rtp_dv_depay_setcaps),
(gst_rtp_dv_depay_process), (gst_rtp_dv_depay_reset):
* gst/rtp/gstrtpdvdepay.h:
Clean up caps negotiation.
The subclass will make sure we are negotiated.
* gst/rtp/gstrtpg726depay.c: (gst_rtp_g726_depay_setcaps),
(gst_rtp_g726_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpg729depay.c: (gst_rtp_g729_depay_init),
(gst_rtp_g729_depay_setcaps), (gst_rtp_g729_depay_process):
* gst/rtp/gstrtpg729depay.h:
The subclass will make sure we are negotiated.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_setcaps),
(gst_rtp_gsm_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpgsmpay.c: (gst_rtp_gsm_pay_setcaps):
Clean up caps negotiation.
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtph263depay.c: (gst_rtp_h263_depay_setcaps),
(gst_rtp_h263_depay_process):
Clean up caps negotiation.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph263pay.c: (gst_rtp_h263_pay_setcaps),
(gst_rtp_h263_pay_flush), (gst_rtp_h263_pay_handle_buffer):
* gst/rtp/gstrtph263pay.h:
Don't ignore the return value of set_outcaps.
Do some more timestamps.
* gst/rtp/gstrtph263pdepay.c: (gst_rtp_h263p_depay_setcaps),
(gst_rtp_h263p_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph263ppay.c: (gst_rtp_h263p_pay_class_init),
(gst_rtp_h263p_pay_setcaps), (gst_rtp_h263p_pay_flush),
(gst_rtp_h263p_pay_handle_buffer):
* gst/rtp/gstrtph263ppay.h:
Don't ignore the return value of set_outcaps.
Do some more timestamps.
* gst/rtp/gstrtph264depay.c: (gst_rtp_h264_depay_setcaps),
(gst_rtp_h264_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
Fix possible caps leak.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtph264pay.c: (gst_rtp_h264_pay_setcaps):
Add some more debug info.
* gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_setcaps),
(gst_rtp_ilbc_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpilbcpay.c: (gst_rtpilbcpay_sink_setcaps):
Clean up caps negotiation.
* gst/rtp/gstrtpmp1sdepay.c: (gst_rtp_mp1s_depay_setcaps),
(gst_rtp_mp1s_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_setcaps),
(gst_rtp_mp2t_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4adepay.c: (gst_rtp_mp4a_depay_setcaps),
(gst_rtp_mp4a_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpmp4apay.c: (gst_rtp_mp4a_pay_new_caps),
(gst_rtp_mp4a_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmp4gdepay.c: (gst_rtp_mp4g_depay_setcaps),
(gst_rtp_mp4g_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize),
(gst_rtp_mp4g_pay_new_caps), (gst_rtp_mp4g_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmp4vdepay.c: (gst_rtp_mp4v_depay_setcaps),
(gst_rtp_mp4v_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
No need to set caps on buffers, subclass does that for us.
* gst/rtp/gstrtpmp4vpay.c: (gst_rtp_mp4v_pay_new_caps),
(gst_rtp_mp4v_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmpadepay.c: (gst_rtp_mpa_depay_setcaps),
(gst_rtp_mpa_depay_process):
Clean up caps negotiation.
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtpmpapay.c: (gst_rtp_mpa_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpmpvdepay.c: (gst_rtp_mpv_depay_setcaps),
(gst_rtp_mpv_depay_process):
Clean up caps negotiation.
Actually set output caps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpmpvpay.c: (gst_rtp_mpv_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_setcaps),
(gst_rtp_pcma_depay_process):
Clean up caps negotiation.
Set output buffer duration because we can.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtppcmapay.c: (gst_rtp_pcma_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_setcaps),
(gst_rtp_pcmu_depay_process):
Clean up caps negotiation.
Use the marker bit to set the DISCONT flag on outgoing buffers.
* gst/rtp/gstrtppcmupay.c: (gst_rtp_pcmu_pay_setcaps):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpspeexdepay.c: (gst_rtp_speex_depay_init),
(gst_rtp_speex_depay_setcaps), (gst_rtp_speex_depay_process):
Clean up caps negotiation.
Set output caps on the pad and header buffers.
Set duration on output buffers because we can.
* gst/rtp/gstrtpspeexpay.c: (gst_rtp_speex_pay_parse_ident):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpsv3vdepay.c: (gst_rtp_sv3v_depay_setcaps),
(gst_rtp_sv3v_depay_process):
Clean up caps negotiation.
No need to validate the buffer, the base class does that for us.
No need to set caps out output buffers, subclass does that.
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_process):
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_class_init),
(gst_rtp_theora_pay_flush_packet), (encode_base64),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpvorbisdepay.c: (gst_rtp_vorbis_depay_setcaps),
(gst_rtp_vorbis_depay_process):
Don't ignore the return value of setcaps.
No need to validate the buffer, the base class does that for us.
* gst/rtp/gstrtpvorbispay.c: (gst_rtp_vorbis_pay_finish_headers):
Don't ignore the return value of set_outcaps.
* gst/rtp/gstrtpvrawdepay.c: (gst_rtp_vraw_depay_setcaps):
Clean up caps negotiation, don't ignore setcaps return.
* gst/rtp/gstrtpvrawpay.c: (gst_rtp_vraw_pay_setcaps):
Don't ignore the return value of set_outcaps.
2008-10-27 11:03:53 +00:00
|
|
|
return res;
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_configuration:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (rtptheoradepay, "no configuration specified");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_configuration:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (rtptheoradepay, "invalid configuration specified");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_rtp_theora_depay_switch_codebook (GstRtpTheoraDepay * rtptheoradepay,
|
|
|
|
guint32 ident)
|
|
|
|
{
|
|
|
|
GList *walk;
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
|
|
|
for (walk = rtptheoradepay->configs; walk; walk = g_list_next (walk)) {
|
|
|
|
GstRtpTheoraConfig *conf = (GstRtpTheoraConfig *) walk->data;
|
|
|
|
|
|
|
|
if (conf->ident == ident) {
|
|
|
|
GList *headers;
|
|
|
|
|
|
|
|
/* FIXME, remove pads, create new pad.. */
|
|
|
|
|
|
|
|
/* push out all the headers */
|
|
|
|
for (headers = conf->headers; headers; headers = g_list_next (headers)) {
|
|
|
|
GstBuffer *header = GST_BUFFER_CAST (headers->data);
|
|
|
|
|
|
|
|
gst_buffer_ref (header);
|
|
|
|
gst_base_rtp_depayload_push (GST_BASE_RTP_DEPAYLOAD (rtptheoradepay),
|
|
|
|
header);
|
|
|
|
}
|
|
|
|
/* remember the current config */
|
|
|
|
rtptheoradepay->config = conf;
|
|
|
|
res = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!res) {
|
|
|
|
/* we don't know about the headers, figure out an alternative method for
|
|
|
|
* getting the codebooks. FIXME, fail for now. */
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstBuffer *
|
|
|
|
gst_rtp_theora_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
GstRtpTheoraDepay *rtptheoradepay;
|
|
|
|
GstBuffer *outbuf;
|
|
|
|
GstFlowReturn ret;
|
|
|
|
gint payload_len;
|
|
|
|
guint8 *payload, *to_free = NULL;
|
|
|
|
guint32 timestamp;
|
|
|
|
guint32 header, ident;
|
|
|
|
guint8 F, TDT, packets;
|
|
|
|
|
|
|
|
rtptheoradepay = GST_RTP_THEORA_DEPAY (depayload);
|
|
|
|
|
|
|
|
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (depayload, "got RTP packet of size %d", payload_len);
|
|
|
|
|
|
|
|
/* we need at least 4 bytes for the packet header */
|
|
|
|
if (G_UNLIKELY (payload_len < 4))
|
|
|
|
goto packet_short;
|
|
|
|
|
|
|
|
payload = gst_rtp_buffer_get_payload (buf);
|
|
|
|
|
|
|
|
header = GST_READ_UINT32_BE (payload);
|
|
|
|
/*
|
|
|
|
* 0 1 2 3
|
|
|
|
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Ident | F |TDT|# pkts.|
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*
|
|
|
|
* F: Fragment type (0=none, 1=start, 2=cont, 3=end)
|
|
|
|
* TDT: Theora data type (0=theora, 1=config, 2=comment, 3=reserved)
|
|
|
|
* pkts: number of packets.
|
|
|
|
*/
|
|
|
|
TDT = (header & 0x30) >> 4;
|
|
|
|
if (G_UNLIKELY (TDT == 3))
|
|
|
|
goto ignore_reserved;
|
|
|
|
|
|
|
|
ident = (header >> 8) & 0xffffff;
|
|
|
|
F = (header & 0xc0) >> 6;
|
|
|
|
packets = (header & 0xf);
|
|
|
|
|
2008-05-21 10:09:23 +00:00
|
|
|
GST_DEBUG_OBJECT (depayload, "ident: 0x%08x, F: %d, TDT: %d, packets: %d",
|
|
|
|
ident, F, TDT, packets);
|
|
|
|
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
if (TDT == 0) {
|
|
|
|
gboolean do_switch = FALSE;
|
|
|
|
|
|
|
|
/* we have a raw payload, find the codebook for the ident */
|
|
|
|
if (!rtptheoradepay->config) {
|
|
|
|
/* we don't have an active codebook, find the codebook and
|
|
|
|
* activate it */
|
|
|
|
do_switch = TRUE;
|
|
|
|
} else if (rtptheoradepay->config->ident != ident) {
|
|
|
|
/* codebook changed */
|
|
|
|
do_switch = TRUE;
|
|
|
|
}
|
|
|
|
if (do_switch) {
|
|
|
|
if (!gst_rtp_theora_depay_switch_codebook (rtptheoradepay, ident))
|
|
|
|
goto switch_failed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* skip header */
|
|
|
|
payload += 4;
|
|
|
|
payload_len -= 4;
|
|
|
|
|
|
|
|
/* fragmented packets, assemble */
|
|
|
|
if (F != 0) {
|
|
|
|
GstBuffer *vdata;
|
|
|
|
guint headerskip;
|
|
|
|
|
|
|
|
if (F == 1) {
|
|
|
|
/* if we start a packet, clear adapter and start assembling. */
|
|
|
|
gst_adapter_clear (rtptheoradepay->adapter);
|
|
|
|
GST_DEBUG_OBJECT (depayload, "start assemble");
|
|
|
|
rtptheoradepay->assembling = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!rtptheoradepay->assembling)
|
|
|
|
goto no_output;
|
|
|
|
|
|
|
|
/* first assembled packet, reuse 2 bytes to store the length */
|
|
|
|
headerskip = (F == 1 ? 4 : 6);
|
|
|
|
/* skip header and length. */
|
|
|
|
vdata = gst_rtp_buffer_get_payload_subbuffer (buf, headerskip, -1);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (depayload, "assemble theora packet");
|
|
|
|
gst_adapter_push (rtptheoradepay->adapter, vdata);
|
|
|
|
|
|
|
|
/* packet is not complete, we are done */
|
|
|
|
if (F != 3)
|
|
|
|
goto no_output;
|
|
|
|
|
|
|
|
/* construct assembled buffer */
|
|
|
|
payload_len = gst_adapter_available (rtptheoradepay->adapter);
|
|
|
|
payload = gst_adapter_take (rtptheoradepay->adapter, payload_len);
|
|
|
|
/* fix the length */
|
|
|
|
payload[0] = ((payload_len - 2) >> 8) & 0xff;
|
|
|
|
payload[1] = (payload_len - 2) & 0xff;
|
|
|
|
to_free = payload;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (depayload, "assemble done");
|
|
|
|
|
|
|
|
/* we not assembling anymore now */
|
|
|
|
rtptheoradepay->assembling = FALSE;
|
|
|
|
gst_adapter_clear (rtptheoradepay->adapter);
|
|
|
|
|
|
|
|
/* payload now points to a length with that many theora data bytes.
|
|
|
|
* Iterate over the packets and send them out.
|
|
|
|
*
|
|
|
|
* 0 1 2 3
|
|
|
|
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | length | theora data ..
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .. theora data |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | length | next theora packet data ..
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .. theora data |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*
|
|
|
|
*/
|
|
|
|
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
|
|
|
|
|
|
|
while (payload_len > 2) {
|
|
|
|
guint16 length;
|
|
|
|
|
|
|
|
length = GST_READ_UINT16_BE (payload);
|
|
|
|
payload += 2;
|
|
|
|
payload_len -= 2;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (depayload, "read length %u, avail: %d", length,
|
|
|
|
payload_len);
|
|
|
|
|
|
|
|
/* skip packet if something odd happens */
|
|
|
|
if (G_UNLIKELY (length > payload_len))
|
|
|
|
goto length_short;
|
|
|
|
|
2010-04-22 10:28:22 +00:00
|
|
|
/* handle in-band configuration */
|
|
|
|
if (G_UNLIKELY (TDT == 1)) {
|
|
|
|
GST_DEBUG_OBJECT (rtptheoradepay, "in-band configuration");
|
|
|
|
if (!gst_rtp_theora_depay_parse_inband_configuration (rtptheoradepay,
|
2010-05-07 13:31:03 +00:00
|
|
|
ident, payload, payload_len, length))
|
2010-04-22 10:28:22 +00:00
|
|
|
goto invalid_configuration;
|
|
|
|
goto no_output;
|
|
|
|
}
|
|
|
|
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
/* create buffer for packet */
|
|
|
|
if (G_UNLIKELY (to_free)) {
|
|
|
|
outbuf = gst_buffer_new ();
|
|
|
|
GST_BUFFER_DATA (outbuf) = payload;
|
|
|
|
GST_BUFFER_MALLOCDATA (outbuf) = to_free;
|
|
|
|
GST_BUFFER_SIZE (outbuf) = length;
|
|
|
|
to_free = NULL;
|
|
|
|
} else {
|
|
|
|
outbuf = gst_buffer_new_and_alloc (length);
|
|
|
|
memcpy (GST_BUFFER_DATA (outbuf), payload, length);
|
|
|
|
}
|
|
|
|
|
|
|
|
payload += length;
|
|
|
|
payload_len -= length;
|
|
|
|
|
|
|
|
if (timestamp != -1)
|
|
|
|
/* push with timestamp of the last packet, which is the same timestamp that
|
|
|
|
* should apply to the first assembled packet. */
|
|
|
|
ret = gst_base_rtp_depayload_push_ts (depayload, timestamp, outbuf);
|
|
|
|
else
|
|
|
|
ret = gst_base_rtp_depayload_push (depayload, outbuf);
|
|
|
|
|
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* make sure we don't set a timestamp on next buffers */
|
|
|
|
timestamp = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (to_free);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
no_output:
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
/* ERORRS */
|
|
|
|
switch_failed:
|
|
|
|
{
|
2010-04-07 21:21:55 +00:00
|
|
|
GST_ELEMENT_WARNING (rtptheoradepay, STREAM, DECODE,
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
(NULL), ("Could not switch codebooks"));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
packet_short:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_WARNING (rtptheoradepay, STREAM, DECODE,
|
|
|
|
(NULL), ("Packet was too short (%d < 4)", payload_len));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
ignore_reserved:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (rtptheoradepay, "reserved TDT ignored");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
length_short:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_WARNING (rtptheoradepay, STREAM, DECODE,
|
|
|
|
(NULL), ("Packet contains invalid data"));
|
|
|
|
return NULL;
|
|
|
|
}
|
2010-04-22 10:28:22 +00:00
|
|
|
invalid_configuration:
|
|
|
|
{
|
|
|
|
/* fatal, as we otherwise risk carrying on without output */
|
|
|
|
GST_ELEMENT_ERROR (rtptheoradepay, STREAM, DECODE,
|
|
|
|
(NULL), ("Packet contains invalid configuration"));
|
|
|
|
return NULL;
|
|
|
|
}
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gst_rtp_theora_depay_plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
return gst_element_register (plugin, "rtptheoradepay",
|
2010-12-21 15:49:28 +00:00
|
|
|
GST_RANK_SECONDARY, GST_TYPE_RTP_THEORA_DEPAY);
|
gst/rtp/: Add theora pay/depayloaders.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_base_init),
(gst_rtp_theora_depay_class_init), (gst_rtp_theora_depay_init),
(gst_rtp_theora_depay_finalize),
(gst_rtp_theora_depay_parse_configuration),
(gst_rtp_theora_depay_setcaps),
(gst_rtp_theora_depay_switch_codebook),
(gst_rtp_theora_depay_process),
(gst_rtp_theora_depay_set_property),
(gst_rtp_theora_depay_get_property),
(gst_rtp_theora_depay_change_state),
(gst_rtp_theora_depay_plugin_init):
* gst/rtp/gstrtptheoradepay.h:
* gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_base_init),
(gst_rtp_theora_pay_class_init), (gst_rtp_theora_pay_init),
(gst_rtp_theora_pay_setcaps), (gst_rtp_theora_pay_reset_packet),
(gst_rtp_theora_pay_init_packet),
(gst_rtp_theora_pay_flush_packet),
(gst_rtp_theora_pay_finish_headers), (gst_rtp_theora_pay_parse_id),
(gst_rtp_theora_pay_handle_buffer),
(gst_rtp_theora_pay_plugin_init):
* gst/rtp/gstrtptheorapay.h:
Add theora pay/depayloaders.
2006-11-08 01:28:00 +00:00
|
|
|
}
|