gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2005> Wim Taymans <wim@fluendo.com>
|
|
|
|
*
|
|
|
|
* 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
|
2009-09-02 17:47:26 +00:00
|
|
|
* Library General Public License for more
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
*/
|
|
|
|
|
2007-04-21 15:10:25 +00:00
|
|
|
/**
|
2011-11-11 11:32:23 +00:00
|
|
|
* SECTION:gstrtpbasepayload
|
2017-01-23 19:36:11 +00:00
|
|
|
* @title: GstRTPBasePayload
|
2007-04-21 15:10:25 +00:00
|
|
|
* @short_description: Base class for RTP payloader
|
|
|
|
*
|
|
|
|
* Provides a base class for RTP payloaders
|
|
|
|
*/
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2011-07-09 03:06:46 +00:00
|
|
|
#include "config.h"
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <gst/rtp/gstrtpbuffer.h>
|
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
#include "gstrtpbasepayload.h"
|
2018-10-10 18:16:12 +00:00
|
|
|
#include "gstrtpmeta.h"
|
2020-07-10 05:33:46 +00:00
|
|
|
#include "gstrtphdrext.h"
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (rtpbasepayload_debug);
|
|
|
|
#define GST_CAT_DEFAULT (rtpbasepayload_debug)
|
check/pipelines/simple_launch_lines.c: Fix for bus API.
Original commit message from CVS:
* check/pipelines/simple_launch_lines.c: (run_pipeline):
Fix for bus API.
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_set_gst_timestamp),
(gst_base_rtp_depayload_queue_release):
Some cleanups.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
Added debugging category.
2005-09-19 11:24:46 +00:00
|
|
|
|
2020-07-15 07:51:18 +00:00
|
|
|
static gboolean enable_experimental_twcc = FALSE;
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
struct _GstRTPBasePayloadPrivate
|
2007-07-14 17:23:42 +00:00
|
|
|
{
|
|
|
|
gboolean ts_offset_random;
|
|
|
|
gboolean seqnum_offset_random;
|
|
|
|
gboolean ssrc_random;
|
|
|
|
guint16 next_seqnum;
|
2009-09-03 09:29:23 +00:00
|
|
|
gboolean perfect_rtptime;
|
2010-09-06 11:14:00 +00:00
|
|
|
gint notified_first_timestamp;
|
2009-12-02 14:10:58 +00:00
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
gboolean pt_set;
|
|
|
|
|
2018-10-10 18:16:12 +00:00
|
|
|
gboolean source_info;
|
|
|
|
GstBuffer *input_meta_buffer;
|
|
|
|
|
2011-07-09 03:06:46 +00:00
|
|
|
guint64 base_offset;
|
|
|
|
gint64 base_rtime;
|
2013-11-26 00:13:45 +00:00
|
|
|
guint64 base_rtime_hz;
|
2014-01-27 23:40:38 +00:00
|
|
|
guint64 running_time;
|
2020-03-09 14:26:42 +00:00
|
|
|
gboolean scale_rtptime;
|
2021-01-26 08:37:44 +00:00
|
|
|
gboolean auto_hdr_ext;
|
2011-07-09 03:06:46 +00:00
|
|
|
|
2009-12-02 14:10:58 +00:00
|
|
|
gint64 prop_max_ptime;
|
|
|
|
gint64 caps_max_ptime;
|
2012-09-06 17:16:54 +00:00
|
|
|
|
2018-11-19 22:42:14 +00:00
|
|
|
gboolean onvif_no_rate_control;
|
|
|
|
|
2012-09-06 17:16:54 +00:00
|
|
|
gboolean negotiated;
|
2013-05-12 13:55:38 +00:00
|
|
|
|
|
|
|
gboolean delay_segment;
|
|
|
|
GstEvent *pending_segment;
|
2014-05-02 23:09:59 +00:00
|
|
|
|
|
|
|
GstCaps *subclass_srccaps;
|
2014-03-15 16:35:56 +00:00
|
|
|
GstCaps *sinkcaps;
|
2020-07-10 05:33:46 +00:00
|
|
|
|
|
|
|
/* array of GstRTPHeaderExtension's * */
|
|
|
|
GPtrArray *header_exts;
|
2007-07-14 17:23:42 +00:00
|
|
|
};
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
/* RTPBasePayload signals and args */
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
enum
|
|
|
|
{
|
2020-07-10 05:33:46 +00:00
|
|
|
SIGNAL_0,
|
|
|
|
SIGNAL_REQUEST_EXTENSION,
|
|
|
|
SIGNAL_ADD_EXTENSION,
|
|
|
|
SIGNAL_CLEAR_EXTENSIONS,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
static guint gst_rtp_base_payload_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2009-09-02 17:47:26 +00:00
|
|
|
/* FIXME 0.11, a better default is the Ethernet MTU of
|
2006-07-19 18:20:43 +00:00
|
|
|
* 1500 - sizeof(headers) as pointed out by marcelm in IRC:
|
|
|
|
* So an Ethernet MTU of 1500, minus 60 for the max IP, minus 8 for UDP, gives
|
|
|
|
* 1432 bytes or so. And that should be adjusted downward further for other
|
|
|
|
* encapsulations like PPPoE, so 1400 at most.
|
|
|
|
*/
|
2007-09-04 16:18:48 +00:00
|
|
|
#define DEFAULT_MTU 1400
|
2005-12-06 19:42:02 +00:00
|
|
|
#define DEFAULT_PT 96
|
|
|
|
#define DEFAULT_SSRC -1
|
|
|
|
#define DEFAULT_TIMESTAMP_OFFSET -1
|
|
|
|
#define DEFAULT_SEQNUM_OFFSET -1
|
|
|
|
#define DEFAULT_MAX_PTIME -1
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
#define DEFAULT_MIN_PTIME 0
|
2009-09-03 09:29:23 +00:00
|
|
|
#define DEFAULT_PERFECT_RTPTIME TRUE
|
2010-04-09 14:06:05 +00:00
|
|
|
#define DEFAULT_PTIME_MULTIPLE 0
|
2014-01-27 23:40:38 +00:00
|
|
|
#define DEFAULT_RUNNING_TIME GST_CLOCK_TIME_NONE
|
2018-10-10 18:16:12 +00:00
|
|
|
#define DEFAULT_SOURCE_INFO FALSE
|
2018-11-19 22:42:14 +00:00
|
|
|
#define DEFAULT_ONVIF_NO_RATE_CONTROL FALSE
|
2020-03-09 14:26:42 +00:00
|
|
|
#define DEFAULT_SCALE_RTPTIME TRUE
|
2021-01-26 08:37:44 +00:00
|
|
|
#define DEFAULT_AUTO_HEADER_EXTENSION TRUE
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
#define RTP_HEADER_EXT_ONE_BYTE_MAX_SIZE 16
|
|
|
|
#define RTP_HEADER_EXT_TWO_BYTE_MAX_SIZE 256
|
|
|
|
#define RTP_HEADER_EXT_ONE_BYTE_MAX_ID 14
|
|
|
|
#define RTP_HEADER_EXT_TWO_BYTE_MAX_ID 255
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_MTU,
|
|
|
|
PROP_PT,
|
|
|
|
PROP_SSRC,
|
2005-09-20 11:50:20 +00:00
|
|
|
PROP_TIMESTAMP_OFFSET,
|
2005-09-20 13:34:02 +00:00
|
|
|
PROP_SEQNUM_OFFSET,
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
PROP_MAX_PTIME,
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
PROP_MIN_PTIME,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
PROP_TIMESTAMP,
|
2009-09-03 09:29:23 +00:00
|
|
|
PROP_SEQNUM,
|
|
|
|
PROP_PERFECT_RTPTIME,
|
2010-04-09 14:06:05 +00:00
|
|
|
PROP_PTIME_MULTIPLE,
|
2014-01-16 20:49:59 +00:00
|
|
|
PROP_STATS,
|
2018-10-10 18:16:12 +00:00
|
|
|
PROP_SOURCE_INFO,
|
2018-11-19 22:42:14 +00:00
|
|
|
PROP_ONVIF_NO_RATE_CONTROL,
|
2020-03-09 14:26:42 +00:00
|
|
|
PROP_SCALE_RTPTIME,
|
2021-01-26 08:37:44 +00:00
|
|
|
PROP_AUTO_HEADER_EXTENSION,
|
2009-09-03 09:29:23 +00:00
|
|
|
PROP_LAST
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
};
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
static void gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass);
|
2011-11-11 11:32:23 +00:00
|
|
|
static void gst_rtp_base_payload_init (GstRTPBasePayload * rtpbasepayload,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
gpointer g_class);
|
2011-11-11 11:24:08 +00:00
|
|
|
static void gst_rtp_base_payload_finalize (GObject * object);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-15 15:30:38 +00:00
|
|
|
static GstCaps *gst_rtp_base_payload_getcaps_default (GstRTPBasePayload *
|
|
|
|
rtpbasepayload, GstPad * pad, GstCaps * filter);
|
|
|
|
|
|
|
|
static gboolean gst_rtp_base_payload_sink_event_default (GstRTPBasePayload *
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload, GstEvent * event);
|
2011-11-15 15:30:38 +00:00
|
|
|
static gboolean gst_rtp_base_payload_sink_event (GstPad * pad,
|
2011-11-17 11:48:25 +00:00
|
|
|
GstObject * parent, GstEvent * event);
|
2013-12-12 12:06:30 +00:00
|
|
|
static gboolean gst_rtp_base_payload_src_event_default (GstRTPBasePayload *
|
|
|
|
rtpbasepayload, GstEvent * event);
|
|
|
|
static gboolean gst_rtp_base_payload_src_event (GstPad * pad,
|
|
|
|
GstObject * parent, GstEvent * event);
|
2011-11-15 15:30:38 +00:00
|
|
|
static gboolean gst_rtp_base_payload_query_default (GstRTPBasePayload *
|
|
|
|
rtpbasepayload, GstPad * pad, GstQuery * query);
|
2011-11-16 16:25:17 +00:00
|
|
|
static gboolean gst_rtp_base_payload_query (GstPad * pad, GstObject * parent,
|
|
|
|
GstQuery * query);
|
2011-11-11 11:24:08 +00:00
|
|
|
static GstFlowReturn gst_rtp_base_payload_chain (GstPad * pad,
|
2011-11-17 11:48:25 +00:00
|
|
|
GstObject * parent, GstBuffer * buffer);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
static void gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
const GValue * value, GParamSpec * pspec);
|
2011-11-11 11:24:08 +00:00
|
|
|
static void gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
static GstStateChangeReturn gst_rtp_base_payload_change_state (GstElement *
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
element, GstStateChange transition);
|
|
|
|
|
2014-05-02 23:09:59 +00:00
|
|
|
static gboolean gst_rtp_base_payload_negotiate (GstRTPBasePayload * payload);
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
static void gst_rtp_base_payload_add_extension (GstRTPBasePayload * payload,
|
|
|
|
GstRTPHeaderExtension * ext);
|
|
|
|
static void gst_rtp_base_payload_clear_extensions (GstRTPBasePayload * payload);
|
2014-05-02 23:09:59 +00:00
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
static GstElementClass *parent_class = NULL;
|
2018-06-23 19:33:16 +00:00
|
|
|
static gint private_offset = 0;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
GType
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_get_type (void)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
static GType rtpbasepayload_type = 0;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
if (g_once_init_enter ((gsize *) & rtpbasepayload_type)) {
|
|
|
|
static const GTypeInfo rtpbasepayload_info = {
|
2011-11-11 11:24:08 +00:00
|
|
|
sizeof (GstRTPBasePayloadClass),
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
NULL,
|
2011-11-10 16:18:00 +00:00
|
|
|
NULL,
|
2011-11-11 11:24:08 +00:00
|
|
|
(GClassInitFunc) gst_rtp_base_payload_class_init,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2011-11-11 11:24:08 +00:00
|
|
|
sizeof (GstRTPBasePayload),
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
0,
|
2011-11-11 11:24:08 +00:00
|
|
|
(GInstanceInitFunc) gst_rtp_base_payload_init,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
};
|
2018-06-23 19:33:16 +00:00
|
|
|
GType _type;
|
|
|
|
|
|
|
|
_type = g_type_register_static (GST_TYPE_ELEMENT, "GstRTPBasePayload",
|
|
|
|
&rtpbasepayload_info, G_TYPE_FLAG_ABSTRACT);
|
|
|
|
|
|
|
|
private_offset =
|
|
|
|
g_type_add_instance_private (_type, sizeof (GstRTPBasePayloadPrivate));
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2018-06-23 19:33:16 +00:00
|
|
|
g_once_init_leave ((gsize *) & rtpbasepayload_type, _type);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
}
|
2011-11-11 11:32:23 +00:00
|
|
|
return rtpbasepayload_type;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
}
|
|
|
|
|
2018-06-23 19:33:16 +00:00
|
|
|
static inline GstRTPBasePayloadPrivate *
|
|
|
|
gst_rtp_base_payload_get_instance_private (GstRTPBasePayload * self)
|
|
|
|
{
|
|
|
|
return (G_STRUCT_MEMBER_P (self, private_offset));
|
|
|
|
}
|
|
|
|
|
2021-01-26 08:37:44 +00:00
|
|
|
static GstRTPHeaderExtension *
|
|
|
|
gst_rtp_base_payload_request_extension_default (GstRTPBasePayload * payload,
|
|
|
|
guint ext_id, const gchar * uri)
|
|
|
|
{
|
|
|
|
GstRTPHeaderExtension *ext = NULL;
|
|
|
|
|
|
|
|
if (!payload->priv->auto_hdr_ext)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
ext = gst_rtp_header_extension_create_from_uri (uri);
|
|
|
|
if (ext) {
|
|
|
|
GST_DEBUG_OBJECT (payload,
|
|
|
|
"Automatically enabled extension %s for uri \'%s\'",
|
|
|
|
GST_ELEMENT_NAME (ext), uri);
|
|
|
|
|
|
|
|
gst_rtp_header_extension_set_id (ext, ext_id);
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (payload,
|
|
|
|
"Didn't find any extension implementing uri \'%s\'", uri);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ext;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
extension_accumulator (GSignalInvocationHint * ihint,
|
|
|
|
GValue * return_accu, const GValue * handler_return, gpointer data)
|
|
|
|
{
|
|
|
|
gpointer ext;
|
|
|
|
|
|
|
|
/* Call default handler if user callback didn't create the extension */
|
|
|
|
ext = g_value_get_object (handler_return);
|
|
|
|
if (!ext)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
g_value_set_object (return_accu, ext);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
static void
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
|
2020-07-15 07:51:18 +00:00
|
|
|
if (g_getenv ("GST_RTP_ENABLE_EXPERIMENTAL_TWCC_PROPERTY"))
|
|
|
|
enable_experimental_twcc = TRUE;
|
|
|
|
|
2018-06-23 19:33:16 +00:00
|
|
|
if (private_offset != 0)
|
|
|
|
g_type_class_adjust_private_offset (klass, &private_offset);
|
2007-07-14 17:23:42 +00:00
|
|
|
|
2006-04-08 21:02:53 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
gobject_class->finalize = gst_rtp_base_payload_finalize;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
gobject_class->set_property = gst_rtp_base_payload_set_property;
|
|
|
|
gobject_class->get_property = gst_rtp_base_payload_get_property;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MTU,
|
|
|
|
g_param_spec_uint ("mtu", "MTU",
|
|
|
|
"Maximum size of one packet",
|
2008-03-22 15:00:53 +00:00
|
|
|
28, G_MAXUINT, DEFAULT_MTU,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
|
|
|
|
g_param_spec_uint ("pt", "payload type",
|
2014-01-30 23:18:35 +00:00
|
|
|
"The payload type of the packets", 0, 0x7f, DEFAULT_PT,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
|
2007-07-16 10:10:28 +00:00
|
|
|
g_param_spec_uint ("ssrc", "SSRC",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The SSRC of the packets (default == random)", 0, G_MAXUINT32,
|
|
|
|
DEFAULT_SSRC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2005-09-20 11:50:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2007-07-16 10:10:28 +00:00
|
|
|
PROP_TIMESTAMP_OFFSET, g_param_spec_uint ("timestamp-offset",
|
2005-09-20 11:50:20 +00:00
|
|
|
"Timestamp Offset",
|
2007-07-16 10:10:28 +00:00
|
|
|
"Offset to add to all outgoing timestamps (default = random)", 0,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_MAXUINT32, DEFAULT_TIMESTAMP_OFFSET,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2005-09-20 13:34:02 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM_OFFSET,
|
|
|
|
g_param_spec_int ("seqnum-offset", "Sequence number Offset",
|
2007-07-14 17:23:42 +00:00
|
|
|
"Offset to add to all outgoing seqnum (-1 = random)", -1, G_MAXUINT16,
|
2008-03-22 15:00:53 +00:00
|
|
|
DEFAULT_SEQNUM_OFFSET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_PTIME,
|
|
|
|
g_param_spec_int64 ("max-ptime", "Max packet time",
|
|
|
|
"Maximum duration of the packet data in ns (-1 = unlimited up to MTU)",
|
2008-03-22 15:00:53 +00:00
|
|
|
-1, G_MAXINT64, DEFAULT_MAX_PTIME,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
/**
|
2014-01-16 15:58:43 +00:00
|
|
|
* GstRTPBasePayload:min-ptime:
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
*
|
|
|
|
* Minimum duration of the packet data in ns (can't go above MTU)
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MIN_PTIME,
|
|
|
|
g_param_spec_int64 ("min-ptime", "Min packet time",
|
|
|
|
"Minimum duration of the packet data in ns (can't go above MTU)",
|
2008-03-22 15:00:53 +00:00
|
|
|
0, G_MAXINT64, DEFAULT_MIN_PTIME,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2005-09-20 13:34:02 +00:00
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TIMESTAMP,
|
|
|
|
g_param_spec_uint ("timestamp", "Timestamp",
|
2005-09-20 13:34:02 +00:00
|
|
|
"The RTP timestamp of the last processed packet",
|
2008-03-22 15:00:53 +00:00
|
|
|
0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM,
|
|
|
|
g_param_spec_uint ("seqnum", "Sequence number",
|
2005-09-20 13:34:02 +00:00
|
|
|
"The RTP sequence number of the last processed packet",
|
2008-03-22 15:00:53 +00:00
|
|
|
0, G_MAXUINT16, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2009-09-03 09:29:23 +00:00
|
|
|
/**
|
2014-01-16 15:58:43 +00:00
|
|
|
* GstRTPBasePayload:perfect-rtptime:
|
2009-09-03 09:29:23 +00:00
|
|
|
*
|
2014-01-22 16:47:02 +00:00
|
|
|
* Try to use the offset fields to generate perfect RTP timestamps. When this
|
|
|
|
* option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of
|
|
|
|
* each payloaded buffer. The PTSes of buffers may not necessarily increment
|
|
|
|
* with the amount of data in each input buffer, consider e.g. the case where
|
|
|
|
* the buffer arrives from a network which means that the PTS is unrelated to
|
|
|
|
* the amount of data. Because the RTP timestamps are generated from
|
|
|
|
* GST_BUFFER_PTS this can result in RTP timestamps that also don't increment
|
|
|
|
* with the amount of data in the payloaded packet. To circumvent this it is
|
|
|
|
* possible to set the perfect rtptime option enabled. When this option is
|
|
|
|
* enabled the payloader will increment the RTP timestamps based on
|
|
|
|
* GST_BUFFER_OFFSET which relates to the amount of data in each packet
|
|
|
|
* rather than the GST_BUFFER_PTS of each buffer and therefore the RTP
|
|
|
|
* timestamps will more closely correlate with the amount of data in each
|
|
|
|
* buffer. Currently GstRTPBasePayload is limited to handling perfect RTP
|
|
|
|
* timestamps for audio streams.
|
2009-09-03 09:29:23 +00:00
|
|
|
*/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PERFECT_RTPTIME,
|
|
|
|
g_param_spec_boolean ("perfect-rtptime", "Perfect RTP Time",
|
|
|
|
"Generate perfect RTP timestamps when possible",
|
|
|
|
DEFAULT_PERFECT_RTPTIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-04-09 14:06:05 +00:00
|
|
|
/**
|
2014-01-16 15:58:43 +00:00
|
|
|
* GstRTPBasePayload:ptime-multiple:
|
2010-04-09 14:06:05 +00:00
|
|
|
*
|
|
|
|
* Force buffers to be multiples of this duration in ns (0 disables)
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PTIME_MULTIPLE,
|
|
|
|
g_param_spec_int64 ("ptime-multiple", "Packet time multiple",
|
|
|
|
"Force buffers to be multiples of this duration in ns (0 disables)",
|
|
|
|
0, G_MAXINT64, DEFAULT_PTIME_MULTIPLE,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2009-09-03 09:29:23 +00:00
|
|
|
|
2014-01-16 20:49:59 +00:00
|
|
|
/**
|
|
|
|
* GstRTPBasePayload:stats:
|
|
|
|
*
|
|
|
|
* Various payloader statistics retrieved atomically (and are therefore
|
|
|
|
* synchroized with each other), these can be used e.g. to generate an
|
|
|
|
* RTP-Info header. This property return a GstStructure named
|
|
|
|
* application/x-rtp-payload-stats containing the following fields relating to
|
|
|
|
* the last processed buffer and current state of the stream being payloaded:
|
|
|
|
*
|
2017-01-23 19:36:11 +00:00
|
|
|
* * `clock-rate` :#G_TYPE_UINT, clock-rate of the stream
|
|
|
|
* * `running-time` :#G_TYPE_UINT64, running time
|
|
|
|
* * `seqnum` :#G_TYPE_UINT, sequence number, same as #GstRTPBasePayload:seqnum
|
|
|
|
* * `timestamp` :#G_TYPE_UINT, RTP timestamp, same as #GstRTPBasePayload:timestamp
|
|
|
|
* * `ssrc` :#G_TYPE_UINT, The SSRC in use
|
|
|
|
* * `pt` :#G_TYPE_UINT, The Payload type in use, same as #GstRTPBasePayload:pt
|
|
|
|
* * `seqnum-offset` :#G_TYPE_UINT, The current offset added to the seqnum
|
|
|
|
* * `timestamp-offset` :#G_TYPE_UINT, The current offset added to the timestamp
|
2014-01-16 20:49:59 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_STATS,
|
|
|
|
g_param_spec_boxed ("stats", "Statistics", "Various statistics",
|
|
|
|
GST_TYPE_STRUCTURE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2018-10-10 18:16:12 +00:00
|
|
|
/**
|
|
|
|
* GstRTPBasePayload:source-info:
|
|
|
|
*
|
|
|
|
* Enable writing the CSRC field in allocated RTP header based on RTP source
|
|
|
|
* information found in the input buffer's #GstRTPSourceMeta.
|
|
|
|
*
|
|
|
|
* Since: 1.16
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_SOURCE_INFO,
|
|
|
|
g_param_spec_boolean ("source-info", "RTP source information",
|
|
|
|
"Write CSRC based on buffer meta RTP source information",
|
|
|
|
DEFAULT_SOURCE_INFO, G_PARAM_READWRITE));
|
|
|
|
|
2018-11-19 22:42:14 +00:00
|
|
|
/**
|
|
|
|
* GstRTPBasePayload:onvif-no-rate-control:
|
|
|
|
*
|
|
|
|
* Make the payloader timestamp packets according to the Rate-Control=no
|
|
|
|
* behaviour specified in the ONVIF replay spec.
|
|
|
|
*
|
|
|
|
* Since: 1.16
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
|
|
|
PROP_ONVIF_NO_RATE_CONTROL, g_param_spec_boolean ("onvif-no-rate-control",
|
|
|
|
"ONVIF no rate control",
|
|
|
|
"Enable ONVIF Rate-Control=no timestamping mode",
|
|
|
|
DEFAULT_ONVIF_NO_RATE_CONTROL,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2020-03-09 14:26:42 +00:00
|
|
|
/**
|
|
|
|
* GstRTPBasePayload:scale-rtptime:
|
|
|
|
*
|
|
|
|
* Make the RTP packets' timestamps be scaled with the segment's rate
|
|
|
|
* (corresponding to RTSP speed parameter). Disabling this property means
|
|
|
|
* the timestamps will not be affected by the set delivery speed (RTSP speed).
|
|
|
|
*
|
|
|
|
* Example: A server wants to allow streaming a recorded video in double
|
|
|
|
* speed but still have the timestamps correspond to the position in the
|
|
|
|
* video. This is achieved by the client setting RTSP Speed to 2 while the
|
|
|
|
* server has this property disabled.
|
|
|
|
*
|
|
|
|
* Since: 1.18
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SCALE_RTPTIME,
|
|
|
|
g_param_spec_boolean ("scale-rtptime", "Scale RTP time",
|
|
|
|
"Whether the RTP timestamp should be scaled with the rate (speed)",
|
|
|
|
DEFAULT_SCALE_RTPTIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2020-02-14 09:40:59 +00:00
|
|
|
|
2021-01-26 08:37:44 +00:00
|
|
|
/**
|
|
|
|
* GstRTPBasePayload:auto-header-extension:
|
|
|
|
*
|
|
|
|
* If enabled, the payloader will automatically try to enable all the
|
|
|
|
* RTP header extensions provided in the src caps, saving the application
|
|
|
|
* the need to handle these extensions manually using the
|
|
|
|
* GstRTPBasePayload::request-extension: signal.
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
|
|
|
PROP_AUTO_HEADER_EXTENSION, g_param_spec_boolean ("auto-header-extension",
|
|
|
|
"Automatic RTP header extension",
|
|
|
|
"Whether RTP header extensions should be automatically enabled, if an implementation is available",
|
|
|
|
DEFAULT_AUTO_HEADER_EXTENSION,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
/**
|
|
|
|
* GstRTPBasePayload::add-extension:
|
|
|
|
* @object: the #GstRTPBasePayload
|
|
|
|
* @ext: (transfer full): the #GstRTPHeaderExtension
|
|
|
|
*
|
|
|
|
* Add @ext as an extension for writing part of an RTP header extension onto
|
|
|
|
* outgoing RTP packets.
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
|
|
|
gst_rtp_base_payload_signals[SIGNAL_ADD_EXTENSION] =
|
|
|
|
g_signal_new_class_handler ("add-extension", G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
G_CALLBACK (gst_rtp_base_payload_add_extension), NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 1, GST_TYPE_RTP_HEADER_EXTENSION);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstRTPBasePayload::request-extension:
|
|
|
|
* @object: the #GstRTPBasePayload
|
|
|
|
* @ext_id: the extension id being requested
|
|
|
|
* @ext_uri: the extension URI being requested
|
|
|
|
*
|
|
|
|
* The returned @ext must be configured with the correct @ext_id and with the
|
|
|
|
* necessary attributes as required by the extension implementation.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the #GstRTPHeaderExtension for @ext_id, or %NULL
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
|
|
|
gst_rtp_base_payload_signals[SIGNAL_REQUEST_EXTENSION] =
|
|
|
|
g_signal_new_class_handler ("request-extension",
|
2021-01-26 08:37:44 +00:00
|
|
|
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
|
|
|
G_CALLBACK (gst_rtp_base_payload_request_extension_default),
|
|
|
|
extension_accumulator, NULL, NULL,
|
2020-07-10 05:33:46 +00:00
|
|
|
GST_TYPE_RTP_HEADER_EXTENSION, 2, G_TYPE_UINT, G_TYPE_STRING);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstRTPBasePayload::clear-extensions:
|
|
|
|
* @object: the #GstRTPBasePayload
|
|
|
|
*
|
|
|
|
* Clear all RTP header extensions used by this payloader.
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
2021-01-25 13:25:45 +00:00
|
|
|
gst_rtp_base_payload_signals[SIGNAL_CLEAR_EXTENSIONS] =
|
2020-07-10 05:33:46 +00:00
|
|
|
g_signal_new_class_handler ("clear-extensions", G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
G_CALLBACK (gst_rtp_base_payload_clear_extensions), NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
gstelement_class->change_state = gst_rtp_base_payload_change_state;
|
check/pipelines/simple_launch_lines.c: Fix for bus API.
Original commit message from CVS:
* check/pipelines/simple_launch_lines.c: (run_pipeline):
Fix for bus API.
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_set_gst_timestamp),
(gst_base_rtp_depayload_queue_release):
Some cleanups.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
Added debugging category.
2005-09-19 11:24:46 +00:00
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
klass->get_caps = gst_rtp_base_payload_getcaps_default;
|
2011-11-15 15:30:38 +00:00
|
|
|
klass->sink_event = gst_rtp_base_payload_sink_event_default;
|
2013-12-12 12:06:30 +00:00
|
|
|
klass->src_event = gst_rtp_base_payload_src_event_default;
|
2011-11-15 15:30:38 +00:00
|
|
|
klass->query = gst_rtp_base_payload_query_default;
|
2011-06-02 17:21:24 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (rtpbasepayload_debug, "rtpbasepayload", 0,
|
check/pipelines/simple_launch_lines.c: Fix for bus API.
Original commit message from CVS:
* check/pipelines/simple_launch_lines.c: (run_pipeline):
Fix for bus API.
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_set_gst_timestamp),
(gst_base_rtp_depayload_queue_release):
Some cleanups.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
Added debugging category.
2005-09-19 11:24:46 +00:00
|
|
|
"Base class for RTP Payloaders");
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-11-11 11:32:23 +00:00
|
|
|
gst_rtp_base_payload_init (GstRTPBasePayload * rtpbasepayload, gpointer g_class)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
|
|
|
GstPadTemplate *templ;
|
2011-11-11 11:24:08 +00:00
|
|
|
GstRTPBasePayloadPrivate *priv;
|
2007-07-14 17:23:42 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->priv = priv =
|
2018-06-23 19:33:16 +00:00
|
|
|
gst_rtp_base_payload_get_instance_private (rtpbasepayload);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
templ =
|
|
|
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
|
|
|
|
g_return_if_fail (templ != NULL);
|
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->srcpad = gst_pad_new_from_template (templ, "src");
|
2013-12-12 12:06:30 +00:00
|
|
|
gst_pad_set_event_function (rtpbasepayload->srcpad,
|
|
|
|
gst_rtp_base_payload_src_event);
|
2011-11-11 11:32:23 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (rtpbasepayload), rtpbasepayload->srcpad);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
templ =
|
|
|
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
|
|
|
|
g_return_if_fail (templ != NULL);
|
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
|
|
|
gst_pad_set_chain_function (rtpbasepayload->sinkpad,
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_chain);
|
2011-11-15 15:30:38 +00:00
|
|
|
gst_pad_set_event_function (rtpbasepayload->sinkpad,
|
|
|
|
gst_rtp_base_payload_sink_event);
|
|
|
|
gst_pad_set_query_function (rtpbasepayload->sinkpad,
|
|
|
|
gst_rtp_base_payload_query);
|
2011-11-11 11:32:23 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (rtpbasepayload), rtpbasepayload->sinkpad);
|
|
|
|
|
|
|
|
rtpbasepayload->mtu = DEFAULT_MTU;
|
|
|
|
rtpbasepayload->pt = DEFAULT_PT;
|
|
|
|
rtpbasepayload->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
|
|
|
|
rtpbasepayload->ssrc = DEFAULT_SSRC;
|
|
|
|
rtpbasepayload->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
|
2014-01-27 23:40:38 +00:00
|
|
|
priv->running_time = DEFAULT_RUNNING_TIME;
|
2011-11-11 11:32:23 +00:00
|
|
|
priv->seqnum_offset_random = (rtpbasepayload->seqnum_offset == -1);
|
|
|
|
priv->ts_offset_random = (rtpbasepayload->ts_offset == -1);
|
|
|
|
priv->ssrc_random = (rtpbasepayload->ssrc == -1);
|
2015-05-19 13:32:38 +00:00
|
|
|
priv->pt_set = FALSE;
|
2018-10-10 18:16:12 +00:00
|
|
|
priv->source_info = DEFAULT_SOURCE_INFO;
|
2011-11-11 11:32:23 +00:00
|
|
|
|
|
|
|
rtpbasepayload->max_ptime = DEFAULT_MAX_PTIME;
|
|
|
|
rtpbasepayload->min_ptime = DEFAULT_MIN_PTIME;
|
|
|
|
rtpbasepayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
|
2011-11-11 18:21:09 +00:00
|
|
|
rtpbasepayload->ptime_multiple = DEFAULT_PTIME_MULTIPLE;
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
2013-11-26 00:13:45 +00:00
|
|
|
rtpbasepayload->priv->base_rtime_hz = GST_BUFFER_OFFSET_NONE;
|
2018-11-19 22:42:14 +00:00
|
|
|
rtpbasepayload->priv->onvif_no_rate_control = DEFAULT_ONVIF_NO_RATE_CONTROL;
|
2020-03-09 14:26:42 +00:00
|
|
|
rtpbasepayload->priv->scale_rtptime = DEFAULT_SCALE_RTPTIME;
|
2021-01-26 08:37:44 +00:00
|
|
|
rtpbasepayload->priv->auto_hdr_ext = DEFAULT_AUTO_HEADER_EXTENSION;
|
2011-11-11 11:32:23 +00:00
|
|
|
|
|
|
|
rtpbasepayload->media = NULL;
|
|
|
|
rtpbasepayload->encoding_name = NULL;
|
|
|
|
|
|
|
|
rtpbasepayload->clock_rate = 0;
|
|
|
|
|
|
|
|
rtpbasepayload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
|
|
|
rtpbasepayload->priv->prop_max_ptime = DEFAULT_MAX_PTIME;
|
2020-07-10 05:33:46 +00:00
|
|
|
rtpbasepayload->priv->header_exts =
|
|
|
|
g_ptr_array_new_with_free_func ((GDestroyNotify) gst_object_unref);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_finalize (GObject * object)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
g_free (rtpbasepayload->media);
|
|
|
|
rtpbasepayload->media = NULL;
|
|
|
|
g_free (rtpbasepayload->encoding_name);
|
|
|
|
rtpbasepayload->encoding_name = NULL;
|
2006-10-12 19:09:06 +00:00
|
|
|
|
2014-05-02 23:09:59 +00:00
|
|
|
gst_caps_replace (&rtpbasepayload->priv->subclass_srccaps, NULL);
|
2014-03-15 16:35:56 +00:00
|
|
|
gst_caps_replace (&rtpbasepayload->priv->sinkcaps, NULL);
|
2014-05-02 23:09:59 +00:00
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
g_ptr_array_unref (rtpbasepayload->priv->header_exts);
|
|
|
|
rtpbasepayload->priv->header_exts = NULL;
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2007-08-16 16:06:21 +00:00
|
|
|
static GstCaps *
|
2011-11-11 11:32:23 +00:00
|
|
|
gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * rtpbasepayload,
|
2011-11-10 16:18:00 +00:00
|
|
|
GstPad * pad, GstCaps * filter)
|
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
|
|
|
|
GST_DEBUG_OBJECT (pad,
|
|
|
|
"using pad template %p with caps %p %" GST_PTR_FORMAT,
|
|
|
|
GST_PAD_PAD_TEMPLATE (pad), caps, caps);
|
|
|
|
|
|
|
|
if (filter)
|
|
|
|
caps = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
|
|
|
else
|
|
|
|
caps = gst_caps_ref (caps);
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
2005-11-30 19:08:14 +00:00
|
|
|
static gboolean
|
2011-11-15 15:30:38 +00:00
|
|
|
gst_rtp_base_payload_sink_event_default (GstRTPBasePayload * rtpbasepayload,
|
2011-06-02 17:21:24 +00:00
|
|
|
GstEvent * event)
|
2005-11-30 19:08:14 +00:00
|
|
|
{
|
2011-11-17 11:48:25 +00:00
|
|
|
GstObject *parent = GST_OBJECT_CAST (rtpbasepayload);
|
2011-06-02 17:21:24 +00:00
|
|
|
gboolean res = FALSE;
|
2005-11-30 19:08:14 +00:00
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_FLUSH_START:
|
2011-11-17 11:48:25 +00:00
|
|
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, parent, event);
|
2005-11-30 19:08:14 +00:00
|
|
|
break;
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
2011-11-17 11:48:25 +00:00
|
|
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, parent, event);
|
2011-11-11 11:32:23 +00:00
|
|
|
gst_segment_init (&rtpbasepayload->segment, GST_FORMAT_UNDEFINED);
|
2013-05-12 13:55:38 +00:00
|
|
|
gst_event_replace (&rtpbasepayload->priv->pending_segment, NULL);
|
2005-11-30 19:08:14 +00:00
|
|
|
break;
|
2011-06-02 17:21:24 +00:00
|
|
|
case GST_EVENT_CAPS:
|
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
2011-06-02 17:21:24 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
gst_event_parse_caps (event, &caps);
|
2011-11-11 11:32:23 +00:00
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload, "setting caps %" GST_PTR_FORMAT, caps);
|
2011-06-02 17:21:24 +00:00
|
|
|
|
2014-03-15 16:35:56 +00:00
|
|
|
gst_caps_replace (&rtpbasepayload->priv->sinkcaps, caps);
|
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
|
|
|
if (rtpbasepayload_class->set_caps)
|
|
|
|
res = rtpbasepayload_class->set_caps (rtpbasepayload, caps);
|
2012-09-06 16:47:01 +00:00
|
|
|
else
|
2014-05-02 23:09:59 +00:00
|
|
|
res = gst_rtp_base_payload_negotiate (rtpbasepayload);
|
2011-06-07 10:06:22 +00:00
|
|
|
|
2012-09-06 17:16:54 +00:00
|
|
|
rtpbasepayload->priv->negotiated = res;
|
|
|
|
|
2011-06-07 10:06:22 +00:00
|
|
|
gst_event_unref (event);
|
2011-06-02 17:21:24 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-05-16 11:48:11 +00:00
|
|
|
case GST_EVENT_SEGMENT:
|
2005-11-30 19:08:14 +00:00
|
|
|
{
|
2010-12-20 17:28:14 +00:00
|
|
|
GstSegment *segment;
|
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
segment = &rtpbasepayload->segment;
|
2011-05-18 15:23:18 +00:00
|
|
|
gst_event_copy_segment (event, segment);
|
2010-12-20 17:28:14 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
2011-07-09 03:06:46 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload,
|
2011-05-16 11:48:11 +00:00
|
|
|
"configured SEGMENT %" GST_SEGMENT_FORMAT, segment);
|
2013-05-12 13:55:38 +00:00
|
|
|
if (rtpbasepayload->priv->delay_segment) {
|
|
|
|
gst_event_replace (&rtpbasepayload->priv->pending_segment, event);
|
2013-06-26 12:36:17 +00:00
|
|
|
gst_event_unref (event);
|
2013-05-12 13:55:38 +00:00
|
|
|
res = TRUE;
|
|
|
|
} else {
|
|
|
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, parent, event);
|
|
|
|
}
|
2011-06-02 17:21:24 +00:00
|
|
|
break;
|
2007-09-14 20:52:00 +00:00
|
|
|
}
|
2020-08-21 01:06:04 +00:00
|
|
|
case GST_EVENT_GAP:
|
|
|
|
{
|
|
|
|
if (G_UNLIKELY (rtpbasepayload->priv->pending_segment)) {
|
|
|
|
gst_pad_push_event (rtpbasepayload->srcpad,
|
|
|
|
rtpbasepayload->priv->pending_segment);
|
|
|
|
rtpbasepayload->priv->pending_segment = FALSE;
|
|
|
|
rtpbasepayload->priv->delay_segment = FALSE;
|
|
|
|
}
|
|
|
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, parent, event);
|
|
|
|
break;
|
|
|
|
}
|
2005-11-30 19:08:14 +00:00
|
|
|
default:
|
2011-11-17 11:48:25 +00:00
|
|
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, parent, event);
|
2005-11-30 19:08:14 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-02 17:21:24 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-17 11:48:25 +00:00
|
|
|
gst_rtp_base_payload_sink_event (GstPad * pad, GstObject * parent,
|
|
|
|
GstEvent * event)
|
2011-06-02 17:21:24 +00:00
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
|
|
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
2011-06-02 17:21:24 +00:00
|
|
|
gboolean res = FALSE;
|
|
|
|
|
2011-11-17 11:48:25 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (parent);
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
2011-06-02 17:21:24 +00:00
|
|
|
|
2011-11-15 15:30:38 +00:00
|
|
|
if (rtpbasepayload_class->sink_event)
|
|
|
|
res = rtpbasepayload_class->sink_event (rtpbasepayload, event);
|
2011-06-02 17:21:24 +00:00
|
|
|
else
|
|
|
|
gst_event_unref (event);
|
2005-11-30 19:08:14 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2013-12-12 12:06:30 +00:00
|
|
|
static gboolean
|
|
|
|
gst_rtp_base_payload_src_event_default (GstRTPBasePayload * rtpbasepayload,
|
|
|
|
GstEvent * event)
|
|
|
|
{
|
|
|
|
GstObject *parent = GST_OBJECT_CAST (rtpbasepayload);
|
2013-12-12 12:42:59 +00:00
|
|
|
gboolean res = TRUE, forward = TRUE;
|
2013-12-12 12:06:30 +00:00
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
2013-12-12 12:42:59 +00:00
|
|
|
case GST_EVENT_CUSTOM_UPSTREAM:
|
|
|
|
{
|
|
|
|
const GstStructure *s = gst_event_get_structure (event);
|
|
|
|
|
|
|
|
if (gst_structure_has_name (s, "GstRTPCollision")) {
|
|
|
|
guint ssrc = 0;
|
|
|
|
|
|
|
|
if (!gst_structure_get_uint (s, "ssrc", &ssrc))
|
|
|
|
ssrc = -1;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload, "collided ssrc: %" G_GUINT32_FORMAT,
|
|
|
|
ssrc);
|
|
|
|
|
|
|
|
/* choose another ssrc for our stream */
|
|
|
|
if (ssrc == rtpbasepayload->current_ssrc) {
|
|
|
|
GstCaps *caps;
|
2013-12-26 15:47:46 +00:00
|
|
|
guint suggested_ssrc = 0;
|
2013-12-12 12:42:59 +00:00
|
|
|
|
2013-12-26 15:47:46 +00:00
|
|
|
if (gst_structure_get_uint (s, "suggested-ssrc", &suggested_ssrc))
|
|
|
|
rtpbasepayload->current_ssrc = suggested_ssrc;
|
|
|
|
|
|
|
|
while (ssrc == rtpbasepayload->current_ssrc)
|
2013-12-12 12:42:59 +00:00
|
|
|
rtpbasepayload->current_ssrc = g_random_int ();
|
|
|
|
|
|
|
|
caps = gst_pad_get_current_caps (rtpbasepayload->srcpad);
|
2016-02-23 16:23:45 +00:00
|
|
|
if (caps) {
|
|
|
|
caps = gst_caps_make_writable (caps);
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"ssrc", G_TYPE_UINT, rtpbasepayload->current_ssrc, NULL);
|
|
|
|
res = gst_pad_set_caps (rtpbasepayload->srcpad, caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
2013-12-12 12:42:59 +00:00
|
|
|
|
|
|
|
/* the event was for us */
|
|
|
|
forward = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2013-12-12 12:06:30 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2013-12-12 12:42:59 +00:00
|
|
|
|
|
|
|
if (forward)
|
|
|
|
res = gst_pad_event_default (rtpbasepayload->srcpad, parent, event);
|
|
|
|
else
|
|
|
|
gst_event_unref (event);
|
|
|
|
|
2013-12-12 12:06:30 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_rtp_base_payload_src_event (GstPad * pad, GstObject * parent,
|
|
|
|
GstEvent * event)
|
|
|
|
{
|
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
|
|
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (parent);
|
|
|
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
|
|
|
|
|
|
|
if (rtpbasepayload_class->src_event)
|
|
|
|
res = rtpbasepayload_class->src_event (rtpbasepayload, event);
|
|
|
|
else
|
|
|
|
gst_event_unref (event);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-11-15 15:30:38 +00:00
|
|
|
static gboolean
|
|
|
|
gst_rtp_base_payload_query_default (GstRTPBasePayload * rtpbasepayload,
|
|
|
|
GstPad * pad, GstQuery * query)
|
|
|
|
{
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
|
|
|
case GST_QUERY_CAPS:
|
|
|
|
{
|
|
|
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
|
|
|
GstCaps *filter, *caps;
|
|
|
|
|
|
|
|
gst_query_parse_caps (query, &filter);
|
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload, "getting caps with filter %"
|
|
|
|
GST_PTR_FORMAT, filter);
|
|
|
|
|
|
|
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
|
|
|
if (rtpbasepayload_class->get_caps) {
|
|
|
|
caps = rtpbasepayload_class->get_caps (rtpbasepayload, pad, filter);
|
|
|
|
gst_query_set_caps_result (query, caps);
|
2012-03-29 15:14:48 +00:00
|
|
|
gst_caps_unref (caps);
|
2011-11-15 15:30:38 +00:00
|
|
|
res = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2011-11-16 16:25:17 +00:00
|
|
|
res =
|
|
|
|
gst_pad_query_default (pad, GST_OBJECT_CAST (rtpbasepayload), query);
|
2011-11-15 15:30:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-16 16:25:17 +00:00
|
|
|
gst_rtp_base_payload_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
2011-11-15 15:30:38 +00:00
|
|
|
{
|
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
|
|
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
2011-11-16 16:25:17 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (parent);
|
2011-11-15 15:30:38 +00:00
|
|
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
|
|
|
|
|
|
|
if (rtpbasepayload_class->query)
|
|
|
|
res = rtpbasepayload_class->query (rtpbasepayload, pad, query);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
2005-11-30 19:08:14 +00:00
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
static GstFlowReturn
|
2011-11-17 11:48:25 +00:00
|
|
|
gst_rtp_base_payload_chain (GstPad * pad, GstObject * parent,
|
|
|
|
GstBuffer * buffer)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
|
|
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
GstFlowReturn ret;
|
|
|
|
|
2011-11-17 11:48:25 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (parent);
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
if (!rtpbasepayload_class->handle_buffer)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
goto no_function;
|
|
|
|
|
2012-09-06 17:16:54 +00:00
|
|
|
if (!rtpbasepayload->priv->negotiated)
|
|
|
|
goto not_negotiated;
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
if (rtpbasepayload->priv->source_info
|
|
|
|
|| rtpbasepayload->priv->header_exts->len > 0) {
|
2018-10-10 18:16:12 +00:00
|
|
|
/* Save a copy of meta (instead of taking an extra reference before
|
|
|
|
* handle_buffer) to make the meta available when allocating a output
|
|
|
|
* buffer. */
|
|
|
|
rtpbasepayload->priv->input_meta_buffer = gst_buffer_new ();
|
|
|
|
gst_buffer_copy_into (rtpbasepayload->priv->input_meta_buffer, buffer,
|
2022-02-22 08:54:23 +00:00
|
|
|
GST_BUFFER_COPY_METADATA, 0, -1);
|
2018-10-10 18:16:12 +00:00
|
|
|
}
|
|
|
|
|
2016-11-17 17:46:54 +00:00
|
|
|
if (gst_pad_check_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload))) {
|
|
|
|
if (!gst_rtp_base_payload_negotiate (rtpbasepayload)) {
|
|
|
|
gst_pad_mark_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload));
|
|
|
|
if (GST_PAD_IS_FLUSHING (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload))) {
|
|
|
|
goto flushing;
|
|
|
|
} else {
|
|
|
|
goto negotiate_failed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-02 23:09:59 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
ret = rtpbasepayload_class->handle_buffer (rtpbasepayload, buffer);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2018-10-10 18:16:12 +00:00
|
|
|
gst_buffer_replace (&rtpbasepayload->priv->input_meta_buffer, NULL);
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_function:
|
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GST_ELEMENT_ERROR (rtpbasepayload, STREAM, NOT_IMPLEMENTED, (NULL),
|
2005-09-19 14:23:33 +00:00
|
|
|
("subclass did not implement handle_buffer function"));
|
2008-02-12 14:51:26 +00:00
|
|
|
gst_buffer_unref (buffer);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
2012-09-06 17:16:54 +00:00
|
|
|
not_negotiated:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (rtpbasepayload, CORE, NEGOTIATION, (NULL),
|
|
|
|
("No input format was negotiated, i.e. no caps event was received. "
|
|
|
|
"Perhaps you need a parser or typefind element before the payloader"));
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
2016-11-17 17:46:54 +00:00
|
|
|
negotiate_failed:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload, "Not negotiated");
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
|
|
|
flushing:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload, "we are flushing");
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return GST_FLOW_FLUSHING;
|
|
|
|
}
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
}
|
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/**
|
2011-11-11 11:24:08 +00:00
|
|
|
* gst_rtp_base_payload_set_options:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
2007-08-12 16:30:36 +00:00
|
|
|
* @media: the media type (typically "audio" or "video")
|
|
|
|
* @dynamic: if the payload type is dynamic
|
2009-09-02 17:47:26 +00:00
|
|
|
* @encoding_name: the encoding name
|
2007-08-12 16:30:36 +00:00
|
|
|
* @clock_rate: the clock rate of the media
|
|
|
|
*
|
|
|
|
* Set the rtp options of the payloader. These options will be set in the caps
|
|
|
|
* of the payloader. Subclasses must call this method before calling
|
2011-11-11 11:24:08 +00:00
|
|
|
* gst_rtp_base_payload_push() or gst_rtp_base_payload_set_outcaps().
|
2007-08-12 16:30:36 +00:00
|
|
|
*/
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
void
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_set_options (GstRTPBasePayload * payload,
|
2010-03-19 21:33:58 +00:00
|
|
|
const gchar * media, gboolean dynamic, const gchar * encoding_name,
|
|
|
|
guint32 clock_rate)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (payload != NULL);
|
|
|
|
g_return_if_fail (clock_rate != 0);
|
|
|
|
|
|
|
|
g_free (payload->media);
|
|
|
|
payload->media = g_strdup (media);
|
|
|
|
payload->dynamic = dynamic;
|
|
|
|
g_free (payload->encoding_name);
|
|
|
|
payload->encoding_name = g_strdup (encoding_name);
|
|
|
|
payload->clock_rate = clock_rate;
|
|
|
|
}
|
|
|
|
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-03 06:04:31 +00:00
|
|
|
static gboolean
|
2007-09-19 15:55:08 +00:00
|
|
|
copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
|
|
|
|
{
|
|
|
|
if (gst_value_is_fixed (value)) {
|
|
|
|
gst_structure_id_set_value (dest, field_id, value);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-12-02 14:10:58 +00:00
|
|
|
static void
|
2011-11-11 11:32:23 +00:00
|
|
|
update_max_ptime (GstRTPBasePayload * rtpbasepayload)
|
2009-12-02 14:10:58 +00:00
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
if (rtpbasepayload->priv->caps_max_ptime != -1 &&
|
|
|
|
rtpbasepayload->priv->prop_max_ptime != -1)
|
|
|
|
rtpbasepayload->max_ptime = MIN (rtpbasepayload->priv->caps_max_ptime,
|
|
|
|
rtpbasepayload->priv->prop_max_ptime);
|
|
|
|
else if (rtpbasepayload->priv->caps_max_ptime != -1)
|
|
|
|
rtpbasepayload->max_ptime = rtpbasepayload->priv->caps_max_ptime;
|
|
|
|
else if (rtpbasepayload->priv->prop_max_ptime != -1)
|
|
|
|
rtpbasepayload->max_ptime = rtpbasepayload->priv->prop_max_ptime;
|
2009-12-02 14:10:58 +00:00
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->max_ptime = DEFAULT_MAX_PTIME;
|
2009-12-02 14:10:58 +00:00
|
|
|
}
|
|
|
|
|
2020-11-30 20:38:08 +00:00
|
|
|
static gboolean
|
|
|
|
_set_caps (GQuark field_id, const GValue * value, GstCaps * caps)
|
|
|
|
{
|
|
|
|
gst_caps_set_value (caps, g_quark_to_string (field_id), value);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/**
|
2020-11-30 20:38:08 +00:00
|
|
|
* gst_rtp_base_payload_set_outcaps_structure:
|
2011-11-11 11:24:08 +00:00
|
|
|
* @payload: a #GstRTPBasePayload
|
2020-11-30 20:38:08 +00:00
|
|
|
* @s: (nullable): a #GstStructure with the caps fields
|
2007-08-12 16:30:36 +00:00
|
|
|
*
|
2020-11-30 20:38:08 +00:00
|
|
|
* Configure the output caps with the optional fields.
|
2007-08-12 16:30:36 +00:00
|
|
|
*
|
|
|
|
* Returns: %TRUE if the caps could be set.
|
2020-11-30 20:38:08 +00:00
|
|
|
*
|
|
|
|
* Since: 1.20
|
2007-08-12 16:30:36 +00:00
|
|
|
*/
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
gboolean
|
2020-11-30 20:38:08 +00:00
|
|
|
gst_rtp_base_payload_set_outcaps_structure (GstRTPBasePayload * payload,
|
|
|
|
GstStructure * s)
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
2014-05-02 23:09:59 +00:00
|
|
|
GstCaps *srccaps;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2009-04-27 08:15:44 +00:00
|
|
|
/* fill in the defaults, their properties cannot be negotiated. */
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
srccaps = gst_caps_new_simple ("application/x-rtp",
|
|
|
|
"media", G_TYPE_STRING, payload->media,
|
2005-09-20 11:50:20 +00:00
|
|
|
"clock-rate", G_TYPE_INT, payload->clock_rate,
|
2007-08-12 16:30:36 +00:00
|
|
|
"encoding-name", G_TYPE_STRING, payload->encoding_name, NULL);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2007-09-15 18:41:27 +00:00
|
|
|
GST_DEBUG_OBJECT (payload, "defaults: %" GST_PTR_FORMAT, srccaps);
|
|
|
|
|
2020-11-30 20:38:08 +00:00
|
|
|
if (s && gst_structure_n_fields (s) > 0) {
|
|
|
|
gst_structure_foreach (s, (GstStructureForeachFunc) _set_caps, srccaps);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (payload, "custom added: %" GST_PTR_FORMAT, srccaps);
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_caps_replace (&payload->priv->subclass_srccaps, srccaps);
|
|
|
|
gst_caps_unref (srccaps);
|
|
|
|
|
|
|
|
return gst_rtp_base_payload_negotiate (payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_base_payload_set_outcaps:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
|
|
|
* @fieldname: the first field name or %NULL
|
|
|
|
* @...: field values
|
|
|
|
*
|
|
|
|
* Configure the output caps with the optional parameters.
|
|
|
|
*
|
|
|
|
* Variable arguments should be in the form field name, field type
|
|
|
|
* (as a GType), value(s). The last variable argument should be NULL.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the caps could be set.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload,
|
|
|
|
const gchar * fieldname, ...)
|
|
|
|
{
|
|
|
|
gboolean result;
|
|
|
|
GstStructure *s = NULL;
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
if (fieldname) {
|
|
|
|
va_list varargs;
|
|
|
|
|
2020-11-30 20:38:08 +00:00
|
|
|
s = gst_structure_new_empty ("unused");
|
|
|
|
|
2007-09-15 18:41:27 +00:00
|
|
|
/* override with custom properties */
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
va_start (varargs, fieldname);
|
2020-11-30 20:38:08 +00:00
|
|
|
gst_structure_set_valist (s, fieldname, varargs);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
va_end (varargs);
|
|
|
|
}
|
|
|
|
|
2020-11-30 20:38:08 +00:00
|
|
|
result = gst_rtp_base_payload_set_outcaps_structure (payload, s);
|
2014-05-02 23:09:59 +00:00
|
|
|
|
2020-11-30 20:38:08 +00:00
|
|
|
gst_clear_structure (&s);
|
|
|
|
|
|
|
|
return result;
|
2014-05-02 23:09:59 +00:00
|
|
|
}
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
static void
|
|
|
|
add_and_ref_item (GstRTPHeaderExtension * ext, GPtrArray * ret)
|
|
|
|
{
|
|
|
|
g_ptr_array_add (ret, gst_object_ref (ext));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
remove_item_from (GstRTPHeaderExtension * ext, GPtrArray * ret)
|
|
|
|
{
|
|
|
|
g_ptr_array_remove_fast (ret, ext);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
add_item_to (GstRTPHeaderExtension * ext, GPtrArray * ret)
|
|
|
|
{
|
|
|
|
g_ptr_array_add (ret, ext);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
add_header_ext_to_caps (GstRTPHeaderExtension * ext, GstCaps * caps)
|
|
|
|
{
|
|
|
|
if (!gst_rtp_header_extension_set_caps_from_attributes (ext, caps)) {
|
|
|
|
GST_WARNING ("Failed to set caps from rtp header extension");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-02 23:09:59 +00:00
|
|
|
static gboolean
|
|
|
|
gst_rtp_base_payload_negotiate (GstRTPBasePayload * payload)
|
|
|
|
{
|
2015-05-19 13:32:38 +00:00
|
|
|
GstCaps *templ, *peercaps, *srccaps;
|
2014-03-15 16:35:56 +00:00
|
|
|
GstStructure *s, *d;
|
2020-07-10 05:33:46 +00:00
|
|
|
gboolean res = TRUE;
|
2014-05-02 23:09:59 +00:00
|
|
|
|
2009-12-02 14:10:58 +00:00
|
|
|
payload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
2011-11-11 18:21:09 +00:00
|
|
|
payload->ptime = 0;
|
2009-12-02 14:10:58 +00:00
|
|
|
|
2014-05-02 23:09:59 +00:00
|
|
|
gst_pad_check_reconfigure (payload->srcpad);
|
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
templ = gst_pad_get_pad_template_caps (payload->srcpad);
|
2014-05-02 23:09:59 +00:00
|
|
|
|
|
|
|
if (payload->priv->subclass_srccaps) {
|
|
|
|
GstCaps *tmp = gst_caps_intersect (payload->priv->subclass_srccaps,
|
2015-05-19 13:32:38 +00:00
|
|
|
templ);
|
|
|
|
gst_caps_unref (templ);
|
|
|
|
templ = tmp;
|
2014-05-02 23:09:59 +00:00
|
|
|
}
|
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
peercaps = gst_pad_peer_query_caps (payload->srcpad, templ);
|
2014-05-02 23:09:59 +00:00
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
if (peercaps == NULL) {
|
|
|
|
/* no peer caps, just add the other properties */
|
2014-05-02 23:09:59 +00:00
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
srccaps = gst_caps_copy (templ);
|
2007-08-12 16:30:36 +00:00
|
|
|
gst_caps_set_simple (srccaps,
|
2011-11-11 11:24:08 +00:00
|
|
|
"payload", G_TYPE_INT, GST_RTP_BASE_PAYLOAD_PT (payload),
|
2007-08-12 16:30:36 +00:00
|
|
|
"ssrc", G_TYPE_UINT, payload->current_ssrc,
|
2011-10-27 16:54:50 +00:00
|
|
|
"timestamp-offset", G_TYPE_UINT, payload->ts_base,
|
|
|
|
"seqnum-offset", G_TYPE_UINT, payload->seqnum_base, NULL);
|
2007-09-15 18:41:27 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (payload, "no peer caps: %" GST_PTR_FORMAT, srccaps);
|
2007-08-12 16:30:36 +00:00
|
|
|
} else {
|
|
|
|
GstCaps *temp;
|
|
|
|
const GValue *value;
|
2015-06-05 14:44:08 +00:00
|
|
|
gboolean have_pt = FALSE;
|
2015-05-19 13:32:38 +00:00
|
|
|
gboolean have_ts_offset = FALSE;
|
|
|
|
gboolean have_seqnum_offset = FALSE;
|
2010-01-19 19:31:34 +00:00
|
|
|
guint max_ptime, ptime;
|
2007-08-12 16:30:36 +00:00
|
|
|
|
2011-05-16 08:44:18 +00:00
|
|
|
/* peer provides caps we can use to fixate. They are already intersected
|
|
|
|
* with our srccaps, just make them writable */
|
|
|
|
temp = gst_caps_make_writable (peercaps);
|
2015-05-19 13:32:38 +00:00
|
|
|
peercaps = NULL;
|
2007-08-12 16:30:36 +00:00
|
|
|
|
2010-01-18 19:33:30 +00:00
|
|
|
if (gst_caps_is_empty (temp)) {
|
|
|
|
gst_caps_unref (temp);
|
2015-05-19 13:32:38 +00:00
|
|
|
gst_caps_unref (templ);
|
2016-11-17 17:46:54 +00:00
|
|
|
res = FALSE;
|
|
|
|
goto out;
|
2010-01-18 19:33:30 +00:00
|
|
|
}
|
|
|
|
|
2015-06-05 14:44:08 +00:00
|
|
|
/* We prefer the pt, timestamp-offset, seqnum-offset from the
|
2015-05-19 13:32:38 +00:00
|
|
|
* property (if set), or any previously configured value over what
|
|
|
|
* downstream prefers. Only if downstream can't accept that, or the
|
|
|
|
* properties were not set, we fall back to choosing downstream's
|
|
|
|
* preferred value
|
2015-06-05 14:44:08 +00:00
|
|
|
*
|
|
|
|
* For ssrc we prefer any value downstream suggests, otherwise
|
|
|
|
* the property value or as a last resort a random value.
|
|
|
|
* This difference for ssrc is implemented for retaining backwards
|
|
|
|
* compatibility with changing rtpsession's internal-ssrc property.
|
|
|
|
*
|
|
|
|
* FIXME 2.0: All these properties should go away and be negotiated
|
|
|
|
* via caps only!
|
2015-05-19 13:32:38 +00:00
|
|
|
*/
|
2007-08-12 16:30:36 +00:00
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
/* try to use the previously set pt, or the one from the property */
|
|
|
|
if (payload->priv->pt_set || gst_pad_has_current_caps (payload->srcpad)) {
|
|
|
|
GstCaps *probe_caps = gst_caps_copy (templ);
|
|
|
|
GstCaps *intersection;
|
2007-08-12 16:30:36 +00:00
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
gst_caps_set_simple (probe_caps, "payload", G_TYPE_INT,
|
|
|
|
GST_RTP_BASE_PAYLOAD_PT (payload), NULL);
|
|
|
|
intersection = gst_caps_intersect (probe_caps, temp);
|
2009-12-02 14:10:58 +00:00
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
if (!gst_caps_is_empty (intersection)) {
|
|
|
|
GST_LOG_OBJECT (payload, "Using selected pt %d",
|
2011-11-11 11:24:08 +00:00
|
|
|
GST_RTP_BASE_PAYLOAD_PT (payload));
|
2015-05-19 13:32:38 +00:00
|
|
|
have_pt = TRUE;
|
|
|
|
gst_caps_unref (temp);
|
|
|
|
temp = intersection;
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (payload, "Can't use selected pt %d",
|
|
|
|
GST_RTP_BASE_PAYLOAD_PT (payload));
|
|
|
|
gst_caps_unref (intersection);
|
|
|
|
}
|
|
|
|
gst_caps_unref (probe_caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we got no pt above, select one now */
|
|
|
|
if (!have_pt) {
|
|
|
|
gint pt;
|
|
|
|
|
|
|
|
/* get first structure */
|
|
|
|
s = gst_caps_get_structure (temp, 0);
|
|
|
|
|
|
|
|
if (gst_structure_get_int (s, "payload", &pt)) {
|
|
|
|
/* use peer pt */
|
2014-05-02 22:30:16 +00:00
|
|
|
GST_RTP_BASE_PAYLOAD_PT (payload) = pt;
|
2015-05-19 13:32:38 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using peer pt %d", pt);
|
2007-08-12 16:30:36 +00:00
|
|
|
} else {
|
2015-05-19 13:32:38 +00:00
|
|
|
if (gst_structure_has_field (s, "payload")) {
|
|
|
|
/* can only fixate if there is a field */
|
|
|
|
gst_structure_fixate_field_nearest_int (s, "payload",
|
|
|
|
GST_RTP_BASE_PAYLOAD_PT (payload));
|
|
|
|
gst_structure_get_int (s, "payload", &pt);
|
|
|
|
GST_RTP_BASE_PAYLOAD_PT (payload) = pt;
|
|
|
|
GST_LOG_OBJECT (payload, "using peer pt %d", pt);
|
|
|
|
} else {
|
|
|
|
/* no pt field, use the internal pt */
|
|
|
|
pt = GST_RTP_BASE_PAYLOAD_PT (payload);
|
|
|
|
gst_structure_set (s, "payload", G_TYPE_INT, pt, NULL);
|
|
|
|
GST_LOG_OBJECT (payload, "using internal pt %d", pt);
|
|
|
|
}
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
2015-05-19 13:32:38 +00:00
|
|
|
s = NULL;
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
/* If we got no ssrc above, select one now */
|
2015-06-05 14:44:08 +00:00
|
|
|
/* get first structure */
|
|
|
|
s = gst_caps_get_structure (temp, 0);
|
|
|
|
|
|
|
|
if (gst_structure_has_field_typed (s, "ssrc", G_TYPE_UINT)) {
|
|
|
|
value = gst_structure_get_value (s, "ssrc");
|
|
|
|
payload->current_ssrc = g_value_get_uint (value);
|
|
|
|
GST_LOG_OBJECT (payload, "using peer ssrc %08x", payload->current_ssrc);
|
|
|
|
} else {
|
|
|
|
/* FIXME, fixate_nearest_uint would be even better but we
|
|
|
|
* don't support uint ranges so how likely is it that anybody
|
|
|
|
* uses a list of possible ssrcs */
|
|
|
|
gst_structure_set (s, "ssrc", G_TYPE_UINT, payload->current_ssrc, NULL);
|
|
|
|
GST_LOG_OBJECT (payload, "using internal ssrc %08x",
|
|
|
|
payload->current_ssrc);
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
2015-06-05 14:44:08 +00:00
|
|
|
s = NULL;
|
2015-05-19 13:32:38 +00:00
|
|
|
|
|
|
|
/* try to select the previously used timestamp-offset, or the one from the property */
|
|
|
|
if (!payload->priv->ts_offset_random
|
|
|
|
|| gst_pad_has_current_caps (payload->srcpad)) {
|
|
|
|
GstCaps *probe_caps = gst_caps_copy (templ);
|
|
|
|
GstCaps *intersection;
|
|
|
|
|
|
|
|
gst_caps_set_simple (probe_caps, "timestamp-offset", G_TYPE_UINT,
|
|
|
|
payload->ts_base, NULL);
|
|
|
|
intersection = gst_caps_intersect (probe_caps, temp);
|
|
|
|
|
|
|
|
if (!gst_caps_is_empty (intersection)) {
|
|
|
|
GST_LOG_OBJECT (payload, "Using selected timestamp-offset %u",
|
|
|
|
payload->ts_base);
|
|
|
|
gst_caps_unref (temp);
|
|
|
|
temp = intersection;
|
|
|
|
have_ts_offset = TRUE;
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (payload, "Can't use selected timestamp-offset %u",
|
|
|
|
payload->ts_base);
|
|
|
|
gst_caps_unref (intersection);
|
|
|
|
}
|
|
|
|
gst_caps_unref (probe_caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we got no timestamp-offset above, select one now */
|
|
|
|
if (!have_ts_offset) {
|
|
|
|
/* get first structure */
|
|
|
|
s = gst_caps_get_structure (temp, 0);
|
|
|
|
|
|
|
|
if (gst_structure_has_field_typed (s, "timestamp-offset", G_TYPE_UINT)) {
|
|
|
|
value = gst_structure_get_value (s, "timestamp-offset");
|
|
|
|
payload->ts_base = g_value_get_uint (value);
|
|
|
|
GST_LOG_OBJECT (payload, "using peer timestamp-offset %u",
|
|
|
|
payload->ts_base);
|
|
|
|
} else {
|
|
|
|
/* FIXME, fixate_nearest_uint would be even better but we
|
|
|
|
* don't support uint ranges so how likely is it that anybody
|
|
|
|
* uses a list of possible timestamp-offsets */
|
|
|
|
gst_structure_set (s, "timestamp-offset", G_TYPE_UINT, payload->ts_base,
|
|
|
|
NULL);
|
|
|
|
GST_LOG_OBJECT (payload, "using internal timestamp-offset %u",
|
|
|
|
payload->ts_base);
|
|
|
|
}
|
|
|
|
s = NULL;
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
2007-09-19 15:55:08 +00:00
|
|
|
|
2015-05-19 13:32:38 +00:00
|
|
|
/* try to select the previously used seqnum-offset, or the one from the property */
|
|
|
|
if (!payload->priv->seqnum_offset_random
|
|
|
|
|| gst_pad_has_current_caps (payload->srcpad)) {
|
|
|
|
GstCaps *probe_caps = gst_caps_copy (templ);
|
|
|
|
GstCaps *intersection;
|
|
|
|
|
|
|
|
gst_caps_set_simple (probe_caps, "seqnum-offset", G_TYPE_UINT,
|
|
|
|
payload->seqnum_base, NULL);
|
|
|
|
intersection = gst_caps_intersect (probe_caps, temp);
|
|
|
|
|
|
|
|
if (!gst_caps_is_empty (intersection)) {
|
|
|
|
GST_LOG_OBJECT (payload, "Using selected seqnum-offset %u",
|
|
|
|
payload->seqnum_base);
|
|
|
|
gst_caps_unref (temp);
|
|
|
|
temp = intersection;
|
|
|
|
have_seqnum_offset = TRUE;
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (payload, "Can't use selected seqnum-offset %u",
|
|
|
|
payload->seqnum_base);
|
|
|
|
gst_caps_unref (intersection);
|
|
|
|
}
|
|
|
|
gst_caps_unref (probe_caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we got no seqnum-offset above, select one now */
|
|
|
|
if (!have_seqnum_offset) {
|
|
|
|
/* get first structure */
|
|
|
|
s = gst_caps_get_structure (temp, 0);
|
|
|
|
|
|
|
|
if (gst_structure_has_field_typed (s, "seqnum-offset", G_TYPE_UINT)) {
|
|
|
|
value = gst_structure_get_value (s, "seqnum-offset");
|
|
|
|
payload->seqnum_base = g_value_get_uint (value);
|
|
|
|
GST_LOG_OBJECT (payload, "using peer seqnum-offset %u",
|
|
|
|
payload->seqnum_base);
|
|
|
|
payload->priv->next_seqnum = payload->seqnum_base;
|
|
|
|
payload->seqnum = payload->seqnum_base;
|
|
|
|
payload->priv->seqnum_offset_random = FALSE;
|
|
|
|
} else {
|
|
|
|
/* FIXME, fixate_nearest_uint would be even better but we
|
|
|
|
* don't support uint ranges so how likely is it that anybody
|
|
|
|
* uses a list of possible seqnum-offsets */
|
|
|
|
gst_structure_set (s, "seqnum-offset", G_TYPE_UINT,
|
|
|
|
payload->seqnum_base, NULL);
|
|
|
|
GST_LOG_OBJECT (payload, "using internal seqnum-offset %u",
|
|
|
|
payload->seqnum_base);
|
|
|
|
}
|
|
|
|
|
|
|
|
s = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now fixate, start by taking the first caps */
|
|
|
|
temp = gst_caps_truncate (temp);
|
|
|
|
|
|
|
|
/* get first structure */
|
|
|
|
s = gst_caps_get_structure (temp, 0);
|
|
|
|
|
|
|
|
if (gst_structure_get_uint (s, "maxptime", &max_ptime))
|
|
|
|
payload->priv->caps_max_ptime = max_ptime * GST_MSECOND;
|
|
|
|
|
|
|
|
if (gst_structure_get_uint (s, "ptime", &ptime))
|
|
|
|
payload->ptime = ptime * GST_MSECOND;
|
|
|
|
|
|
|
|
/* make the target caps by copying over all the fixed fields, removing the
|
|
|
|
* unfixed fields. */
|
2011-10-27 15:26:58 +00:00
|
|
|
srccaps = gst_caps_new_empty_simple (gst_structure_get_name (s));
|
2007-09-19 15:55:08 +00:00
|
|
|
d = gst_caps_get_structure (srccaps, 0);
|
|
|
|
|
|
|
|
gst_structure_foreach (s, (GstStructureForeachFunc) copy_fixed, d);
|
|
|
|
|
2007-10-09 09:57:17 +00:00
|
|
|
gst_caps_unref (temp);
|
|
|
|
|
2007-09-15 18:41:27 +00:00
|
|
|
GST_DEBUG_OBJECT (payload, "with peer caps: %" GST_PTR_FORMAT, srccaps);
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
|
|
|
|
2014-03-15 16:35:56 +00:00
|
|
|
if (payload->priv->sinkcaps != NULL) {
|
|
|
|
s = gst_caps_get_structure (payload->priv->sinkcaps, 0);
|
|
|
|
if (g_str_has_prefix (gst_structure_get_name (s), "video")) {
|
|
|
|
gboolean has_framerate;
|
|
|
|
gint num, denom;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (payload, "video caps: %" GST_PTR_FORMAT,
|
|
|
|
payload->priv->sinkcaps);
|
|
|
|
|
|
|
|
has_framerate = gst_structure_get_fraction (s, "framerate", &num, &denom);
|
|
|
|
if (has_framerate && num == 0 && denom == 1) {
|
|
|
|
has_framerate =
|
|
|
|
gst_structure_get_fraction (s, "max-framerate", &num, &denom);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_framerate) {
|
|
|
|
gchar str[G_ASCII_DTOSTR_BUF_SIZE];
|
|
|
|
gdouble framerate;
|
|
|
|
|
|
|
|
gst_util_fraction_to_double (num, denom, &framerate);
|
|
|
|
g_ascii_dtostr (str, G_ASCII_DTOSTR_BUF_SIZE, framerate);
|
|
|
|
d = gst_caps_get_structure (srccaps, 0);
|
|
|
|
gst_structure_set (d, "a-framerate", G_TYPE_STRING, str, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (payload, "with video caps: %" GST_PTR_FORMAT, srccaps);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-02 14:10:58 +00:00
|
|
|
update_max_ptime (payload);
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
{
|
|
|
|
/* try to find header extension implementations for the list in the
|
|
|
|
* caps */
|
|
|
|
GstStructure *s = gst_caps_get_structure (srccaps, 0);
|
|
|
|
guint i, j, n_fields = gst_structure_n_fields (s);
|
|
|
|
GPtrArray *header_exts = g_ptr_array_new_with_free_func (gst_object_unref);
|
|
|
|
GPtrArray *to_add = g_ptr_array_new ();
|
|
|
|
GPtrArray *to_remove = g_ptr_array_new ();
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (payload);
|
|
|
|
g_ptr_array_foreach (payload->priv->header_exts,
|
|
|
|
(GFunc) add_and_ref_item, header_exts);
|
|
|
|
GST_OBJECT_UNLOCK (payload);
|
|
|
|
|
|
|
|
for (i = 0; i < n_fields; i++) {
|
|
|
|
const gchar *field_name = gst_structure_nth_field_name (s, i);
|
|
|
|
if (g_str_has_prefix (field_name, "extmap-")) {
|
|
|
|
const GValue *val;
|
|
|
|
const gchar *uri = NULL;
|
|
|
|
gchar *nptr;
|
2021-04-11 22:43:06 +00:00
|
|
|
guint ext_id;
|
2020-07-10 05:33:46 +00:00
|
|
|
GstRTPHeaderExtension *ext = NULL;
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
ext_id = g_ascii_strtoull (&field_name[strlen ("extmap-")], &nptr, 10);
|
|
|
|
if (errno != 0 || (ext_id == 0 && field_name == nptr)) {
|
|
|
|
GST_WARNING_OBJECT (payload, "could not parse id from %s",
|
|
|
|
field_name);
|
|
|
|
res = FALSE;
|
|
|
|
goto ext_out;
|
|
|
|
}
|
|
|
|
|
|
|
|
val = gst_structure_get_value (s, field_name);
|
|
|
|
if (G_VALUE_HOLDS_STRING (val)) {
|
|
|
|
uri = g_value_get_string (val);
|
|
|
|
} else if (GST_VALUE_HOLDS_ARRAY (val)) {
|
|
|
|
/* the uri is the second value in the array */
|
|
|
|
const GValue *str = gst_value_array_get_value (val, 1);
|
|
|
|
if (G_VALUE_HOLDS_STRING (str)) {
|
|
|
|
uri = g_value_get_string (str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!uri) {
|
|
|
|
GST_WARNING_OBJECT (payload, "could not get extmap uri for "
|
|
|
|
"field %s", field_name);
|
|
|
|
res = FALSE;
|
|
|
|
goto ext_out;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* try to find if this extension mapping already exists */
|
|
|
|
for (j = 0; j < header_exts->len; j++) {
|
|
|
|
ext = g_ptr_array_index (header_exts, j);
|
|
|
|
if (gst_rtp_header_extension_get_id (ext) == ext_id) {
|
|
|
|
if (g_strcmp0 (uri, gst_rtp_header_extension_get_uri (ext)) == 0) {
|
|
|
|
/* still matching, we're good, set attributes from caps in case
|
|
|
|
* the caps have been updated */
|
|
|
|
if (!gst_rtp_header_extension_set_attributes_from_caps (ext,
|
|
|
|
srccaps)) {
|
|
|
|
GST_WARNING_OBJECT (payload,
|
|
|
|
"Failed to configure rtp header " "extension %"
|
|
|
|
GST_PTR_FORMAT " attributes from caps %" GST_PTR_FORMAT,
|
|
|
|
ext, srccaps);
|
|
|
|
res = FALSE;
|
|
|
|
goto ext_out;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
} else {
|
2021-04-11 22:43:06 +00:00
|
|
|
GST_DEBUG_OBJECT (payload, "extension id %u"
|
2020-07-10 05:33:46 +00:00
|
|
|
"was replaced with a different extension uri "
|
|
|
|
"original:\'%s' vs \'%s\'", ext_id,
|
|
|
|
gst_rtp_header_extension_get_uri (ext), uri);
|
|
|
|
g_ptr_array_add (to_remove, ext);
|
|
|
|
ext = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ext = NULL;
|
|
|
|
}
|
|
|
|
}
|
2020-02-14 09:40:59 +00:00
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
/* if no extension, attempt to request one */
|
|
|
|
if (!ext) {
|
2021-04-11 22:43:06 +00:00
|
|
|
GST_DEBUG_OBJECT (payload, "requesting extension for id %u"
|
|
|
|
" and uri %s", ext_id, uri);
|
2020-07-10 05:33:46 +00:00
|
|
|
g_signal_emit (payload,
|
|
|
|
gst_rtp_base_payload_signals[SIGNAL_REQUEST_EXTENSION], 0,
|
|
|
|
ext_id, uri, &ext);
|
|
|
|
GST_DEBUG_OBJECT (payload, "request returned extension %p \'%s\' "
|
2021-04-11 22:43:06 +00:00
|
|
|
"for id %u and uri %s", ext,
|
2020-07-10 05:33:46 +00:00
|
|
|
ext ? GST_OBJECT_NAME (ext) : "", ext_id, uri);
|
|
|
|
|
2021-01-26 08:37:44 +00:00
|
|
|
/* We require caller to set the appropriate extension if it's required */
|
2020-07-10 05:33:46 +00:00
|
|
|
if (ext && gst_rtp_header_extension_get_id (ext) != ext_id) {
|
|
|
|
g_warning ("\'request-extension\' signal provided an rtp header "
|
|
|
|
"extension for uri \'%s\' that does not match the requested "
|
2021-04-11 22:43:06 +00:00
|
|
|
"extension id %u", uri, ext_id);
|
2020-07-10 05:33:46 +00:00
|
|
|
gst_clear_object (&ext);
|
|
|
|
}
|
2021-01-26 09:39:34 +00:00
|
|
|
|
|
|
|
if (ext && !gst_rtp_header_extension_set_attributes_from_caps (ext,
|
|
|
|
srccaps)) {
|
|
|
|
GST_WARNING_OBJECT (payload,
|
|
|
|
"Failed to configure rtp header " "extension %"
|
|
|
|
GST_PTR_FORMAT " attributes from caps %" GST_PTR_FORMAT,
|
|
|
|
ext, srccaps);
|
|
|
|
res = FALSE;
|
|
|
|
g_clear_object (&ext);
|
|
|
|
goto ext_out;
|
|
|
|
}
|
2020-07-10 05:33:46 +00:00
|
|
|
|
|
|
|
if (ext) {
|
|
|
|
g_ptr_array_add (to_add, ext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (payload);
|
|
|
|
g_ptr_array_foreach (to_remove, (GFunc) remove_item_from,
|
|
|
|
payload->priv->header_exts);
|
|
|
|
g_ptr_array_foreach (to_add, (GFunc) add_item_to,
|
|
|
|
payload->priv->header_exts);
|
2021-01-12 21:11:46 +00:00
|
|
|
/* let extensions update their internal state from sinkcaps */
|
|
|
|
if (payload->priv->sinkcaps) {
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < payload->priv->header_exts->len; i++) {
|
|
|
|
GstRTPHeaderExtension *ext;
|
|
|
|
|
|
|
|
ext = g_ptr_array_index (payload->priv->header_exts, i);
|
|
|
|
if (!gst_rtp_header_extension_set_non_rtp_sink_caps (ext,
|
|
|
|
payload->priv->sinkcaps)) {
|
|
|
|
GST_WARNING_OBJECT (payload,
|
|
|
|
"Failed to update rtp header extension (%s) from sink caps",
|
|
|
|
GST_OBJECT_NAME (ext));
|
|
|
|
res = FALSE;
|
|
|
|
GST_OBJECT_UNLOCK (payload);
|
|
|
|
goto ext_out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-10 05:33:46 +00:00
|
|
|
/* add extension information to srccaps */
|
|
|
|
g_ptr_array_foreach (payload->priv->header_exts,
|
|
|
|
(GFunc) add_header_ext_to_caps, srccaps);
|
|
|
|
GST_OBJECT_UNLOCK (payload);
|
|
|
|
|
|
|
|
ext_out:
|
|
|
|
g_ptr_array_unref (to_add);
|
|
|
|
g_ptr_array_unref (to_remove);
|
|
|
|
g_ptr_array_unref (header_exts);
|
2020-02-14 09:40:59 +00:00
|
|
|
}
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
GST_DEBUG_OBJECT (payload, "configuring caps %" GST_PTR_FORMAT, srccaps);
|
|
|
|
|
|
|
|
if (res)
|
|
|
|
res = gst_pad_set_caps (GST_RTP_BASE_PAYLOAD_SRCPAD (payload), srccaps);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
gst_caps_unref (srccaps);
|
2015-05-19 13:32:38 +00:00
|
|
|
gst_caps_unref (templ);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2016-11-17 17:46:54 +00:00
|
|
|
out:
|
|
|
|
|
|
|
|
if (!res)
|
|
|
|
gst_pad_mark_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (payload));
|
|
|
|
|
2008-10-13 09:16:59 +00:00
|
|
|
return res;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
}
|
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/**
|
2011-11-11 11:24:08 +00:00
|
|
|
* gst_rtp_base_payload_is_filled:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
2007-08-12 16:30:36 +00:00
|
|
|
* @size: the size of the packet
|
|
|
|
* @duration: the duration of the packet
|
|
|
|
*
|
2009-06-11 10:39:19 +00:00
|
|
|
* Check if the packet with @size and @duration would exceed the configured
|
2007-08-12 16:30:36 +00:00
|
|
|
* maximum size.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the packet of @size and @duration would exceed the
|
|
|
|
* configured MTU or max_ptime.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
gboolean
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_is_filled (GstRTPBasePayload * payload,
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
guint size, GstClockTime duration)
|
|
|
|
{
|
|
|
|
if (size > payload->mtu)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (payload->max_ptime != -1 && duration >= payload->max_ptime)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
typedef struct
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
{
|
2011-11-11 11:24:08 +00:00
|
|
|
GstRTPBasePayload *payload;
|
2009-06-19 13:52:34 +00:00
|
|
|
guint32 ssrc;
|
|
|
|
guint16 seqnum;
|
|
|
|
guint8 pt;
|
2012-03-13 17:15:04 +00:00
|
|
|
GstClockTime dts;
|
|
|
|
GstClockTime pts;
|
2009-09-02 17:47:26 +00:00
|
|
|
guint64 offset;
|
2007-09-15 18:41:27 +00:00
|
|
|
guint32 rtptime;
|
2009-06-19 13:52:34 +00:00
|
|
|
} HeaderData;
|
|
|
|
|
2011-03-31 15:47:43 +00:00
|
|
|
static gboolean
|
2012-01-25 10:04:43 +00:00
|
|
|
find_timestamp (GstBuffer ** buffer, guint idx, gpointer user_data)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
2012-01-25 10:04:43 +00:00
|
|
|
HeaderData *data = user_data;
|
2012-03-13 17:15:04 +00:00
|
|
|
data->dts = GST_BUFFER_DTS (*buffer);
|
|
|
|
data->pts = GST_BUFFER_PTS (*buffer);
|
2009-09-02 17:47:26 +00:00
|
|
|
data->offset = GST_BUFFER_OFFSET (*buffer);
|
2009-06-19 13:52:34 +00:00
|
|
|
|
2009-10-16 08:54:31 +00:00
|
|
|
/* stop when we find a timestamp. We take whatever offset is associated with
|
|
|
|
* the timestamp (if any) to do perfect timestamps when we need to. */
|
2012-03-13 17:15:04 +00:00
|
|
|
if (data->pts != -1)
|
2011-03-31 15:47:43 +00:00
|
|
|
return FALSE;
|
2009-06-19 13:52:34 +00:00
|
|
|
else
|
2011-03-31 15:47:43 +00:00
|
|
|
return TRUE;
|
2009-06-19 13:52:34 +00:00
|
|
|
}
|
|
|
|
|
2020-02-14 09:40:59 +00:00
|
|
|
static void
|
2020-07-10 05:33:46 +00:00
|
|
|
gst_rtp_base_payload_add_extension (GstRTPBasePayload * payload,
|
|
|
|
GstRTPHeaderExtension * ext)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_RTP_HEADER_EXTENSION (ext));
|
|
|
|
g_return_if_fail (gst_rtp_header_extension_get_id (ext) > 0);
|
|
|
|
|
|
|
|
/* XXX: check for duplicate ids? */
|
|
|
|
GST_OBJECT_LOCK (payload);
|
|
|
|
g_ptr_array_add (payload->priv->header_exts, gst_object_ref (ext));
|
|
|
|
gst_pad_mark_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (payload));
|
|
|
|
GST_OBJECT_UNLOCK (payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_rtp_base_payload_clear_extensions (GstRTPBasePayload * payload)
|
|
|
|
{
|
|
|
|
GST_OBJECT_LOCK (payload);
|
|
|
|
g_ptr_array_set_size (payload->priv->header_exts, 0);
|
|
|
|
GST_OBJECT_UNLOCK (payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GstRTPBasePayload *payload;
|
|
|
|
GstRTPHeaderExtensionFlags flags;
|
|
|
|
GstBuffer *output;
|
|
|
|
guint8 *data;
|
|
|
|
gsize allocated_size;
|
|
|
|
gsize written_size;
|
|
|
|
gsize hdr_unit_size;
|
|
|
|
gboolean abort;
|
|
|
|
} HeaderExt;
|
|
|
|
|
|
|
|
static void
|
|
|
|
determine_header_extension_flags_size (GstRTPHeaderExtension * ext,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
HeaderExt *hdr = user_data;
|
|
|
|
guint ext_id;
|
|
|
|
gsize max_size;
|
|
|
|
|
|
|
|
hdr->flags &= gst_rtp_header_extension_get_supported_flags (ext);
|
|
|
|
max_size =
|
|
|
|
gst_rtp_header_extension_get_max_size (ext,
|
|
|
|
hdr->payload->priv->input_meta_buffer);
|
|
|
|
|
|
|
|
if (max_size > RTP_HEADER_EXT_ONE_BYTE_MAX_SIZE)
|
|
|
|
hdr->flags &= ~GST_RTP_HEADER_EXTENSION_ONE_BYTE;
|
|
|
|
if (max_size > RTP_HEADER_EXT_TWO_BYTE_MAX_SIZE)
|
|
|
|
hdr->flags &= ~GST_RTP_HEADER_EXTENSION_TWO_BYTE;
|
|
|
|
|
|
|
|
ext_id = gst_rtp_header_extension_get_id (ext);
|
|
|
|
if (ext_id > RTP_HEADER_EXT_ONE_BYTE_MAX_ID)
|
|
|
|
hdr->flags &= ~GST_RTP_HEADER_EXTENSION_ONE_BYTE;
|
|
|
|
if (ext_id > RTP_HEADER_EXT_TWO_BYTE_MAX_ID)
|
|
|
|
hdr->flags &= ~GST_RTP_HEADER_EXTENSION_TWO_BYTE;
|
|
|
|
|
|
|
|
hdr->allocated_size += max_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
write_header_extension (GstRTPHeaderExtension * ext, gpointer user_data)
|
2020-02-14 09:40:59 +00:00
|
|
|
{
|
2020-07-10 05:33:46 +00:00
|
|
|
HeaderExt *hdr = user_data;
|
|
|
|
gsize remaining =
|
|
|
|
hdr->allocated_size - hdr->written_size - hdr->hdr_unit_size;
|
|
|
|
gsize offset = hdr->written_size + hdr->hdr_unit_size;
|
2021-08-18 23:40:55 +00:00
|
|
|
gssize written;
|
2020-07-10 05:33:46 +00:00
|
|
|
guint ext_id;
|
|
|
|
|
|
|
|
if (hdr->abort)
|
2020-02-14 09:40:59 +00:00
|
|
|
return;
|
2020-07-10 05:33:46 +00:00
|
|
|
|
|
|
|
written = gst_rtp_header_extension_write (ext,
|
|
|
|
hdr->payload->priv->input_meta_buffer, hdr->flags, hdr->output,
|
|
|
|
&hdr->data[offset], remaining);
|
|
|
|
|
2021-08-31 06:21:09 +00:00
|
|
|
GST_TRACE_OBJECT (hdr->payload, "extension %" GST_PTR_FORMAT " wrote %"
|
|
|
|
G_GSIZE_FORMAT, ext, written);
|
|
|
|
|
2020-07-10 05:33:46 +00:00
|
|
|
if (written == 0) {
|
|
|
|
/* extension wrote no data */
|
|
|
|
return;
|
|
|
|
} else if (written < 0) {
|
|
|
|
GST_WARNING_OBJECT (hdr->payload, "%s failed to write extension data",
|
|
|
|
GST_OBJECT_NAME (ext));
|
|
|
|
goto error;
|
|
|
|
} else if (written > remaining) {
|
|
|
|
/* wrote too much! */
|
|
|
|
g_error ("Overflow detected writing rtp header extensions. One of the "
|
|
|
|
"instances likely did not report a large enough maximum size. "
|
|
|
|
"Memory corruption has occured. Aborting");
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
ext_id = gst_rtp_header_extension_get_id (ext);
|
|
|
|
|
|
|
|
/* move to the beginning of the extension header */
|
|
|
|
offset -= hdr->hdr_unit_size;
|
|
|
|
|
|
|
|
/* write extension header */
|
|
|
|
if (hdr->flags & GST_RTP_HEADER_EXTENSION_ONE_BYTE) {
|
|
|
|
if (written > RTP_HEADER_EXT_ONE_BYTE_MAX_SIZE) {
|
|
|
|
g_critical ("Amount of data written by %s is larger than allowed with "
|
|
|
|
"a one byte header.", GST_OBJECT_NAME (ext));
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hdr->data[offset] = ((ext_id & 0x0F) << 4) | ((written - 1) & 0x0F);
|
|
|
|
} else if (hdr->flags & GST_RTP_HEADER_EXTENSION_TWO_BYTE) {
|
|
|
|
if (written > RTP_HEADER_EXT_TWO_BYTE_MAX_SIZE) {
|
|
|
|
g_critical ("Amount of data written by %s is larger than allowed with "
|
|
|
|
"a two byte header.", GST_OBJECT_NAME (ext));
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hdr->data[offset] = ext_id & 0xFF;
|
|
|
|
hdr->data[offset + 1] = written & 0xFF;
|
|
|
|
} else {
|
|
|
|
g_critical ("Don't know how to write extension data with flags 0x%x!",
|
|
|
|
hdr->flags);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hdr->written_size += written + hdr->hdr_unit_size;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
error:
|
|
|
|
hdr->abort = TRUE;
|
|
|
|
return;
|
2020-02-14 09:40:59 +00:00
|
|
|
}
|
|
|
|
|
2011-03-31 15:47:43 +00:00
|
|
|
static gboolean
|
2012-01-25 10:04:43 +00:00
|
|
|
set_headers (GstBuffer ** buffer, guint idx, gpointer user_data)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
2012-01-25 10:04:43 +00:00
|
|
|
HeaderData *data = user_data;
|
2020-07-10 05:33:46 +00:00
|
|
|
HeaderExt hdrext = { NULL, };
|
2011-12-05 17:30:37 +00:00
|
|
|
GstRTPBuffer rtp = { NULL, };
|
2011-03-27 11:55:15 +00:00
|
|
|
|
2021-05-24 17:01:24 +00:00
|
|
|
if (!gst_rtp_buffer_map (*buffer, GST_MAP_READWRITE, &rtp))
|
2012-07-17 14:35:06 +00:00
|
|
|
goto map_failed;
|
|
|
|
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_ssrc (&rtp, data->ssrc);
|
|
|
|
gst_rtp_buffer_set_payload_type (&rtp, data->pt);
|
|
|
|
gst_rtp_buffer_set_seq (&rtp, data->seqnum);
|
|
|
|
gst_rtp_buffer_set_timestamp (&rtp, data->rtptime);
|
2020-07-10 05:33:46 +00:00
|
|
|
|
|
|
|
GST_OBJECT_LOCK (data->payload);
|
|
|
|
if (data->payload->priv->header_exts->len > 0) {
|
|
|
|
guint wordlen;
|
|
|
|
gsize extlen;
|
|
|
|
guint16 bit_pattern;
|
|
|
|
|
|
|
|
/* write header extensions */
|
|
|
|
hdrext.payload = data->payload;
|
|
|
|
hdrext.output = *buffer;
|
|
|
|
/* XXX: pre-calculate these flags and sizes? */
|
|
|
|
hdrext.flags =
|
|
|
|
GST_RTP_HEADER_EXTENSION_ONE_BYTE | GST_RTP_HEADER_EXTENSION_TWO_BYTE;
|
|
|
|
g_ptr_array_foreach (data->payload->priv->header_exts,
|
|
|
|
(GFunc) determine_header_extension_flags_size, &hdrext);
|
|
|
|
hdrext.hdr_unit_size = 0;
|
|
|
|
if (hdrext.flags & GST_RTP_HEADER_EXTENSION_ONE_BYTE) {
|
|
|
|
/* prefer the one byte header */
|
|
|
|
hdrext.hdr_unit_size = 1;
|
|
|
|
/* TODO: support mixed size writing modes, i.e. RFC8285 */
|
|
|
|
hdrext.flags &= ~GST_RTP_HEADER_EXTENSION_TWO_BYTE;
|
|
|
|
bit_pattern = 0xBEDE;
|
|
|
|
} else if (hdrext.flags & GST_RTP_HEADER_EXTENSION_TWO_BYTE) {
|
|
|
|
hdrext.hdr_unit_size = 2;
|
|
|
|
bit_pattern = 0x1000;
|
|
|
|
} else {
|
|
|
|
goto unsupported_flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
extlen =
|
|
|
|
hdrext.hdr_unit_size * data->payload->priv->header_exts->len +
|
|
|
|
hdrext.allocated_size;
|
2021-01-12 21:08:14 +00:00
|
|
|
wordlen = extlen / 4 + ((extlen % 4) ? 1 : 0);
|
2020-07-10 05:33:46 +00:00
|
|
|
|
|
|
|
/* XXX: do we need to add to any existing extension data instead of
|
|
|
|
* overwriting everything? */
|
|
|
|
gst_rtp_buffer_set_extension_data (&rtp, bit_pattern, wordlen);
|
|
|
|
gst_rtp_buffer_get_extension_data (&rtp, NULL, (gpointer) & hdrext.data,
|
|
|
|
&wordlen);
|
|
|
|
|
|
|
|
/* from 32-bit words to bytes */
|
|
|
|
hdrext.allocated_size = wordlen * 4;
|
|
|
|
|
|
|
|
g_ptr_array_foreach (data->payload->priv->header_exts,
|
|
|
|
(GFunc) write_header_extension, &hdrext);
|
|
|
|
|
2021-05-24 17:11:51 +00:00
|
|
|
if (hdrext.written_size > 0) {
|
|
|
|
wordlen = hdrext.written_size / 4 + ((hdrext.written_size % 4) ? 1 : 0);
|
2021-03-18 19:13:21 +00:00
|
|
|
|
2021-05-24 17:11:51 +00:00
|
|
|
/* zero-fill the hdrext padding bytes */
|
|
|
|
memset (&hdrext.data[hdrext.written_size], 0,
|
|
|
|
wordlen * 4 - hdrext.written_size);
|
2021-03-18 19:13:21 +00:00
|
|
|
|
2021-05-24 17:11:51 +00:00
|
|
|
gst_rtp_buffer_set_extension_data (&rtp, bit_pattern, wordlen);
|
|
|
|
} else {
|
|
|
|
gst_rtp_buffer_remove_extension_data (&rtp);
|
|
|
|
}
|
2020-07-10 05:33:46 +00:00
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (data->payload);
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
|
|
|
|
2009-09-02 17:47:26 +00:00
|
|
|
/* increment the seqnum for each buffer */
|
2009-06-19 13:52:34 +00:00
|
|
|
data->seqnum++;
|
|
|
|
|
2011-03-31 15:47:43 +00:00
|
|
|
return TRUE;
|
2012-07-17 14:35:06 +00:00
|
|
|
/* ERRORS */
|
|
|
|
map_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR ("failed to map buffer %p", *buffer);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2020-07-10 05:33:46 +00:00
|
|
|
|
|
|
|
unsupported_flags:
|
|
|
|
{
|
|
|
|
GST_OBJECT_UNLOCK (data->payload);
|
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
|
|
|
GST_ERROR ("Cannot add rtp header extensions with mixed header types");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2009-06-19 13:52:34 +00:00
|
|
|
}
|
|
|
|
|
2018-10-10 18:16:12 +00:00
|
|
|
static gboolean
|
|
|
|
foreach_metadata_drop (GstBuffer * buffer, GstMeta ** meta, gpointer user_data)
|
|
|
|
{
|
2019-06-12 12:32:03 +00:00
|
|
|
GType drop_api_type = (GType) user_data;
|
2018-10-10 18:16:12 +00:00
|
|
|
const GstMetaInfo *info = (*meta)->info;
|
|
|
|
|
|
|
|
if (info->api == drop_api_type)
|
|
|
|
*meta = NULL;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
filter_meta (GstBuffer ** buffer, guint idx, gpointer user_data)
|
|
|
|
{
|
|
|
|
return gst_buffer_foreach_meta (*buffer, foreach_metadata_drop,
|
2019-06-12 12:32:03 +00:00
|
|
|
(gpointer) GST_RTP_SOURCE_META_API_TYPE);
|
2018-10-10 18:16:12 +00:00
|
|
|
}
|
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
/* Updates the SSRC, payload type, seqnum and timestamp of the RTP buffer
|
|
|
|
* before the buffer is pushed. */
|
|
|
|
static GstFlowReturn
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_prepare_push (GstRTPBasePayload * payload,
|
2009-06-19 13:52:34 +00:00
|
|
|
gpointer obj, gboolean is_list)
|
|
|
|
{
|
2011-11-11 11:24:08 +00:00
|
|
|
GstRTPBasePayloadPrivate *priv;
|
2009-06-19 13:52:34 +00:00
|
|
|
HeaderData data;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
if (payload->clock_rate == 0)
|
|
|
|
goto no_rate;
|
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
priv = payload->priv;
|
|
|
|
|
2006-02-09 17:04:18 +00:00
|
|
|
/* update first, so that the property is set to the last
|
|
|
|
* seqnum pushed */
|
2007-07-14 17:23:42 +00:00
|
|
|
payload->seqnum = priv->next_seqnum;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
/* fill in the fields we want to set on all headers */
|
|
|
|
data.payload = payload;
|
|
|
|
data.seqnum = payload->seqnum;
|
|
|
|
data.ssrc = payload->current_ssrc;
|
|
|
|
data.pt = payload->pt;
|
|
|
|
|
|
|
|
/* find the first buffer with a timestamp */
|
|
|
|
if (is_list) {
|
2012-03-13 17:15:04 +00:00
|
|
|
data.dts = -1;
|
|
|
|
data.pts = -1;
|
2009-10-16 08:50:35 +00:00
|
|
|
data.offset = GST_BUFFER_OFFSET_NONE;
|
2012-01-25 10:04:43 +00:00
|
|
|
gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj), find_timestamp, &data);
|
2009-06-19 13:52:34 +00:00
|
|
|
} else {
|
2012-03-13 17:15:04 +00:00
|
|
|
data.dts = GST_BUFFER_DTS (GST_BUFFER_CAST (obj));
|
|
|
|
data.pts = GST_BUFFER_PTS (GST_BUFFER_CAST (obj));
|
2009-09-02 17:47:26 +00:00
|
|
|
data.offset = GST_BUFFER_OFFSET (GST_BUFFER_CAST (obj));
|
2009-06-19 13:52:34 +00:00
|
|
|
}
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
/* convert to RTP time */
|
2011-07-09 03:06:46 +00:00
|
|
|
if (priv->perfect_rtptime && data.offset != GST_BUFFER_OFFSET_NONE &&
|
|
|
|
priv->base_offset != GST_BUFFER_OFFSET_NONE) {
|
2013-11-26 00:13:45 +00:00
|
|
|
/* generate perfect RTP time by adding together the base timestamp, the
|
|
|
|
* running time of the first buffer and difference between the offset of the
|
|
|
|
* first buffer and the offset of the current buffer. */
|
|
|
|
guint64 offset = data.offset - priv->base_offset;
|
|
|
|
data.rtptime = payload->ts_base + priv->base_rtime_hz + offset;
|
|
|
|
|
2009-09-03 12:13:12 +00:00
|
|
|
GST_LOG_OBJECT (payload,
|
|
|
|
"Using offset %" G_GUINT64_FORMAT " for RTP timestamp", data.offset);
|
2014-01-27 23:40:38 +00:00
|
|
|
|
|
|
|
/* store buffer's running time */
|
|
|
|
GST_LOG_OBJECT (payload,
|
|
|
|
"setting running-time to %" G_GUINT64_FORMAT,
|
|
|
|
data.offset - priv->base_offset);
|
|
|
|
priv->running_time = priv->base_rtime + data.offset - priv->base_offset;
|
2012-03-13 17:15:04 +00:00
|
|
|
} else if (GST_CLOCK_TIME_IS_VALID (data.pts)) {
|
2013-11-26 00:13:45 +00:00
|
|
|
guint64 rtime_ns;
|
|
|
|
guint64 rtime_hz;
|
2005-11-30 19:08:14 +00:00
|
|
|
|
2012-03-13 17:15:04 +00:00
|
|
|
/* no offset, use the gstreamer pts */
|
2020-03-09 14:26:42 +00:00
|
|
|
if (priv->onvif_no_rate_control || !priv->scale_rtptime)
|
2020-01-23 15:11:28 +00:00
|
|
|
rtime_ns = gst_segment_to_stream_time (&payload->segment,
|
|
|
|
GST_FORMAT_TIME, data.pts);
|
2018-11-19 22:42:14 +00:00
|
|
|
else
|
|
|
|
rtime_ns =
|
|
|
|
gst_segment_to_running_time (&payload->segment, GST_FORMAT_TIME,
|
|
|
|
data.pts);
|
2007-09-14 20:52:00 +00:00
|
|
|
|
2013-11-26 00:13:45 +00:00
|
|
|
if (!GST_CLOCK_TIME_IS_VALID (rtime_ns)) {
|
2012-03-13 17:15:04 +00:00
|
|
|
GST_LOG_OBJECT (payload, "Clipped pts, using base RTP timestamp");
|
2013-11-26 00:13:45 +00:00
|
|
|
rtime_hz = 0;
|
2010-12-20 17:29:15 +00:00
|
|
|
} else {
|
|
|
|
GST_LOG_OBJECT (payload,
|
|
|
|
"Using running_time %" GST_TIME_FORMAT " for RTP timestamp",
|
2013-11-26 00:13:45 +00:00
|
|
|
GST_TIME_ARGS (rtime_ns));
|
|
|
|
rtime_hz =
|
|
|
|
gst_util_uint64_scale_int (rtime_ns, payload->clock_rate, GST_SECOND);
|
2011-07-09 03:06:46 +00:00
|
|
|
priv->base_offset = data.offset;
|
2013-11-26 00:13:45 +00:00
|
|
|
priv->base_rtime_hz = rtime_hz;
|
2010-12-20 17:29:15 +00:00
|
|
|
}
|
2013-11-26 00:13:45 +00:00
|
|
|
|
2007-09-16 19:31:06 +00:00
|
|
|
/* add running_time in clock-rate units to the base timestamp */
|
2013-11-26 00:13:45 +00:00
|
|
|
data.rtptime = payload->ts_base + rtime_hz;
|
2014-01-27 23:40:38 +00:00
|
|
|
|
|
|
|
/* store buffer's running time */
|
2013-11-26 00:13:45 +00:00
|
|
|
if (priv->perfect_rtptime) {
|
|
|
|
GST_LOG_OBJECT (payload,
|
|
|
|
"setting running-time to %" G_GUINT64_FORMAT, rtime_hz);
|
|
|
|
priv->running_time = rtime_hz;
|
|
|
|
} else {
|
|
|
|
GST_LOG_OBJECT (payload,
|
2014-03-20 08:18:31 +00:00
|
|
|
"setting running-time to %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (rtime_ns));
|
2013-11-26 00:13:45 +00:00
|
|
|
priv->running_time = rtime_ns;
|
|
|
|
}
|
2007-09-16 19:31:06 +00:00
|
|
|
} else {
|
2009-09-03 12:13:12 +00:00
|
|
|
GST_LOG_OBJECT (payload,
|
2009-09-10 16:19:36 +00:00
|
|
|
"Using previous RTP timestamp %" G_GUINT32_FORMAT, payload->timestamp);
|
2007-09-16 19:31:06 +00:00
|
|
|
/* no timestamp to convert, take previous timestamp */
|
2009-06-19 13:52:34 +00:00
|
|
|
data.rtptime = payload->timestamp;
|
2005-11-30 19:08:14 +00:00
|
|
|
}
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
/* set ssrc, payload type, seq number, caps and rtptime */
|
2018-10-10 18:16:12 +00:00
|
|
|
/* remove unwanted meta */
|
2009-06-19 13:52:34 +00:00
|
|
|
if (is_list) {
|
2012-01-25 10:04:43 +00:00
|
|
|
gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj), set_headers, &data);
|
2018-10-10 18:16:12 +00:00
|
|
|
gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj), filter_meta, NULL);
|
2018-10-16 10:31:57 +00:00
|
|
|
/* sequence number has increased more if this was a buffer list */
|
|
|
|
payload->seqnum = data.seqnum - 1;
|
2009-06-19 13:52:34 +00:00
|
|
|
} else {
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (obj);
|
2012-01-25 10:04:43 +00:00
|
|
|
set_headers (&buf, 0, &data);
|
2018-10-10 18:16:12 +00:00
|
|
|
filter_meta (&buf, 0, NULL);
|
2009-06-19 13:52:34 +00:00
|
|
|
}
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
priv->next_seqnum = data.seqnum;
|
|
|
|
payload->timestamp = data.rtptime;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2019-03-15 16:38:58 +00:00
|
|
|
GST_LOG_OBJECT (payload, "Preparing to push %s with size %"
|
2012-03-13 17:15:04 +00:00
|
|
|
G_GSIZE_FORMAT ", seq=%d, rtptime=%u, pts %" GST_TIME_FORMAT,
|
2019-03-15 16:38:58 +00:00
|
|
|
(is_list) ? "list" : "packet",
|
|
|
|
(is_list) ? gst_buffer_list_length (GST_BUFFER_LIST_CAST (obj)) :
|
|
|
|
gst_buffer_get_size (GST_BUFFER (obj)),
|
2012-03-13 17:15:04 +00:00
|
|
|
payload->seqnum, data.rtptime, GST_TIME_ARGS (data.pts));
|
2005-11-30 19:08:14 +00:00
|
|
|
|
2018-10-10 18:16:12 +00:00
|
|
|
if (g_atomic_int_compare_and_exchange (&payload->priv->
|
|
|
|
notified_first_timestamp, 1, 0)) {
|
2010-09-06 11:14:00 +00:00
|
|
|
g_object_notify (G_OBJECT (payload), "timestamp");
|
|
|
|
g_object_notify (G_OBJECT (payload), "seqnum");
|
|
|
|
}
|
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
return GST_FLOW_OK;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_rate:
|
|
|
|
{
|
2005-09-19 14:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (payload, STREAM, NOT_IMPLEMENTED, (NULL),
|
2007-09-03 19:19:35 +00:00
|
|
|
("subclass did not specify clock-rate"));
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-19 13:52:34 +00:00
|
|
|
/**
|
2011-11-11 11:24:08 +00:00
|
|
|
* gst_rtp_base_payload_push_list:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
2009-06-19 13:52:34 +00:00
|
|
|
* @list: a #GstBufferList
|
|
|
|
*
|
|
|
|
* Push @list to the peer element of the payloader. The SSRC, payload type,
|
|
|
|
* seqnum and timestamp of the RTP buffer will be updated first.
|
|
|
|
*
|
|
|
|
* This function takes ownership of @list.
|
|
|
|
*
|
|
|
|
* Returns: a #GstFlowReturn.
|
|
|
|
*/
|
|
|
|
GstFlowReturn
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_push_list (GstRTPBasePayload * payload,
|
2011-11-10 16:18:00 +00:00
|
|
|
GstBufferList * list)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
res = gst_rtp_base_payload_prepare_push (payload, list, TRUE);
|
2009-06-19 13:52:34 +00:00
|
|
|
|
2013-05-12 13:55:38 +00:00
|
|
|
if (G_LIKELY (res == GST_FLOW_OK)) {
|
|
|
|
if (G_UNLIKELY (payload->priv->pending_segment)) {
|
|
|
|
gst_pad_push_event (payload->srcpad, payload->priv->pending_segment);
|
|
|
|
payload->priv->pending_segment = FALSE;
|
|
|
|
payload->priv->delay_segment = FALSE;
|
|
|
|
}
|
2009-06-19 13:52:34 +00:00
|
|
|
res = gst_pad_push_list (payload->srcpad, list);
|
2013-05-12 13:55:38 +00:00
|
|
|
} else {
|
2009-06-19 13:52:34 +00:00
|
|
|
gst_buffer_list_unref (list);
|
2013-05-12 13:55:38 +00:00
|
|
|
}
|
2009-06-19 13:52:34 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-11-11 11:24:08 +00:00
|
|
|
* gst_rtp_base_payload_push:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
2009-06-19 13:52:34 +00:00
|
|
|
* @buffer: a #GstBuffer
|
|
|
|
*
|
|
|
|
* Push @buffer to the peer element of the payloader. The SSRC, payload type,
|
|
|
|
* seqnum and timestamp of the RTP buffer will be updated first.
|
2009-09-02 17:47:26 +00:00
|
|
|
*
|
2009-06-19 13:52:34 +00:00
|
|
|
* This function takes ownership of @buffer.
|
|
|
|
*
|
|
|
|
* Returns: a #GstFlowReturn.
|
|
|
|
*/
|
|
|
|
GstFlowReturn
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_push (GstRTPBasePayload * payload, GstBuffer * buffer)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
|
2011-11-11 11:24:08 +00:00
|
|
|
res = gst_rtp_base_payload_prepare_push (payload, buffer, FALSE);
|
2009-06-19 13:52:34 +00:00
|
|
|
|
2013-05-12 13:55:38 +00:00
|
|
|
if (G_LIKELY (res == GST_FLOW_OK)) {
|
|
|
|
if (G_UNLIKELY (payload->priv->pending_segment)) {
|
|
|
|
gst_pad_push_event (payload->srcpad, payload->priv->pending_segment);
|
|
|
|
payload->priv->pending_segment = FALSE;
|
|
|
|
payload->priv->delay_segment = FALSE;
|
|
|
|
}
|
2009-06-19 13:52:34 +00:00
|
|
|
res = gst_pad_push (payload->srcpad, buffer);
|
2013-05-12 13:55:38 +00:00
|
|
|
} else {
|
2009-06-19 13:52:34 +00:00
|
|
|
gst_buffer_unref (buffer);
|
2013-05-12 13:55:38 +00:00
|
|
|
}
|
2009-06-19 13:52:34 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2018-10-10 18:16:12 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_base_payload_allocate_output_buffer:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
|
|
|
* @payload_len: the length of the payload
|
|
|
|
* @pad_len: the amount of padding
|
|
|
|
* @csrc_count: the minimum number of CSRC entries
|
|
|
|
*
|
|
|
|
* Allocate a new #GstBuffer with enough data to hold an RTP packet with
|
|
|
|
* minimum @csrc_count CSRCs, a payload length of @payload_len and padding of
|
|
|
|
* @pad_len. If @payload has #GstRTPBasePayload:source-info %TRUE additional
|
|
|
|
* CSRCs may be allocated and filled with RTP source information.
|
|
|
|
*
|
|
|
|
* Returns: A newly allocated buffer that can hold an RTP packet with given
|
|
|
|
* parameters.
|
|
|
|
*
|
|
|
|
* Since: 1.16
|
|
|
|
*/
|
|
|
|
GstBuffer *
|
|
|
|
gst_rtp_base_payload_allocate_output_buffer (GstRTPBasePayload * payload,
|
|
|
|
guint payload_len, guint8 pad_len, guint8 csrc_count)
|
|
|
|
{
|
|
|
|
GstBuffer *buffer = NULL;
|
|
|
|
|
|
|
|
if (payload->priv->input_meta_buffer != NULL) {
|
|
|
|
GstRTPSourceMeta *meta =
|
|
|
|
gst_buffer_get_rtp_source_meta (payload->priv->input_meta_buffer);
|
|
|
|
if (meta != NULL) {
|
|
|
|
guint total_csrc_count, idx, i;
|
|
|
|
GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
|
|
|
|
|
|
|
|
total_csrc_count = csrc_count + meta->csrc_count +
|
|
|
|
(meta->ssrc_valid ? 1 : 0);
|
|
|
|
total_csrc_count = MIN (total_csrc_count, 15);
|
|
|
|
buffer = gst_rtp_buffer_new_allocate (payload_len, pad_len,
|
|
|
|
total_csrc_count);
|
|
|
|
|
|
|
|
gst_rtp_buffer_map (buffer, GST_MAP_READWRITE, &rtp);
|
|
|
|
|
|
|
|
/* Skip CSRC fields requested by derived class and fill CSRCs from meta.
|
|
|
|
* Finally append the SSRC as a new CSRC. */
|
|
|
|
idx = csrc_count;
|
|
|
|
for (i = 0; i < meta->csrc_count && idx < 15; i++, idx++)
|
|
|
|
gst_rtp_buffer_set_csrc (&rtp, idx, meta->csrc[i]);
|
|
|
|
if (meta->ssrc_valid && idx < 15)
|
|
|
|
gst_rtp_buffer_set_csrc (&rtp, idx, meta->ssrc);
|
|
|
|
|
|
|
|
gst_rtp_buffer_unmap (&rtp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (buffer == NULL)
|
|
|
|
buffer = gst_rtp_buffer_new_allocate (payload_len, pad_len, csrc_count);
|
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
2014-01-16 20:49:59 +00:00
|
|
|
static GstStructure *
|
2014-03-20 08:18:31 +00:00
|
|
|
gst_rtp_base_payload_create_stats (GstRTPBasePayload * rtpbasepayload)
|
2014-01-16 20:49:59 +00:00
|
|
|
{
|
2014-01-27 23:40:38 +00:00
|
|
|
GstRTPBasePayloadPrivate *priv;
|
2014-01-16 20:49:59 +00:00
|
|
|
GstStructure *s;
|
|
|
|
|
2014-01-27 23:40:38 +00:00
|
|
|
priv = rtpbasepayload->priv;
|
|
|
|
|
2014-01-16 20:49:59 +00:00
|
|
|
s = gst_structure_new ("application/x-rtp-payload-stats",
|
2014-04-12 04:27:36 +00:00
|
|
|
"clock-rate", G_TYPE_UINT, (guint) rtpbasepayload->clock_rate,
|
2014-03-20 08:18:31 +00:00
|
|
|
"running-time", G_TYPE_UINT64, priv->running_time,
|
2014-04-12 04:27:36 +00:00
|
|
|
"seqnum", G_TYPE_UINT, (guint) rtpbasepayload->seqnum,
|
|
|
|
"timestamp", G_TYPE_UINT, (guint) rtpbasepayload->timestamp,
|
2014-03-20 08:18:31 +00:00
|
|
|
"ssrc", G_TYPE_UINT, rtpbasepayload->current_ssrc,
|
2014-04-12 04:27:36 +00:00
|
|
|
"pt", G_TYPE_UINT, rtpbasepayload->pt,
|
|
|
|
"seqnum-offset", G_TYPE_UINT, (guint) rtpbasepayload->seqnum_base,
|
|
|
|
"timestamp-offset", G_TYPE_UINT, (guint) rtpbasepayload->ts_base, NULL);
|
2014-01-16 20:49:59 +00:00
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
static void
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
2011-11-11 11:24:08 +00:00
|
|
|
GstRTPBasePayloadPrivate *priv;
|
2007-07-14 17:23:42 +00:00
|
|
|
gint64 val;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
|
|
|
|
priv = rtpbasepayload->priv;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_MTU:
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->mtu = g_value_get_uint (value);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
case PROP_PT:
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->pt = g_value_get_uint (value);
|
2015-05-19 13:32:38 +00:00
|
|
|
priv->pt_set = TRUE;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
case PROP_SSRC:
|
2007-07-16 10:10:28 +00:00
|
|
|
val = g_value_get_uint (value);
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->ssrc = val;
|
2007-07-16 10:10:28 +00:00
|
|
|
priv->ssrc_random = FALSE;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
2005-09-20 11:50:20 +00:00
|
|
|
case PROP_TIMESTAMP_OFFSET:
|
2007-07-16 10:10:28 +00:00
|
|
|
val = g_value_get_uint (value);
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->ts_offset = val;
|
2007-07-16 10:10:28 +00:00
|
|
|
priv->ts_offset_random = FALSE;
|
2005-09-20 11:50:20 +00:00
|
|
|
break;
|
2005-09-20 13:34:02 +00:00
|
|
|
case PROP_SEQNUM_OFFSET:
|
2007-07-14 17:23:42 +00:00
|
|
|
val = g_value_get_int (value);
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->seqnum_offset = val;
|
2007-07-14 17:23:42 +00:00
|
|
|
priv->seqnum_offset_random = (val == -1);
|
2011-11-11 11:32:23 +00:00
|
|
|
GST_DEBUG_OBJECT (rtpbasepayload, "seqnum offset 0x%04x, random %d",
|
|
|
|
rtpbasepayload->seqnum_offset, priv->seqnum_offset_random);
|
2005-09-20 13:34:02 +00:00
|
|
|
break;
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
case PROP_MAX_PTIME:
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->priv->prop_max_ptime = g_value_get_int64 (value);
|
|
|
|
update_max_ptime (rtpbasepayload);
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
break;
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
case PROP_MIN_PTIME:
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->min_ptime = g_value_get_int64 (value);
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
break;
|
2009-09-03 09:29:23 +00:00
|
|
|
case PROP_PERFECT_RTPTIME:
|
|
|
|
priv->perfect_rtptime = g_value_get_boolean (value);
|
|
|
|
break;
|
2010-04-09 14:06:05 +00:00
|
|
|
case PROP_PTIME_MULTIPLE:
|
2011-11-11 18:21:09 +00:00
|
|
|
rtpbasepayload->ptime_multiple = g_value_get_int64 (value);
|
2010-04-09 14:06:05 +00:00
|
|
|
break;
|
2018-10-10 18:16:12 +00:00
|
|
|
case PROP_SOURCE_INFO:
|
|
|
|
gst_rtp_base_payload_set_source_info_enabled (rtpbasepayload,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
2018-11-19 22:42:14 +00:00
|
|
|
case PROP_ONVIF_NO_RATE_CONTROL:
|
|
|
|
priv->onvif_no_rate_control = g_value_get_boolean (value);
|
|
|
|
break;
|
2020-03-09 14:26:42 +00:00
|
|
|
case PROP_SCALE_RTPTIME:
|
|
|
|
priv->scale_rtptime = g_value_get_boolean (value);
|
|
|
|
break;
|
2021-01-26 08:37:44 +00:00
|
|
|
case PROP_AUTO_HEADER_EXTENSION:
|
|
|
|
priv->auto_hdr_ext = g_value_get_boolean (value);
|
|
|
|
break;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
2011-11-11 11:24:08 +00:00
|
|
|
GstRTPBasePayloadPrivate *priv;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
|
|
|
|
priv = rtpbasepayload->priv;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_MTU:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_uint (value, rtpbasepayload->mtu);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
case PROP_PT:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_uint (value, rtpbasepayload->pt);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
case PROP_SSRC:
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->ssrc_random)
|
2007-07-16 10:10:28 +00:00
|
|
|
g_value_set_uint (value, -1);
|
2007-07-14 17:23:42 +00:00
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_uint (value, rtpbasepayload->ssrc);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
2005-09-20 11:50:20 +00:00
|
|
|
case PROP_TIMESTAMP_OFFSET:
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->ts_offset_random)
|
2007-07-16 10:10:28 +00:00
|
|
|
g_value_set_uint (value, -1);
|
2007-07-14 17:23:42 +00:00
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_uint (value, (guint32) rtpbasepayload->ts_offset);
|
2005-09-20 11:50:20 +00:00
|
|
|
break;
|
2005-09-20 13:34:02 +00:00
|
|
|
case PROP_SEQNUM_OFFSET:
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->seqnum_offset_random)
|
|
|
|
g_value_set_int (value, -1);
|
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_int (value, (guint16) rtpbasepayload->seqnum_offset);
|
2005-09-20 13:34:02 +00:00
|
|
|
break;
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
case PROP_MAX_PTIME:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_int64 (value, rtpbasepayload->max_ptime);
|
gst-libs/gst/rtp/gstbasertppayload.*: Added max-ptime to control amount of data in the rtp packets.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_chain),
(gst_basertppayload_set_options), (gst_basertppayload_set_outcaps),
(gst_basertppayload_is_filled), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added max-ptime to control amount of data in the rtp packets.
2005-09-22 14:13:04 +00:00
|
|
|
break;
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
case PROP_MIN_PTIME:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_int64 (value, rtpbasepayload->min_ptime);
|
gst-libs/gst/rtp/gstbasertpaudiopayload.c: Some cleanups, remove minptime property as it is now in the parent class.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
(gst_base_rtp_audio_payload_class_init),
(gst_base_rtp_audio_payload_init),
(gst_base_rtp_audio_payload_finalize),
(gst_base_rtp_audio_payload_handle_frame_based_buffer),
(gst_base_rtp_audio_payload_handle_sample_based_buffer),
(gst_base_rtp_payload_audio_handle_event):
Some cleanups, remove minptime property as it is now in the parent
class.
Override parent class event function.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_event), (gst_basertppayload_set_property),
(gst_basertppayload_get_property):
* gst-libs/gst/rtp/gstbasertppayload.h:
Add min-ptime property.
Add handle-event vmethod. Fixes #415001.
2007-05-21 09:45:28 +00:00
|
|
|
break;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
case PROP_TIMESTAMP:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_uint (value, rtpbasepayload->timestamp);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
case PROP_SEQNUM:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_value_set_uint (value, rtpbasepayload->seqnum);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
2009-09-03 09:29:23 +00:00
|
|
|
case PROP_PERFECT_RTPTIME:
|
|
|
|
g_value_set_boolean (value, priv->perfect_rtptime);
|
|
|
|
break;
|
2010-04-09 14:06:05 +00:00
|
|
|
case PROP_PTIME_MULTIPLE:
|
2011-11-11 18:21:09 +00:00
|
|
|
g_value_set_int64 (value, rtpbasepayload->ptime_multiple);
|
2010-04-09 14:06:05 +00:00
|
|
|
break;
|
2014-01-16 20:49:59 +00:00
|
|
|
case PROP_STATS:
|
|
|
|
g_value_take_boxed (value,
|
|
|
|
gst_rtp_base_payload_create_stats (rtpbasepayload));
|
|
|
|
break;
|
2018-10-10 18:16:12 +00:00
|
|
|
case PROP_SOURCE_INFO:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gst_rtp_base_payload_is_source_info_enabled (rtpbasepayload));
|
|
|
|
break;
|
2018-11-19 22:42:14 +00:00
|
|
|
case PROP_ONVIF_NO_RATE_CONTROL:
|
|
|
|
g_value_set_boolean (value, priv->onvif_no_rate_control);
|
|
|
|
break;
|
2020-03-09 14:26:42 +00:00
|
|
|
case PROP_SCALE_RTPTIME:
|
|
|
|
g_value_set_boolean (value, priv->scale_rtptime);
|
|
|
|
break;
|
2021-01-26 08:37:44 +00:00
|
|
|
case PROP_AUTO_HEADER_EXTENSION:
|
|
|
|
g_value_set_boolean (value, priv->auto_hdr_ext);
|
|
|
|
break;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstStateChangeReturn
|
2011-11-11 11:24:08 +00:00
|
|
|
gst_rtp_base_payload_change_state (GstElement * element,
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
GstStateChange transition)
|
|
|
|
{
|
2011-11-11 11:32:23 +00:00
|
|
|
GstRTPBasePayload *rtpbasepayload;
|
2011-11-11 11:24:08 +00:00
|
|
|
GstRTPBasePayloadPrivate *priv;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
GstStateChangeReturn ret;
|
|
|
|
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (element);
|
|
|
|
priv = rtpbasepayload->priv;
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
|
|
break;
|
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2011-11-11 11:32:23 +00:00
|
|
|
gst_segment_init (&rtpbasepayload->segment, GST_FORMAT_UNDEFINED);
|
2013-05-12 13:55:38 +00:00
|
|
|
rtpbasepayload->priv->delay_segment = TRUE;
|
|
|
|
gst_event_replace (&rtpbasepayload->priv->pending_segment, NULL);
|
2005-09-20 13:34:02 +00:00
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->seqnum_offset_random)
|
2014-01-03 10:06:22 +00:00
|
|
|
rtpbasepayload->seqnum_base = g_random_int_range (0, G_MAXINT16);
|
2005-09-20 13:34:02 +00:00
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->seqnum_base = rtpbasepayload->seqnum_offset;
|
|
|
|
priv->next_seqnum = rtpbasepayload->seqnum_base;
|
|
|
|
rtpbasepayload->seqnum = rtpbasepayload->seqnum_base;
|
2005-09-20 13:34:02 +00:00
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->ssrc_random)
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->current_ssrc = g_random_int ();
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->current_ssrc = rtpbasepayload->ssrc;
|
2005-09-20 13:34:02 +00:00
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->ts_offset_random)
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->ts_base = g_random_int ();
|
2005-09-20 11:50:20 +00:00
|
|
|
else
|
2011-11-11 11:32:23 +00:00
|
|
|
rtpbasepayload->ts_base = rtpbasepayload->ts_offset;
|
|
|
|
rtpbasepayload->timestamp = rtpbasepayload->ts_base;
|
2014-01-27 23:40:38 +00:00
|
|
|
priv->running_time = DEFAULT_RUNNING_TIME;
|
2011-11-11 11:32:23 +00:00
|
|
|
g_atomic_int_set (&rtpbasepayload->priv->notified_first_timestamp, 1);
|
2011-07-09 03:06:46 +00:00
|
|
|
priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
2012-09-06 17:16:54 +00:00
|
|
|
priv->negotiated = FALSE;
|
2014-05-02 23:09:59 +00:00
|
|
|
gst_caps_replace (&rtpbasepayload->priv->subclass_srccaps, NULL);
|
2014-03-15 16:35:56 +00:00
|
|
|
gst_caps_replace (&rtpbasepayload->priv->sinkcaps, NULL);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
2010-09-06 11:14:00 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2011-11-11 11:32:23 +00:00
|
|
|
g_atomic_int_set (&rtpbasepayload->priv->notified_first_timestamp, 1);
|
2010-09-06 11:14:00 +00:00
|
|
|
break;
|
2013-05-12 13:55:38 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
|
|
|
gst_event_replace (&rtpbasepayload->priv->pending_segment, NULL);
|
gst-libs/gst/rtp/: Added rtp payloader base class.
Original commit message from CVS:
* gst-libs/gst/rtp/Makefile.am:
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_get_type), (gst_basertppayload_base_init),
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_finalize), (gst_basertppayload_setcaps),
(gst_basertppayload_chain), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_set_property),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
* gst-libs/gst/rtp/gstbasertppayload.h:
Added rtp payloader base class.
2005-09-15 13:50:05 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2018-10-10 18:16:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_base_payload_set_source_info_enabled:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
|
|
|
* @enable: whether to add contributing sources to RTP packets
|
|
|
|
*
|
|
|
|
* Enable or disable adding contributing sources to RTP packets from
|
|
|
|
* #GstRTPSourceMeta.
|
|
|
|
*
|
|
|
|
* Since: 1.16
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gst_rtp_base_payload_set_source_info_enabled (GstRTPBasePayload * payload,
|
|
|
|
gboolean enable)
|
|
|
|
{
|
|
|
|
payload->priv->source_info = enable;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_base_payload_is_source_info_enabled:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
|
|
|
*
|
|
|
|
* Queries whether the payloader will add contributing sources (CSRCs) to the
|
|
|
|
* RTP header from #GstRTPSourceMeta.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if source-info is enabled.
|
|
|
|
*
|
|
|
|
* Since: 1.16
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gst_rtp_base_payload_is_source_info_enabled (GstRTPBasePayload * payload)
|
|
|
|
{
|
|
|
|
return payload->priv->source_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_base_payload_get_source_count:
|
|
|
|
* @payload: a #GstRTPBasePayload
|
|
|
|
* @buffer: (transfer none): a #GstBuffer, typically the buffer to payload
|
|
|
|
*
|
|
|
|
* Count the total number of RTP sources found in the meta of @buffer, which
|
|
|
|
* will be automically added by gst_rtp_base_payload_allocate_output_buffer().
|
|
|
|
* If #GstRTPBasePayload:source-info is %FALSE the count will be 0.
|
|
|
|
*
|
|
|
|
* Returns: The number of sources.
|
|
|
|
*
|
|
|
|
* Since: 1.16
|
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gst_rtp_base_payload_get_source_count (GstRTPBasePayload * payload,
|
|
|
|
GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
guint count = 0;
|
|
|
|
|
|
|
|
g_return_val_if_fail (buffer != NULL, 0);
|
|
|
|
|
|
|
|
if (gst_rtp_base_payload_is_source_info_enabled (payload)) {
|
|
|
|
GstRTPSourceMeta *meta = gst_buffer_get_rtp_source_meta (buffer);
|
|
|
|
if (meta != NULL)
|
|
|
|
count = gst_rtp_source_meta_get_source_count (meta);
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|