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
|
2012-11-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <gst/rtp/gstrtpbuffer.h>
|
2015-08-04 17:59:17 +00:00
|
|
|
#include <gst/video/video.h>
|
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
|
|
|
|
2021-02-12 12:16:28 +00:00
|
|
|
#include "gstrtpelements.h"
|
gst/rtp/Makefile.am: gst/rtp/fnv1hash.c (MASK_24, FNV1_HASH_32_INIT, FNV1_HASH_32_PRIME, fnv1_hash_32_new, fnv1_hash_...
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/fnv1hash.c (MASK_24, FNV1_HASH_32_INIT, FNV1_HASH_32_PRIME,
fnv1_hash_32_new, fnv1_hash_32_update, fnv1_hash_32_to_24):
* gst/rtp/fnv1hash.h (__GST_FNV1_HASH_H__):
Add a simple hashing implementation that we can use to generate
a 24-bit ident value based on the codebooks for vorbis and theora.
* gst/rtp/gstrtptheorapay.c (gst_rtp_theora_pay_finish_headers,
gst_rtp_theora_pay_handle_buffer):
* gst/rtp/gstrtpvorbisdepay.c
(gst_rtp_vorbis_depay_parse_configuration,
gst_rtp_vorbis_depay_switch_codebook, gst_rtp_vorbis_depay_process):
* gst/rtp/gstrtpvorbispay.c (gst_rtp_vorbis_pay_reset_packet,
gst_rtp_vorbis_pay_init_packet, gst_rtp_vorbis_pay_flush_packet,
gst_rtp_vorbis_pay_finish_headers, gst_rtp_vorbis_pay_handle_buffer):
Use the hashing function, ensuring that the same codebooks result
in the same ident and thus the same SDP description.
Various log fixes/changes.
2007-04-12 11:41:11 +00:00
|
|
|
#include "fnv1hash.h"
|
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
|
|
|
#include "gstrtptheorapay.h"
|
2015-08-04 17:59:17 +00:00
|
|
|
#include "gstrtputils.h"
|
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
|
|
|
|
|
|
|
#define THEORA_ID_LEN 42
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (rtptheorapay_debug);
|
|
|
|
#define GST_CAT_DEFAULT (rtptheorapay_debug)
|
|
|
|
|
|
|
|
/* references:
|
|
|
|
* http://svn.xiph.org/trunk/theora/doc/draft-ietf-avt-rtp-theora-01.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_rtp_theora_pay_src_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
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
|
|
|
|
*
|
|
|
|
* "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) "
|
|
|
|
* "configuration = (string) ANY"
|
|
|
|
*/
|
|
|
|
/* All optional parameters
|
|
|
|
*
|
|
|
|
* "configuration-uri ="
|
2010-05-25 15:05:12 +00:00
|
|
|
* "delivery-method = (string) { inline, in_band, out_band/<specific_name> } "
|
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 GstStaticPadTemplate gst_rtp_theora_pay_sink_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-theora")
|
|
|
|
);
|
|
|
|
|
2010-05-07 13:42:23 +00:00
|
|
|
#define DEFAULT_CONFIG_INTERVAL 0
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_CONFIG_INTERVAL
|
|
|
|
};
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
#define gst_rtp_theora_pay_parent_class parent_class
|
2011-11-11 11:25:01 +00:00
|
|
|
G_DEFINE_TYPE (GstRtpTheoraPay, gst_rtp_theora_pay, GST_TYPE_RTP_BASE_PAYLOAD);
|
2021-02-12 12:16:28 +00:00
|
|
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (rtptheorapay, "rtptheorapay",
|
|
|
|
GST_RANK_SECONDARY, GST_TYPE_RTP_THEORA_PAY, rtp_element_init (plugin));
|
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
|
|
|
|
2011-11-11 11:25:01 +00:00
|
|
|
static gboolean gst_rtp_theora_pay_setcaps (GstRTPBasePayload * basepayload,
|
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
|
|
|
GstCaps * caps);
|
2008-02-12 23:38:19 +00:00
|
|
|
static GstStateChangeReturn gst_rtp_theora_pay_change_state (GstElement *
|
|
|
|
element, GstStateChange transition);
|
2011-11-11 11:25:01 +00:00
|
|
|
static GstFlowReturn gst_rtp_theora_pay_handle_buffer (GstRTPBasePayload * pad,
|
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 * buffer);
|
2011-11-15 15:31:45 +00:00
|
|
|
static gboolean gst_rtp_theora_pay_sink_event (GstRTPBasePayload * payload,
|
2010-12-21 12:55:40 +00:00
|
|
|
GstEvent * event);
|
|
|
|
|
2013-06-28 10:08:19 +00:00
|
|
|
static gboolean gst_rtp_theora_pay_parse_id (GstRTPBasePayload * basepayload,
|
|
|
|
guint8 * data, guint size);
|
|
|
|
static gboolean gst_rtp_theora_pay_finish_headers (GstRTPBasePayload *
|
|
|
|
basepayload);
|
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-07 13:42:23 +00:00
|
|
|
static void gst_rtp_theora_pay_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_rtp_theora_pay_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
|
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_pay_class_init (GstRtpTheoraPayClass * klass)
|
|
|
|
{
|
2010-05-07 13:42:23 +00:00
|
|
|
GObjectClass *gobject_class;
|
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
|
|
|
GstElementClass *gstelement_class;
|
2011-11-11 11:25:01 +00:00
|
|
|
GstRTPBasePayloadClass *gstrtpbasepayload_class;
|
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-07 13:42:23 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
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
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2011-11-11 11:25:01 +00:00
|
|
|
gstrtpbasepayload_class = (GstRTPBasePayloadClass *) klass;
|
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
|
|
|
|
2008-02-12 23:38:19 +00:00
|
|
|
gstelement_class->change_state = gst_rtp_theora_pay_change_state;
|
|
|
|
|
2011-11-11 11:25:01 +00:00
|
|
|
gstrtpbasepayload_class->set_caps = gst_rtp_theora_pay_setcaps;
|
|
|
|
gstrtpbasepayload_class->handle_buffer = gst_rtp_theora_pay_handle_buffer;
|
2011-11-15 15:31:45 +00:00
|
|
|
gstrtpbasepayload_class->sink_event = gst_rtp_theora_pay_sink_event;
|
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-07 13:42:23 +00:00
|
|
|
gobject_class->set_property = gst_rtp_theora_pay_set_property;
|
|
|
|
gobject_class->get_property = gst_rtp_theora_pay_get_property;
|
|
|
|
|
2016-03-04 01:30:12 +00:00
|
|
|
gst_element_class_add_static_pad_template (gstelement_class,
|
|
|
|
&gst_rtp_theora_pay_src_template);
|
|
|
|
gst_element_class_add_static_pad_template (gstelement_class,
|
|
|
|
&gst_rtp_theora_pay_sink_template);
|
2011-07-10 19:50:19 +00:00
|
|
|
|
2012-04-09 23:51:41 +00:00
|
|
|
gst_element_class_set_static_metadata (gstelement_class,
|
2011-07-10 19:50:19 +00:00
|
|
|
"RTP Theora payloader", "Codec/Payloader/Network/RTP",
|
|
|
|
"Payload-encode Theora video into RTP packets (draft-01 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
|
|
|
GST_DEBUG_CATEGORY_INIT (rtptheorapay_debug, "rtptheorapay", 0,
|
|
|
|
"Theora RTP Payloader");
|
2010-05-07 13:42:23 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CONFIG_INTERVAL,
|
|
|
|
g_param_spec_uint ("config-interval", "Config Send Interval",
|
|
|
|
"Send Config Insertion Interval in seconds (configuration headers "
|
|
|
|
"will be multiplexed in the data stream when detected.) (0 = disabled)",
|
|
|
|
0, 3600, DEFAULT_CONFIG_INTERVAL,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
|
|
|
);
|
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
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_rtp_theora_pay_init (GstRtpTheoraPay * rtptheorapay)
|
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-07 13:42:23 +00:00
|
|
|
rtptheorapay->last_config = GST_CLOCK_TIME_NONE;
|
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-12-21 12:55:40 +00:00
|
|
|
static void
|
|
|
|
gst_rtp_theora_pay_clear_packet (GstRtpTheoraPay * rtptheorapay)
|
|
|
|
{
|
|
|
|
if (rtptheorapay->packet)
|
|
|
|
gst_buffer_unref (rtptheorapay->packet);
|
|
|
|
rtptheorapay->packet = NULL;
|
2015-09-19 15:04:07 +00:00
|
|
|
g_list_free_full (rtptheorapay->packet_buffers,
|
|
|
|
(GDestroyNotify) gst_buffer_unref);
|
2015-08-04 17:59:17 +00:00
|
|
|
rtptheorapay->packet_buffers = NULL;
|
2010-12-21 12:55:40 +00:00
|
|
|
}
|
|
|
|
|
2008-02-12 23:38:19 +00:00
|
|
|
static void
|
|
|
|
gst_rtp_theora_pay_cleanup (GstRtpTheoraPay * rtptheorapay)
|
|
|
|
{
|
2010-12-21 12:55:40 +00:00
|
|
|
gst_rtp_theora_pay_clear_packet (rtptheorapay);
|
2015-09-19 15:04:07 +00:00
|
|
|
g_list_free_full (rtptheorapay->headers, (GDestroyNotify) gst_buffer_unref);
|
|
|
|
rtptheorapay->headers = NULL;
|
2015-11-15 04:35:54 +00:00
|
|
|
g_free (rtptheorapay->config_data);
|
2010-05-07 13:42:23 +00:00
|
|
|
rtptheorapay->config_data = NULL;
|
|
|
|
rtptheorapay->last_config = GST_CLOCK_TIME_NONE;
|
2008-02-12 23:38:19 +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 gboolean
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_theora_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps)
|
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
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay;
|
2013-06-28 10:08:19 +00:00
|
|
|
GstStructure *s;
|
|
|
|
const GValue *array;
|
|
|
|
gint asize, i;
|
|
|
|
GstBuffer *buf;
|
|
|
|
GstMapInfo map;
|
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
|
|
|
|
|
|
|
rtptheorapay = GST_RTP_THEORA_PAY (basepayload);
|
|
|
|
|
2013-06-28 10:08:19 +00:00
|
|
|
s = gst_caps_get_structure (caps, 0);
|
|
|
|
|
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
|
|
|
rtptheorapay->need_headers = TRUE;
|
|
|
|
|
2013-06-28 10:08:19 +00:00
|
|
|
if ((array = gst_structure_get_value (s, "streamheader")) == NULL)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
if (G_VALUE_TYPE (array) != GST_TYPE_ARRAY)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
if ((asize = gst_value_array_get_size (array)) < 3)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
for (i = 0; i < asize; i++) {
|
|
|
|
const GValue *value;
|
|
|
|
|
|
|
|
value = gst_value_array_get_value (array, i);
|
|
|
|
if ((buf = gst_value_get_buffer (value)) == NULL)
|
|
|
|
goto null_buffer;
|
|
|
|
|
|
|
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
|
|
|
/* no data packets allowed */
|
|
|
|
if (map.size < 1)
|
|
|
|
goto invalid_streamheader;
|
|
|
|
|
|
|
|
/* we need packets with id 0x80, 0x81, 0x82 */
|
|
|
|
if (map.data[0] != 0x80 + i)
|
|
|
|
goto invalid_streamheader;
|
|
|
|
|
|
|
|
if (i == 0) {
|
|
|
|
/* identification, we need to parse this in order to get the clock rate. */
|
|
|
|
if (G_UNLIKELY (!gst_rtp_theora_pay_parse_id (basepayload, map.data,
|
|
|
|
map.size)))
|
|
|
|
goto parse_id_failed;
|
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "collecting header %d", i);
|
|
|
|
rtptheorapay->headers =
|
|
|
|
g_list_append (rtptheorapay->headers, gst_buffer_ref (buf));
|
|
|
|
gst_buffer_unmap (buf, &map);
|
|
|
|
}
|
|
|
|
if (!gst_rtp_theora_pay_finish_headers (basepayload))
|
|
|
|
goto finish_failed;
|
|
|
|
|
|
|
|
done:
|
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
|
|
|
return TRUE;
|
2013-06-28 10:08:19 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
null_buffer:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (rtptheorapay, "streamheader with null buffer received");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_streamheader:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (rtptheorapay, "unable to parse initial header");
|
|
|
|
gst_buffer_unmap (buf, &map);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
parse_id_failed:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (rtptheorapay, "unable to parse initial header");
|
|
|
|
gst_buffer_unmap (buf, &map);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
finish_failed:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (rtptheorapay, "unable to finish headers");
|
|
|
|
return FALSE;
|
|
|
|
}
|
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_pay_reset_packet (GstRtpTheoraPay * rtptheorapay, guint8 TDT)
|
|
|
|
{
|
|
|
|
guint payload_len;
|
2011-12-05 17:39:59 +00:00
|
|
|
GstRTPBuffer rtp = { 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
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "reset packet");
|
|
|
|
|
|
|
|
rtptheorapay->payload_pos = 4;
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_rtp_buffer_map (rtptheorapay->packet, GST_MAP_READ, &rtp);
|
|
|
|
payload_len = gst_rtp_buffer_get_payload_len (&rtp);
|
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
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
|
|
|
rtptheorapay->payload_left = payload_len - 4;
|
|
|
|
rtptheorapay->payload_duration = 0;
|
|
|
|
rtptheorapay->payload_F = 0;
|
|
|
|
rtptheorapay->payload_TDT = TDT;
|
|
|
|
rtptheorapay->payload_pkts = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_rtp_theora_pay_init_packet (GstRtpTheoraPay * rtptheorapay, guint8 TDT,
|
|
|
|
GstClockTime timestamp)
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "starting new packet, TDT: %d", TDT);
|
|
|
|
|
2015-09-19 15:04:07 +00:00
|
|
|
gst_rtp_theora_pay_clear_packet (rtptheorapay);
|
2015-08-04 17:59: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
|
|
|
/* new packet allocate max packet size */
|
|
|
|
rtptheorapay->packet =
|
2020-09-28 15:25:21 +00:00
|
|
|
gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
|
|
|
|
(rtptheorapay), GST_RTP_BASE_PAYLOAD_MTU (rtptheorapay), 0, 0);
|
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_rtp_theora_pay_reset_packet (rtptheorapay, TDT);
|
2007-09-19 16:24:09 +00:00
|
|
|
|
2015-06-10 12:33:50 +00:00
|
|
|
GST_BUFFER_PTS (rtptheorapay->packet) = timestamp;
|
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 GstFlowReturn
|
|
|
|
gst_rtp_theora_pay_flush_packet (GstRtpTheoraPay * rtptheorapay)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
|
|
|
guint8 *payload;
|
|
|
|
guint hlen;
|
2011-12-05 17:39:59 +00:00
|
|
|
GstRTPBuffer rtp = { NULL };
|
2015-08-04 17:59:17 +00:00
|
|
|
GList *l;
|
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
|
|
|
|
|
|
|
/* check for empty packet */
|
|
|
|
if (!rtptheorapay->packet || rtptheorapay->payload_pos <= 4)
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "flushing packet");
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_rtp_buffer_map (rtptheorapay->packet, GST_MAP_WRITE, &rtp);
|
|
|
|
|
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
|
|
|
/* fix header */
|
2011-07-10 19:50:19 +00:00
|
|
|
payload = gst_rtp_buffer_get_payload (&rtp);
|
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
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
payload[0] = (rtptheorapay->payload_ident >> 16) & 0xff;
|
|
|
|
payload[1] = (rtptheorapay->payload_ident >> 8) & 0xff;
|
|
|
|
payload[2] = (rtptheorapay->payload_ident) & 0xff;
|
|
|
|
payload[3] = (rtptheorapay->payload_F & 0x3) << 6 |
|
|
|
|
(rtptheorapay->payload_TDT & 0x3) << 4 |
|
|
|
|
(rtptheorapay->payload_pkts & 0xf);
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
|
|
|
|
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
|
|
|
/* shrink the buffer size to the last written byte */
|
|
|
|
hlen = gst_rtp_buffer_calc_header_len (0);
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_buffer_resize (rtptheorapay->packet, 0, hlen + rtptheorapay->payload_pos);
|
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-09-19 16:24:09 +00:00
|
|
|
GST_BUFFER_DURATION (rtptheorapay->packet) = rtptheorapay->payload_duration;
|
|
|
|
|
2015-08-04 17:59:17 +00:00
|
|
|
for (l = g_list_last (rtptheorapay->packet_buffers); l; l = l->prev) {
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (l->data);
|
2017-05-24 11:57:10 +00:00
|
|
|
gst_rtp_copy_video_meta (rtptheorapay, rtptheorapay->packet, buf);
|
2015-08-04 17:59:17 +00:00
|
|
|
gst_buffer_unref (buf);
|
|
|
|
}
|
|
|
|
g_list_free (rtptheorapay->packet_buffers);
|
|
|
|
rtptheorapay->packet_buffers = 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
|
|
|
/* push, this gives away our ref to the packet, so clear it. */
|
|
|
|
ret =
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtptheorapay),
|
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
|
|
|
rtptheorapay->packet);
|
|
|
|
rtptheorapay->packet = NULL;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_theora_pay_finish_headers (GstRTPBasePayload * basepayload)
|
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
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay = GST_RTP_THEORA_PAY (basepayload);
|
|
|
|
GList *walk;
|
2010-05-07 13:42:23 +00:00
|
|
|
guint length, size, n_headers, configlen, extralen;
|
2007-05-14 17:10:12 +00:00
|
|
|
gchar *wstr, *hstr, *configuration;
|
|
|
|
guint8 *data, *config;
|
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
|
|
|
guint32 ident;
|
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;
|
2015-08-08 15:34:50 +00:00
|
|
|
const gchar *sampling = 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
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "finish headers");
|
|
|
|
|
2008-06-20 16:24:11 +00:00
|
|
|
if (!rtptheorapay->headers) {
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "We need 2 headers but have none");
|
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 no_headers;
|
2008-06-20 16:24:11 +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
|
|
|
|
|
|
|
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Number of packed headers |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Packed header |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Packed header |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | .... |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*
|
|
|
|
* We only construct a config containing 1 packed header like this:
|
|
|
|
*
|
|
|
|
* 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 ..
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* .. | Identification 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
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
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
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2007-05-14 17:10:12 +00:00
|
|
|
* .. 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 |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*/
|
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
/* we need 4 bytes for the number of headers (which is always 1), 3 bytes for
|
|
|
|
* the ident, 2 bytes for length, 1 byte for n. of headers. */
|
|
|
|
size = 4 + 3 + 2 + 1;
|
|
|
|
|
|
|
|
/* count the size of the headers first and update the hash */
|
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
|
|
|
length = 0;
|
2007-05-14 17:10:12 +00:00
|
|
|
n_headers = 0;
|
gst/rtp/Makefile.am: gst/rtp/fnv1hash.c (MASK_24, FNV1_HASH_32_INIT, FNV1_HASH_32_PRIME, fnv1_hash_32_new, fnv1_hash_...
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/fnv1hash.c (MASK_24, FNV1_HASH_32_INIT, FNV1_HASH_32_PRIME,
fnv1_hash_32_new, fnv1_hash_32_update, fnv1_hash_32_to_24):
* gst/rtp/fnv1hash.h (__GST_FNV1_HASH_H__):
Add a simple hashing implementation that we can use to generate
a 24-bit ident value based on the codebooks for vorbis and theora.
* gst/rtp/gstrtptheorapay.c (gst_rtp_theora_pay_finish_headers,
gst_rtp_theora_pay_handle_buffer):
* gst/rtp/gstrtpvorbisdepay.c
(gst_rtp_vorbis_depay_parse_configuration,
gst_rtp_vorbis_depay_switch_codebook, gst_rtp_vorbis_depay_process):
* gst/rtp/gstrtpvorbispay.c (gst_rtp_vorbis_pay_reset_packet,
gst_rtp_vorbis_pay_init_packet, gst_rtp_vorbis_pay_flush_packet,
gst_rtp_vorbis_pay_finish_headers, gst_rtp_vorbis_pay_handle_buffer):
Use the hashing function, ensuring that the same codebooks result
in the same ident and thus the same SDP description.
Various log fixes/changes.
2007-04-12 11:41:11 +00:00
|
|
|
ident = fnv1_hash_32_new ();
|
2010-05-07 13:42:23 +00:00
|
|
|
extralen = 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
|
|
|
for (walk = rtptheorapay->headers; walk; walk = g_list_next (walk)) {
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (walk->data);
|
2012-01-23 16:25:37 +00:00
|
|
|
GstMapInfo map;
|
2007-05-14 17:10:12 +00:00
|
|
|
guint bsize;
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
bsize = gst_buffer_get_size (buf);
|
2007-05-14 17:10:12 +00:00
|
|
|
length += bsize;
|
|
|
|
n_headers++;
|
|
|
|
|
|
|
|
/* count number of bytes needed for length fields, we don't need this for
|
|
|
|
* the last header. */
|
|
|
|
if (g_list_next (walk)) {
|
|
|
|
do {
|
|
|
|
size++;
|
2010-05-07 13:42:23 +00:00
|
|
|
extralen++;
|
2007-05-14 17:10:12 +00:00
|
|
|
bsize >>= 7;
|
|
|
|
} while (bsize);
|
|
|
|
}
|
|
|
|
/* update hash */
|
2012-01-23 16:25:37 +00:00
|
|
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
|
|
|
ident = fnv1_hash_32_update (ident, map.data, map.size);
|
|
|
|
gst_buffer_unmap (buf, &map);
|
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
|
|
|
/* packet length is header size + packet length */
|
|
|
|
configlen = size + length;
|
|
|
|
config = data = g_malloc (configlen);
|
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, we only pack 1 header */
|
|
|
|
data[0] = 0;
|
|
|
|
data[1] = 0;
|
|
|
|
data[2] = 0;
|
|
|
|
data[3] = 1;
|
|
|
|
|
gst/rtp/Makefile.am: gst/rtp/fnv1hash.c (MASK_24, FNV1_HASH_32_INIT, FNV1_HASH_32_PRIME, fnv1_hash_32_new, fnv1_hash_...
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/fnv1hash.c (MASK_24, FNV1_HASH_32_INIT, FNV1_HASH_32_PRIME,
fnv1_hash_32_new, fnv1_hash_32_update, fnv1_hash_32_to_24):
* gst/rtp/fnv1hash.h (__GST_FNV1_HASH_H__):
Add a simple hashing implementation that we can use to generate
a 24-bit ident value based on the codebooks for vorbis and theora.
* gst/rtp/gstrtptheorapay.c (gst_rtp_theora_pay_finish_headers,
gst_rtp_theora_pay_handle_buffer):
* gst/rtp/gstrtpvorbisdepay.c
(gst_rtp_vorbis_depay_parse_configuration,
gst_rtp_vorbis_depay_switch_codebook, gst_rtp_vorbis_depay_process):
* gst/rtp/gstrtpvorbispay.c (gst_rtp_vorbis_pay_reset_packet,
gst_rtp_vorbis_pay_init_packet, gst_rtp_vorbis_pay_flush_packet,
gst_rtp_vorbis_pay_finish_headers, gst_rtp_vorbis_pay_handle_buffer):
Use the hashing function, ensuring that the same codebooks result
in the same ident and thus the same SDP description.
Various log fixes/changes.
2007-04-12 11:41:11 +00:00
|
|
|
ident = fnv1_hash_32_to_24 (ident);
|
|
|
|
rtptheorapay->payload_ident = ident;
|
2007-05-14 17:10:12 +00:00
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "ident 0x%08x", ident);
|
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
|
|
|
|
|
|
|
/* take lower 3 bytes */
|
|
|
|
data[4] = (ident >> 16) & 0xff;
|
|
|
|
data[5] = (ident >> 8) & 0xff;
|
|
|
|
data[6] = ident & 0xff;
|
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
/* store length of all theora headers */
|
|
|
|
data[7] = ((length) >> 8) & 0xff;
|
|
|
|
data[8] = (length) & 0xff;
|
|
|
|
|
|
|
|
/* store number of headers minus one. */
|
|
|
|
data[9] = n_headers - 1;
|
|
|
|
data += 10;
|
|
|
|
|
|
|
|
/* store length for each header */
|
|
|
|
for (walk = rtptheorapay->headers; walk; walk = g_list_next (walk)) {
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (walk->data);
|
|
|
|
guint bsize, size, temp;
|
2009-04-02 00:31:18 +00:00
|
|
|
guint flag;
|
2007-05-14 17:10:12 +00:00
|
|
|
|
|
|
|
/* only need to store the length when it's not the last header */
|
|
|
|
if (!g_list_next (walk))
|
|
|
|
break;
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
bsize = gst_buffer_get_size (buf);
|
2007-05-14 17:10:12 +00:00
|
|
|
|
|
|
|
/* calc size */
|
|
|
|
size = 0;
|
|
|
|
do {
|
|
|
|
size++;
|
|
|
|
bsize >>= 7;
|
|
|
|
} while (bsize);
|
|
|
|
temp = size;
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
bsize = gst_buffer_get_size (buf);
|
2007-05-14 17:10:12 +00:00
|
|
|
/* write the size backwards */
|
2009-04-02 00:31:18 +00:00
|
|
|
flag = 0;
|
2007-05-14 17:10:12 +00:00
|
|
|
while (size) {
|
|
|
|
size--;
|
2009-04-02 00:31:18 +00:00
|
|
|
data[size] = (bsize & 0x7f) | flag;
|
2007-05-14 17:10:12 +00:00
|
|
|
bsize >>= 7;
|
2013-06-28 13:21:12 +00:00
|
|
|
flag = 0x80; /* Flag bit on all bytes of the length except the last */
|
2007-05-14 17:10:12 +00:00
|
|
|
}
|
|
|
|
data += temp;
|
|
|
|
}
|
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
|
|
|
|
|
|
|
/* copy header data */
|
|
|
|
for (walk = rtptheorapay->headers; walk; walk = g_list_next (walk)) {
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (walk->data);
|
|
|
|
|
2013-06-28 10:08:19 +00:00
|
|
|
gst_buffer_extract (buf, 0, data, gst_buffer_get_size (buf));
|
|
|
|
data += gst_buffer_get_size (buf);
|
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
|
|
|
}
|
2013-06-28 10:08:19 +00:00
|
|
|
rtptheorapay->need_headers = FALSE;
|
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
|
|
|
/* serialize to base64 */
|
2009-03-18 13:50:17 +00:00
|
|
|
configuration = g_base64_encode (config, configlen);
|
2010-05-07 13:42:23 +00:00
|
|
|
|
|
|
|
/* store for later re-sending */
|
2015-11-15 04:35:54 +00:00
|
|
|
g_free (rtptheorapay->config_data);
|
2010-05-07 13:42:23 +00:00
|
|
|
rtptheorapay->config_size = configlen - 4 - 3 - 2;
|
|
|
|
rtptheorapay->config_data = g_malloc (rtptheorapay->config_size);
|
|
|
|
rtptheorapay->config_extra_len = extralen;
|
|
|
|
memcpy (rtptheorapay->config_data, config + 4 + 3 + 2,
|
|
|
|
rtptheorapay->config_size);
|
|
|
|
|
2007-05-14 17:10:12 +00:00
|
|
|
g_free (config);
|
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
|
|
|
|
|
|
|
/* configure payloader settings */
|
2015-08-08 15:34:50 +00:00
|
|
|
switch (rtptheorapay->pixel_format) {
|
|
|
|
case 2:
|
|
|
|
sampling = "YCbCr-4:2:2";
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
sampling = "YCbCr-4:4:4";
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
sampling = "YCbCr-4:2:0";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
wstr = g_strdup_printf ("%d", rtptheorapay->width);
|
|
|
|
hstr = g_strdup_printf ("%d", rtptheorapay->height);
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_base_payload_set_options (basepayload, "video", TRUE, "THEORA",
|
2011-11-10 16:23:47 +00:00
|
|
|
90000);
|
|
|
|
res =
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_base_payload_set_outcaps (basepayload, "sampling", G_TYPE_STRING,
|
2015-08-08 15:34:50 +00:00
|
|
|
sampling, "width", G_TYPE_STRING, wstr, "height", G_TYPE_STRING,
|
2011-11-10 16:23:47 +00:00
|
|
|
hstr, "configuration", G_TYPE_STRING, configuration, "delivery-method",
|
|
|
|
G_TYPE_STRING, "inline",
|
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
|
|
|
/* don't set the other defaults
|
|
|
|
*/
|
|
|
|
NULL);
|
|
|
|
g_free (wstr);
|
|
|
|
g_free (hstr);
|
|
|
|
g_free (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
|
|
|
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_headers:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "finish headers");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_theora_pay_parse_id (GstRTPBasePayload * basepayload, guint8 * data,
|
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
|
|
|
guint size)
|
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay;
|
2015-08-08 15:34:50 +00:00
|
|
|
gint width, height, pixel_format;
|
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
|
|
|
|
|
|
|
rtptheorapay = GST_RTP_THEORA_PAY (basepayload);
|
|
|
|
|
|
|
|
if (G_UNLIKELY (size < 42))
|
|
|
|
goto too_short;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (memcmp (data, "\200theora", 7)))
|
|
|
|
goto invalid_start;
|
|
|
|
data += 7;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (data[0] != 3))
|
|
|
|
goto invalid_version;
|
|
|
|
if (G_UNLIKELY (data[1] != 2))
|
|
|
|
goto invalid_version;
|
|
|
|
data += 3;
|
|
|
|
|
|
|
|
width = GST_READ_UINT16_BE (data) << 4;
|
|
|
|
data += 2;
|
|
|
|
height = GST_READ_UINT16_BE (data) << 4;
|
2015-08-08 15:34:50 +00:00
|
|
|
data += 29;
|
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
|
|
|
|
2015-08-08 15:34:50 +00:00
|
|
|
pixel_format = (GST_READ_UINT8 (data) >> 3) & 0x03;
|
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
|
|
|
|
|
|
|
/* store values */
|
2015-08-08 15:34:50 +00:00
|
|
|
rtptheorapay->pixel_format = pixel_format;
|
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
|
|
|
rtptheorapay->width = width;
|
|
|
|
rtptheorapay->height = height;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
too_short:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (basepayload, STREAM, DECODE,
|
|
|
|
(NULL),
|
|
|
|
("Identification packet is too short, need at least 42, got %d", size));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_start:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (basepayload, STREAM, DECODE,
|
|
|
|
(NULL), ("Invalid header start in identification packet"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_version:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (basepayload, STREAM, DECODE,
|
|
|
|
(NULL), ("Invalid version"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
2010-05-04 14:57:11 +00:00
|
|
|
gst_rtp_theora_pay_payload_buffer (GstRtpTheoraPay * rtptheorapay, guint8 TDT,
|
2015-08-04 17:59:17 +00:00
|
|
|
GstBuffer * buffer, guint8 * data, guint size, GstClockTime timestamp,
|
|
|
|
GstClockTime duration, guint not_in_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
|
|
|
{
|
2010-05-04 14:57:35 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
2010-05-04 14:57:11 +00:00
|
|
|
guint newsize;
|
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
|
|
|
guint packet_len;
|
2010-05-04 14:57:11 +00:00
|
|
|
GstClockTime newduration;
|
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 flush;
|
|
|
|
guint plen;
|
|
|
|
guint8 *ppos, *payload;
|
|
|
|
gboolean fragmented;
|
2011-12-05 17:39:59 +00:00
|
|
|
GstRTPBuffer rtp = { 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
|
|
|
|
|
|
|
/* size increases with packet length and 2 bytes size eader. */
|
|
|
|
newduration = rtptheorapay->payload_duration;
|
|
|
|
if (duration != GST_CLOCK_TIME_NONE)
|
|
|
|
newduration += duration;
|
|
|
|
|
|
|
|
newsize = rtptheorapay->payload_pos + 2 + size;
|
|
|
|
packet_len = gst_rtp_buffer_calc_packet_len (newsize, 0, 0);
|
|
|
|
|
|
|
|
/* check buffer filled against length and max latency */
|
2011-11-11 11:25:01 +00:00
|
|
|
flush = gst_rtp_base_payload_is_filled (GST_RTP_BASE_PAYLOAD (rtptheorapay),
|
2010-05-04 14:57:11 +00:00
|
|
|
packet_len, newduration);
|
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
|
|
|
/* we can store up to 15 theora packets in one RTP packet. */
|
|
|
|
flush |= (rtptheorapay->payload_pkts == 15);
|
|
|
|
/* flush if we have a new TDT */
|
|
|
|
if (rtptheorapay->packet)
|
|
|
|
flush |= (rtptheorapay->payload_TDT != TDT);
|
|
|
|
if (flush)
|
2010-05-04 14:57:35 +00:00
|
|
|
ret = gst_rtp_theora_pay_flush_packet (rtptheorapay);
|
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
|
|
|
|
2015-08-08 15:42:22 +00:00
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
goto done;
|
|
|
|
|
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 new packet if we must */
|
|
|
|
if (!rtptheorapay->packet) {
|
|
|
|
gst_rtp_theora_pay_init_packet (rtptheorapay, TDT, timestamp);
|
|
|
|
}
|
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_rtp_buffer_map (rtptheorapay->packet, GST_MAP_WRITE, &rtp);
|
|
|
|
payload = gst_rtp_buffer_get_payload (&rtp);
|
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
|
|
|
ppos = payload + rtptheorapay->payload_pos;
|
|
|
|
fragmented = FALSE;
|
|
|
|
|
|
|
|
/* put buffer in packet, it either fits completely or needs to be fragmented
|
|
|
|
* over multiple RTP packets. */
|
2011-02-14 15:46:46 +00:00
|
|
|
do {
|
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
|
|
|
plen = MIN (rtptheorapay->payload_left - 2, size);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "append %u bytes", plen);
|
|
|
|
|
|
|
|
/* data is copied in the payload with a 2 byte length header */
|
2010-05-07 13:42:23 +00:00
|
|
|
ppos[0] = ((plen - not_in_length) >> 8) & 0xff;
|
|
|
|
ppos[1] = ((plen - not_in_length) & 0xff);
|
2011-02-14 15:46:46 +00:00
|
|
|
if (plen)
|
|
|
|
memcpy (&ppos[2], data, plen);
|
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
|
|
|
|
2015-08-04 17:59:17 +00:00
|
|
|
if (buffer) {
|
|
|
|
if (!rtptheorapay->packet_buffers
|
|
|
|
|| rtptheorapay->packet_buffers->data != (gpointer) buffer)
|
|
|
|
rtptheorapay->packet_buffers =
|
|
|
|
g_list_prepend (rtptheorapay->packet_buffers,
|
|
|
|
gst_buffer_ref (buffer));
|
|
|
|
} else {
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
for (l = rtptheorapay->headers; l; l = l->next)
|
|
|
|
rtptheorapay->packet_buffers =
|
|
|
|
g_list_prepend (rtptheorapay->packet_buffers,
|
2015-09-19 16:44:22 +00:00
|
|
|
gst_buffer_ref (l->data));
|
2015-08-04 17:59:17 +00:00
|
|
|
}
|
|
|
|
|
2010-05-07 13:42:23 +00:00
|
|
|
/* only first (only) configuration cuts length field */
|
|
|
|
/* NOTE: spec (if any) is not clear on this ... */
|
|
|
|
not_in_length = 0;
|
|
|
|
|
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
|
|
|
size -= plen;
|
|
|
|
data += plen;
|
|
|
|
|
|
|
|
rtptheorapay->payload_pos += plen + 2;
|
|
|
|
rtptheorapay->payload_left -= plen + 2;
|
|
|
|
|
|
|
|
if (fragmented) {
|
|
|
|
if (size == 0)
|
|
|
|
/* last fragment, set F to 0x3. */
|
|
|
|
rtptheorapay->payload_F = 0x3;
|
|
|
|
else
|
|
|
|
/* fragment continues, set F to 0x2. */
|
|
|
|
rtptheorapay->payload_F = 0x2;
|
|
|
|
} else {
|
|
|
|
if (size > 0) {
|
|
|
|
/* fragmented packet starts, set F to 0x1, mark ourselves as
|
|
|
|
* fragmented. */
|
|
|
|
rtptheorapay->payload_F = 0x1;
|
|
|
|
fragmented = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fragmented) {
|
2013-06-28 13:21:12 +00:00
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
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
|
|
|
/* fragmented packets are always flushed and have ptks of 0 */
|
|
|
|
rtptheorapay->payload_pkts = 0;
|
|
|
|
ret = gst_rtp_theora_pay_flush_packet (rtptheorapay);
|
|
|
|
|
|
|
|
if (size > 0) {
|
|
|
|
/* start new packet and get pointers. TDT stays the same. */
|
|
|
|
gst_rtp_theora_pay_init_packet (rtptheorapay,
|
|
|
|
rtptheorapay->payload_TDT, timestamp);
|
2011-07-10 19:50:19 +00:00
|
|
|
gst_rtp_buffer_map (rtptheorapay->packet, GST_MAP_WRITE, &rtp);
|
|
|
|
payload = gst_rtp_buffer_get_payload (&rtp);
|
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
|
|
|
ppos = payload + rtptheorapay->payload_pos;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* unfragmented packet, update stats for next packet, size == 0 and we
|
|
|
|
* exit the while loop */
|
|
|
|
rtptheorapay->payload_pkts++;
|
|
|
|
if (duration != GST_CLOCK_TIME_NONE)
|
|
|
|
rtptheorapay->payload_duration += duration;
|
|
|
|
}
|
2015-08-08 15:42:22 +00:00
|
|
|
} while (size && ret == GST_FLOW_OK);
|
2010-05-04 14:57:11 +00:00
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
if (rtp.buffer)
|
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
2015-08-08 15:42:22 +00:00
|
|
|
done:
|
2011-07-10 19:50:19 +00:00
|
|
|
|
2010-05-04 14:57:11 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
2011-11-11 11:25:01 +00:00
|
|
|
gst_rtp_theora_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
2010-05-04 14:57:11 +00:00
|
|
|
GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay;
|
|
|
|
GstFlowReturn ret;
|
2012-01-23 16:25:37 +00:00
|
|
|
GstMapInfo map;
|
2011-07-10 19:50:19 +00:00
|
|
|
gsize size;
|
2010-05-04 14:57:11 +00:00
|
|
|
guint8 *data;
|
|
|
|
GstClockTime duration, timestamp;
|
|
|
|
guint8 TDT;
|
2010-05-07 13:42:23 +00:00
|
|
|
gboolean keyframe = FALSE;
|
2010-05-04 14:57:11 +00:00
|
|
|
|
|
|
|
rtptheorapay = GST_RTP_THEORA_PAY (basepayload);
|
|
|
|
|
2012-01-23 16:25:37 +00:00
|
|
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
|
|
|
data = map.data;
|
|
|
|
size = map.size;
|
2010-05-04 14:57:11 +00:00
|
|
|
duration = GST_BUFFER_DURATION (buffer);
|
2015-06-10 12:33:50 +00:00
|
|
|
timestamp = GST_BUFFER_PTS (buffer);
|
2010-05-04 14:57:11 +00:00
|
|
|
|
2011-07-10 19:50:19 +00:00
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "size %" G_GSIZE_FORMAT
|
|
|
|
", duration %" GST_TIME_FORMAT, size, GST_TIME_ARGS (duration));
|
2010-05-04 14:57:11 +00:00
|
|
|
|
|
|
|
/* find packet type */
|
2011-02-14 15:46:46 +00:00
|
|
|
if (size == 0) {
|
|
|
|
TDT = 0;
|
|
|
|
keyframe = FALSE;
|
|
|
|
} else if (data[0] & 0x80) {
|
2010-05-04 14:57:11 +00:00
|
|
|
/* header */
|
|
|
|
if (data[0] == 0x80) {
|
|
|
|
/* identification, we need to parse this in order to get the clock rate.
|
|
|
|
*/
|
|
|
|
if (G_UNLIKELY (!gst_rtp_theora_pay_parse_id (basepayload, data, size)))
|
|
|
|
goto parse_id_failed;
|
|
|
|
TDT = 1;
|
|
|
|
} else if (data[0] == 0x81) {
|
|
|
|
/* comment */
|
|
|
|
TDT = 2;
|
|
|
|
} else if (data[0] == 0x82) {
|
|
|
|
/* setup */
|
|
|
|
TDT = 1;
|
|
|
|
} else
|
|
|
|
goto unknown_header;
|
2010-05-07 13:42:23 +00:00
|
|
|
} else {
|
2010-05-04 14:57:11 +00:00
|
|
|
/* data */
|
|
|
|
TDT = 0;
|
2010-05-07 13:42:23 +00:00
|
|
|
keyframe = ((data[0] & 0x40) == 0);
|
|
|
|
}
|
2010-05-04 14:57:11 +00:00
|
|
|
|
2013-06-28 10:08:19 +00:00
|
|
|
/* we need to collect the headers and construct a config string from them */
|
|
|
|
if (TDT != 0) {
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "collecting header, buffer %p", buffer);
|
|
|
|
/* append header to the list of headers */
|
|
|
|
gst_buffer_unmap (buffer, &map);
|
|
|
|
rtptheorapay->headers = g_list_append (rtptheorapay->headers, buffer);
|
|
|
|
ret = GST_FLOW_OK;
|
|
|
|
goto done;
|
2015-08-04 17:59:17 +00:00
|
|
|
} else if (rtptheorapay->headers && rtptheorapay->need_headers) {
|
|
|
|
if (!gst_rtp_theora_pay_finish_headers (basepayload))
|
|
|
|
goto header_error;
|
2010-05-04 14:57:11 +00:00
|
|
|
}
|
|
|
|
|
2010-05-07 13:42:23 +00:00
|
|
|
/* there is a config request, see if we need to insert it */
|
|
|
|
if (keyframe && (rtptheorapay->config_interval > 0) &&
|
|
|
|
rtptheorapay->config_data) {
|
|
|
|
gboolean send_config = FALSE;
|
2018-07-13 16:45:19 +00:00
|
|
|
GstClockTime running_time =
|
|
|
|
gst_segment_to_running_time (&basepayload->segment, GST_FORMAT_TIME,
|
|
|
|
timestamp);
|
2010-05-07 13:42:23 +00:00
|
|
|
|
|
|
|
if (rtptheorapay->last_config != -1) {
|
|
|
|
guint64 diff;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (rtptheorapay,
|
|
|
|
"now %" GST_TIME_FORMAT ", last VOP-I %" GST_TIME_FORMAT,
|
2018-07-13 16:45:19 +00:00
|
|
|
GST_TIME_ARGS (running_time),
|
|
|
|
GST_TIME_ARGS (rtptheorapay->last_config));
|
2010-05-07 13:42:23 +00:00
|
|
|
|
|
|
|
/* calculate diff between last config in milliseconds */
|
2018-07-13 16:45:19 +00:00
|
|
|
if (running_time > rtptheorapay->last_config) {
|
|
|
|
diff = running_time - rtptheorapay->last_config;
|
2010-05-07 13:42:23 +00:00
|
|
|
} else {
|
|
|
|
diff = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay,
|
|
|
|
"interval since last config %" GST_TIME_FORMAT, GST_TIME_ARGS (diff));
|
|
|
|
|
|
|
|
/* bigger than interval, queue config */
|
|
|
|
if (GST_TIME_AS_SECONDS (diff) >= rtptheorapay->config_interval) {
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "time to send config");
|
|
|
|
send_config = TRUE;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* no known previous config time, send now */
|
|
|
|
GST_DEBUG_OBJECT (rtptheorapay, "no previous config time, send now");
|
|
|
|
send_config = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (send_config) {
|
|
|
|
/* we need to send config now first */
|
|
|
|
/* different TDT type forces flush */
|
|
|
|
gst_rtp_theora_pay_payload_buffer (rtptheorapay, 1,
|
2015-08-04 17:59:17 +00:00
|
|
|
NULL, rtptheorapay->config_data, rtptheorapay->config_size,
|
2010-05-07 13:42:23 +00:00
|
|
|
timestamp, GST_CLOCK_TIME_NONE, rtptheorapay->config_extra_len);
|
|
|
|
|
2018-07-13 16:45:19 +00:00
|
|
|
if (running_time != -1) {
|
|
|
|
rtptheorapay->last_config = running_time;
|
2010-05-07 13:42:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-04 17:59:17 +00:00
|
|
|
ret =
|
|
|
|
gst_rtp_theora_pay_payload_buffer (rtptheorapay, TDT, buffer, data, size,
|
2010-05-07 13:42:23 +00:00
|
|
|
timestamp, duration, 0);
|
2011-07-10 19:50:19 +00:00
|
|
|
|
2012-01-23 16:25:37 +00:00
|
|
|
gst_buffer_unmap (buffer, &map);
|
2008-02-12 23:38:19 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
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
|
|
|
done:
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
parse_id_failed:
|
|
|
|
{
|
2012-01-23 16:25:37 +00:00
|
|
|
gst_buffer_unmap (buffer, &map);
|
2008-02-12 23:38:19 +00:00
|
|
|
gst_buffer_unref (buffer);
|
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
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
unknown_header:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_WARNING (rtptheorapay, STREAM, DECODE,
|
|
|
|
(NULL), ("Ignoring unknown header received"));
|
2012-01-23 16:25:37 +00:00
|
|
|
gst_buffer_unmap (buffer, &map);
|
2008-02-12 23:38:19 +00:00
|
|
|
gst_buffer_unref (buffer);
|
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
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
header_error:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_WARNING (rtptheorapay, STREAM, DECODE,
|
|
|
|
(NULL), ("Error initializing header config"));
|
2012-01-23 16:25:37 +00:00
|
|
|
gst_buffer_unmap (buffer, &map);
|
2008-02-12 23:38:19 +00:00
|
|
|
gst_buffer_unref (buffer);
|
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
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-21 12:55:40 +00:00
|
|
|
static gboolean
|
2011-11-15 15:31:45 +00:00
|
|
|
gst_rtp_theora_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
|
2010-12-21 12:55:40 +00:00
|
|
|
{
|
2011-07-10 19:50:19 +00:00
|
|
|
GstRtpTheoraPay *rtptheorapay = GST_RTP_THEORA_PAY (payload);
|
2010-12-21 12:55:40 +00:00
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
|
|
|
gst_rtp_theora_pay_clear_packet (rtptheorapay);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* false to let parent handle event as well */
|
2011-11-15 15:31:45 +00:00
|
|
|
return GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->sink_event (payload, event);
|
2010-12-21 12:55:40 +00:00
|
|
|
}
|
|
|
|
|
2008-02-12 23:38:19 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_rtp_theora_pay_change_state (GstElement * element,
|
|
|
|
GstStateChange transition)
|
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay;
|
2008-06-11 08:56:16 +00:00
|
|
|
|
2008-02-12 23:38:19 +00:00
|
|
|
GstStateChangeReturn ret;
|
|
|
|
|
|
|
|
rtptheorapay = GST_RTP_THEORA_PAY (element);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
|
|
|
gst_rtp_theora_pay_cleanup (rtptheorapay);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2010-05-07 13:42:23 +00:00
|
|
|
static void
|
|
|
|
gst_rtp_theora_pay_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay;
|
|
|
|
|
|
|
|
rtptheorapay = GST_RTP_THEORA_PAY (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_CONFIG_INTERVAL:
|
|
|
|
rtptheorapay->config_interval = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_rtp_theora_pay_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstRtpTheoraPay *rtptheorapay;
|
|
|
|
|
|
|
|
rtptheorapay = GST_RTP_THEORA_PAY (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_CONFIG_INTERVAL:
|
|
|
|
g_value_set_uint (value, rtptheorapay->config_interval);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|