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
|
|
|
/**
|
|
|
|
* SECTION:gstbasertppayload
|
|
|
|
* @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>
|
|
|
|
|
|
|
|
#include "gstbasertppayload.h"
|
|
|
|
|
2006-06-23 09:53:09 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (basertppayload_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
|
|
|
#define GST_CAT_DEFAULT (basertppayload_debug)
|
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
#define GST_BASE_RTP_PAYLOAD_GET_PRIVATE(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_RTP_PAYLOAD, GstBaseRTPPayloadPrivate))
|
|
|
|
|
|
|
|
struct _GstBaseRTPPayloadPrivate
|
|
|
|
{
|
|
|
|
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
|
|
|
|
2011-07-09 03:06:46 +00:00
|
|
|
guint64 base_offset;
|
|
|
|
gint64 base_rtime;
|
|
|
|
|
2009-12-02 14:10:58 +00:00
|
|
|
gint64 prop_max_ptime;
|
|
|
|
gint64 caps_max_ptime;
|
2007-07-14 17:23:42 +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
|
|
|
/* BaseRTPPayload signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
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
|
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,
|
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-10 16:18:00 +00:00
|
|
|
static void gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass);
|
|
|
|
static void gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload,
|
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-10 16:18:00 +00:00
|
|
|
static void gst_base_rtp_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-10 16:18:00 +00:00
|
|
|
static GstCaps *gst_base_rtp_payload_sink_getcaps (GstPad * pad,
|
2011-05-16 08:44:18 +00:00
|
|
|
GstCaps * filter);
|
2011-11-10 16:18:00 +00:00
|
|
|
static gboolean gst_base_rtp_payload_event_default (GstBaseRTPPayload *
|
2011-06-02 17:21:24 +00:00
|
|
|
basertppayload, GstEvent * event);
|
2011-11-10 16:18:00 +00:00
|
|
|
static gboolean gst_base_rtp_payload_event (GstPad * pad, GstEvent * event);
|
|
|
|
static GstFlowReturn gst_base_rtp_payload_chain (GstPad * pad,
|
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
|
|
|
GstBuffer * buffer);
|
2011-11-10 16:18:00 +00:00
|
|
|
static GstCaps *gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload *
|
|
|
|
basertppayload, GstPad * pad, GstCaps * filter);
|
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-10 16:18:00 +00:00
|
|
|
static void gst_base_rtp_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-10 16:18:00 +00:00
|
|
|
static void gst_base_rtp_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-10 16:18:00 +00:00
|
|
|
static GstStateChangeReturn gst_base_rtp_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);
|
|
|
|
|
|
|
|
static GstElementClass *parent_class = NULL;
|
|
|
|
|
2007-04-21 15:10:25 +00:00
|
|
|
/* FIXME 0.11: API should be changed to gst_base_typ_payload_xyz */
|
|
|
|
|
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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_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
|
|
|
{
|
|
|
|
static GType basertppayload_type = 0;
|
|
|
|
|
2011-04-18 16:30:41 +00:00
|
|
|
if (g_once_init_enter ((gsize *) & basertppayload_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
|
|
|
static const GTypeInfo basertppayload_info = {
|
|
|
|
sizeof (GstBaseRTPPayloadClass),
|
|
|
|
NULL,
|
2011-11-10 16:18:00 +00:00
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_base_rtp_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,
|
|
|
|
sizeof (GstBaseRTPPayload),
|
|
|
|
0,
|
2011-11-10 16:18:00 +00:00
|
|
|
(GInstanceInitFunc) gst_base_rtp_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
|
|
|
};
|
|
|
|
|
2011-04-18 16:30:41 +00:00
|
|
|
g_once_init_leave ((gsize *) & basertppayload_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
|
|
|
g_type_register_static (GST_TYPE_ELEMENT, "GstBaseRTPPayload",
|
2011-04-18 16:30:41 +00:00
|
|
|
&basertppayload_info, G_TYPE_FLAG_ABSTRACT));
|
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 basertppayload_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * 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;
|
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
g_type_class_add_private (klass, sizeof (GstBaseRTPPayloadPrivate));
|
|
|
|
|
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-10 16:18:00 +00:00
|
|
|
gobject_class->finalize = gst_base_rtp_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-10 16:18:00 +00:00
|
|
|
gobject_class->set_property = gst_base_rtp_payload_set_property;
|
|
|
|
gobject_class->get_property = gst_base_rtp_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",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The payload type of the packets", 0, 0x80, DEFAULT_PT,
|
|
|
|
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
|
|
|
/**
|
|
|
|
* GstBaseRTPAudioPayload:min-ptime:
|
|
|
|
*
|
|
|
|
* Minimum duration of the packet data in ns (can't go above MTU)
|
|
|
|
*
|
|
|
|
* Since: 0.10.13
|
|
|
|
**/
|
|
|
|
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
|
|
|
/**
|
|
|
|
* GstBaseRTPAudioPayload:perfect-rtptime:
|
|
|
|
*
|
|
|
|
* Try to use the offset fields to generate perfect RTP timestamps. when this
|
|
|
|
* option is disabled, RTP timestamps are generated from the GStreamer
|
|
|
|
* timestamps, which could result in RTP timestamps that don't increment with
|
|
|
|
* the amount of data in the packet.
|
|
|
|
*
|
|
|
|
* Since: 0.10.25
|
|
|
|
*/
|
|
|
|
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
|
|
|
/**
|
|
|
|
* GstBaseRTPAudioPayload:ptime-multiple:
|
|
|
|
*
|
|
|
|
* Force buffers to be multiples of this duration in ns (0 disables)
|
|
|
|
*
|
|
|
|
* Since: 0.10.29
|
|
|
|
**/
|
|
|
|
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
|
|
|
|
2011-11-10 16:18:00 +00:00
|
|
|
gstelement_class->change_state = gst_base_rtp_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-10 16:18:00 +00:00
|
|
|
klass->get_caps = gst_base_rtp_payload_getcaps_default;
|
|
|
|
klass->handle_event = gst_base_rtp_payload_event_default;
|
2011-06-02 17:21:24 +00:00
|
|
|
|
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
|
|
|
GST_DEBUG_CATEGORY_INIT (basertppayload_debug, "basertppayload", 0,
|
|
|
|
"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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, 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;
|
2007-07-14 17:23:42 +00:00
|
|
|
GstBaseRTPPayloadPrivate *priv;
|
|
|
|
|
|
|
|
basertppayload->priv = priv =
|
|
|
|
GST_BASE_RTP_PAYLOAD_GET_PRIVATE (basertppayload);
|
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);
|
|
|
|
|
|
|
|
basertppayload->srcpad = gst_pad_new_from_template (templ, "src");
|
|
|
|
gst_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->srcpad);
|
|
|
|
|
|
|
|
templ =
|
|
|
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
|
|
|
|
g_return_if_fail (templ != NULL);
|
|
|
|
|
|
|
|
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
2007-08-16 16:06:21 +00:00
|
|
|
gst_pad_set_getcaps_function (basertppayload->sinkpad,
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_sink_getcaps);
|
2005-11-30 19:08:14 +00:00
|
|
|
gst_pad_set_event_function (basertppayload->sinkpad,
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_event);
|
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_pad_set_chain_function (basertppayload->sinkpad,
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_chain);
|
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_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->sinkpad);
|
|
|
|
|
|
|
|
basertppayload->mtu = DEFAULT_MTU;
|
|
|
|
basertppayload->pt = DEFAULT_PT;
|
2005-09-20 13:34:02 +00:00
|
|
|
basertppayload->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
|
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
|
|
|
basertppayload->ssrc = DEFAULT_SSRC;
|
2005-09-20 11:50:20 +00:00
|
|
|
basertppayload->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
|
2007-07-14 17:23:42 +00:00
|
|
|
priv->seqnum_offset_random = (basertppayload->seqnum_offset == -1);
|
|
|
|
priv->ts_offset_random = (basertppayload->ts_offset == -1);
|
|
|
|
priv->ssrc_random = (basertppayload->ssrc == -1);
|
|
|
|
|
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
|
|
|
basertppayload->max_ptime = DEFAULT_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
|
|
|
basertppayload->min_ptime = DEFAULT_MIN_PTIME;
|
2009-09-03 09:29:23 +00:00
|
|
|
basertppayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
|
2010-04-09 14:06:05 +00:00
|
|
|
basertppayload->abidata.ABI.ptime_multiple = DEFAULT_PTIME_MULTIPLE;
|
2011-07-09 03:06:46 +00:00
|
|
|
basertppayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
|
|
|
basertppayload->priv->base_rtime = GST_BUFFER_OFFSET_NONE;
|
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
|
|
|
|
2006-10-12 19:09:06 +00:00
|
|
|
basertppayload->media = NULL;
|
|
|
|
basertppayload->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
|
|
|
basertppayload->clock_rate = 0;
|
2009-12-02 14:10:58 +00:00
|
|
|
|
|
|
|
basertppayload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
|
|
|
basertppayload->priv->prop_max_ptime = DEFAULT_MAX_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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_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
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (object);
|
|
|
|
|
2006-10-12 19:09:06 +00:00
|
|
|
g_free (basertppayload->media);
|
|
|
|
basertppayload->media = NULL;
|
|
|
|
g_free (basertppayload->encoding_name);
|
|
|
|
basertppayload->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
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2007-08-16 16:06:21 +00:00
|
|
|
static GstCaps *
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * basertppayload,
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps *
|
|
|
|
gst_base_rtp_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
2007-08-16 16:06:21 +00:00
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
|
|
|
GstBaseRTPPayloadClass *basertppayload_class;
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (pad, "getting caps");
|
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
|
|
|
|
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
|
|
|
|
|
|
|
if (basertppayload_class->get_caps)
|
2011-05-16 08:44:18 +00:00
|
|
|
caps = basertppayload_class->get_caps (basertppayload, pad, filter);
|
2007-08-16 16:06:21 +00:00
|
|
|
|
|
|
|
gst_object_unref (basertppayload);
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
2005-11-30 19:08:14 +00:00
|
|
|
static gboolean
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
|
2011-06-02 17:21:24 +00:00
|
|
|
GstEvent * event)
|
2005-11-30 19:08:14 +00:00
|
|
|
{
|
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-06-02 17:21:24 +00:00
|
|
|
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
2005-11-30 19:08:14 +00:00
|
|
|
break;
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
2011-06-02 17:21:24 +00:00
|
|
|
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
2005-11-30 19:08:14 +00:00
|
|
|
gst_segment_init (&basertppayload->segment, GST_FORMAT_UNDEFINED);
|
|
|
|
break;
|
2011-06-02 17:21:24 +00:00
|
|
|
case GST_EVENT_CAPS:
|
|
|
|
{
|
|
|
|
GstBaseRTPPayloadClass *basertppayload_class;
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
gst_event_parse_caps (event, &caps);
|
|
|
|
GST_DEBUG_OBJECT (basertppayload, "setting caps %" GST_PTR_FORMAT, caps);
|
|
|
|
|
|
|
|
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
|
|
|
if (basertppayload_class->set_caps)
|
|
|
|
res = basertppayload_class->set_caps (basertppayload, caps);
|
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;
|
|
|
|
|
|
|
|
segment = &basertppayload->segment;
|
2011-05-18 15:23:18 +00:00
|
|
|
gst_event_copy_segment (event, segment);
|
2010-12-20 17:28:14 +00:00
|
|
|
|
2011-07-09 03:06:46 +00:00
|
|
|
basertppayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
|
|
|
|
2010-12-20 17:28:14 +00:00
|
|
|
GST_DEBUG_OBJECT (basertppayload,
|
2011-05-16 11:48:11 +00:00
|
|
|
"configured SEGMENT %" GST_SEGMENT_FORMAT, segment);
|
2011-06-02 17:21:24 +00:00
|
|
|
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
|
|
|
break;
|
2007-09-14 20:52:00 +00:00
|
|
|
}
|
2005-11-30 19:08:14 +00:00
|
|
|
default:
|
2011-06-02 17:21:24 +00:00
|
|
|
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
2005-11-30 19:08:14 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-02 17:21:24 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_event (GstPad * pad, GstEvent * event)
|
2011-06-02 17:21:24 +00:00
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
|
|
|
GstBaseRTPPayloadClass *basertppayload_class;
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
|
|
|
|
if (G_UNLIKELY (basertppayload == NULL)) {
|
|
|
|
gst_event_unref (event);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
|
|
|
|
|
|
|
if (basertppayload_class->handle_event)
|
|
|
|
res = basertppayload_class->handle_event (basertppayload, event);
|
|
|
|
else
|
|
|
|
gst_event_unref (event);
|
2005-11-30 19:08:14 +00:00
|
|
|
|
|
|
|
gst_object_unref (basertppayload);
|
|
|
|
|
|
|
|
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
|
|
|
static GstFlowReturn
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_chain (GstPad * pad, 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
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
|
|
|
GstBaseRTPPayloadClass *basertppayload_class;
|
|
|
|
GstFlowReturn ret;
|
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
|
|
|
|
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
|
|
|
|
|
|
|
if (!basertppayload_class->handle_buffer)
|
|
|
|
goto no_function;
|
|
|
|
|
|
|
|
ret = basertppayload_class->handle_buffer (basertppayload, buffer);
|
|
|
|
|
|
|
|
gst_object_unref (basertppayload);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_function:
|
|
|
|
{
|
2005-09-19 14:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (basertppayload, STREAM, NOT_IMPLEMENTED, (NULL),
|
|
|
|
("subclass did not implement handle_buffer function"));
|
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_object_unref (basertppayload);
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/**
|
2011-11-10 16:18:00 +00:00
|
|
|
* gst_base_rtp_payload_set_options:
|
2007-08-12 16:30:36 +00:00
|
|
|
* @payload: a #GstBaseRTPPayload
|
|
|
|
* @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-10 16:18:00 +00:00
|
|
|
* gst_base_rtp_payload_push() or gst_base_rtp_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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_set_options (GstBaseRTPPayload * 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
|
|
|
|
update_max_ptime (GstBaseRTPPayload * basertppayload)
|
|
|
|
{
|
|
|
|
if (basertppayload->priv->caps_max_ptime != -1 &&
|
|
|
|
basertppayload->priv->prop_max_ptime != -1)
|
|
|
|
basertppayload->max_ptime = MIN (basertppayload->priv->caps_max_ptime,
|
|
|
|
basertppayload->priv->prop_max_ptime);
|
|
|
|
else if (basertppayload->priv->caps_max_ptime != -1)
|
|
|
|
basertppayload->max_ptime = basertppayload->priv->caps_max_ptime;
|
|
|
|
else if (basertppayload->priv->prop_max_ptime != -1)
|
|
|
|
basertppayload->max_ptime = basertppayload->priv->prop_max_ptime;
|
|
|
|
else
|
|
|
|
basertppayload->max_ptime = DEFAULT_MAX_PTIME;
|
|
|
|
}
|
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/**
|
2011-11-10 16:18:00 +00:00
|
|
|
* gst_base_rtp_payload_set_outcaps:
|
2007-08-12 16:30:36 +00:00
|
|
|
* @payload: a #GstBaseRTPPayload
|
|
|
|
* @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.
|
|
|
|
*/
|
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
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
|
2010-03-19 21:33:58 +00:00
|
|
|
const gchar * fieldname, ...)
|
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
|
|
|
GstCaps *srccaps, *peercaps;
|
2008-10-13 09:16:59 +00:00
|
|
|
gboolean 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
|
|
|
|
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);
|
|
|
|
|
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;
|
|
|
|
|
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);
|
2007-08-12 16:30:36 +00:00
|
|
|
gst_caps_set_simple_valist (srccaps, 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);
|
2007-09-15 18:41:27 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (payload, "custom added: %" GST_PTR_FORMAT, 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-12-02 14:10:58 +00:00
|
|
|
payload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
2009-12-29 23:36:29 +00:00
|
|
|
payload->abidata.ABI.ptime = 0;
|
2009-12-02 14:10:58 +00:00
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/* the peer caps can override some of the defaults */
|
2011-05-16 08:44:18 +00:00
|
|
|
peercaps = gst_pad_peer_get_caps (payload->srcpad, srccaps);
|
2007-08-12 16:30:36 +00:00
|
|
|
if (peercaps == NULL) {
|
|
|
|
/* no peer caps, just add the other properties */
|
|
|
|
gst_caps_set_simple (srccaps,
|
|
|
|
"payload", G_TYPE_INT, GST_BASE_RTP_PAYLOAD_PT (payload),
|
|
|
|
"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;
|
2007-09-19 15:55:08 +00:00
|
|
|
GstStructure *s, *d;
|
2007-08-12 16:30:36 +00:00
|
|
|
const GValue *value;
|
|
|
|
gint pt;
|
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);
|
2007-08-12 16:30:36 +00:00
|
|
|
gst_caps_unref (srccaps);
|
|
|
|
|
2010-01-18 19:33:30 +00:00
|
|
|
if (gst_caps_is_empty (temp)) {
|
|
|
|
gst_caps_unref (temp);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-08-12 16:30:36 +00:00
|
|
|
/* now fixate, start by taking the first caps */
|
|
|
|
gst_caps_truncate (temp);
|
|
|
|
|
|
|
|
/* get first structure */
|
2007-09-19 15:55:08 +00:00
|
|
|
s = gst_caps_get_structure (temp, 0);
|
2007-08-12 16:30:36 +00:00
|
|
|
|
2010-01-19 19:31:34 +00:00
|
|
|
if (gst_structure_get_uint (s, "maxptime", &max_ptime))
|
2009-12-02 14:10:58 +00:00
|
|
|
payload->priv->caps_max_ptime = max_ptime * GST_MSECOND;
|
|
|
|
|
2010-01-19 19:31:34 +00:00
|
|
|
if (gst_structure_get_uint (s, "ptime", &ptime))
|
2010-01-19 02:16:32 +00:00
|
|
|
payload->abidata.ABI.ptime = ptime * GST_MSECOND;
|
2009-12-29 23:36:29 +00:00
|
|
|
|
2007-09-15 18:41:27 +00:00
|
|
|
if (gst_structure_get_int (s, "payload", &pt)) {
|
|
|
|
/* use peer pt */
|
2007-08-12 16:30:36 +00:00
|
|
|
GST_BASE_RTP_PAYLOAD_PT (payload) = pt;
|
2007-09-15 18:41:27 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using peer pt %d", pt);
|
|
|
|
} else {
|
2007-08-12 16:30:36 +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_BASE_RTP_PAYLOAD_PT (payload));
|
2007-09-15 18:41:27 +00:00
|
|
|
gst_structure_get_int (s, "payload", &pt);
|
|
|
|
GST_LOG_OBJECT (payload, "using peer pt %d", pt);
|
2007-08-12 16:30:36 +00:00
|
|
|
} else {
|
2007-09-15 18:41:27 +00:00
|
|
|
/* no pt field, use the internal pt */
|
|
|
|
pt = GST_BASE_RTP_PAYLOAD_PT (payload);
|
|
|
|
gst_structure_set (s, "payload", G_TYPE_INT, pt, NULL);
|
2007-09-19 15:55:08 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using internal pt %d", pt);
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2007-09-15 18:41:27 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using peer ssrc %08x", payload->current_ssrc);
|
2007-08-12 16:30:36 +00:00
|
|
|
} else {
|
|
|
|
/* FIXME, fixate_nearest_uint would be even better */
|
|
|
|
gst_structure_set (s, "ssrc", G_TYPE_UINT, payload->current_ssrc, NULL);
|
2007-09-15 18:41:27 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using internal ssrc %08x",
|
|
|
|
payload->current_ssrc);
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
|
|
|
|
2011-10-27 16:54:50 +00:00
|
|
|
if (gst_structure_has_field_typed (s, "timestamp-offset", G_TYPE_UINT)) {
|
|
|
|
value = gst_structure_get_value (s, "timestamp-offset");
|
2007-08-12 16:30:36 +00:00
|
|
|
payload->ts_base = g_value_get_uint (value);
|
2011-10-27 16:54:50 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using peer timestamp-offset %u",
|
|
|
|
payload->ts_base);
|
2007-08-12 16:30:36 +00:00
|
|
|
} else {
|
|
|
|
/* FIXME, fixate_nearest_uint would be even better */
|
2011-10-27 16:54:50 +00:00
|
|
|
gst_structure_set (s, "timestamp-offset", G_TYPE_UINT, payload->ts_base,
|
|
|
|
NULL);
|
|
|
|
GST_LOG_OBJECT (payload, "using internal timestamp-offset %u",
|
2007-09-15 18:41:27 +00:00
|
|
|
payload->ts_base);
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
2011-10-27 16:54:50 +00:00
|
|
|
if (gst_structure_has_field_typed (s, "seqnum-offset", G_TYPE_UINT)) {
|
|
|
|
value = gst_structure_get_value (s, "seqnum-offset");
|
2007-08-12 16:30:36 +00:00
|
|
|
payload->seqnum_base = g_value_get_uint (value);
|
2011-10-27 16:54:50 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using peer seqnum-offset %u",
|
2007-09-15 18:41:27 +00:00
|
|
|
payload->seqnum_base);
|
2007-08-12 16:30:36 +00:00
|
|
|
} else {
|
|
|
|
/* FIXME, fixate_nearest_uint would be even better */
|
2011-10-27 16:54:50 +00:00
|
|
|
gst_structure_set (s, "seqnum-offset", G_TYPE_UINT, payload->seqnum_base,
|
2007-08-12 16:30:36 +00:00
|
|
|
NULL);
|
2011-10-27 16:54:50 +00:00
|
|
|
GST_LOG_OBJECT (payload, "using internal seqnum-offset %u",
|
2007-09-15 18:41:27 +00:00
|
|
|
payload->seqnum_base);
|
2007-08-12 16:30:36 +00:00
|
|
|
}
|
2007-09-19 15:55:08 +00:00
|
|
|
|
|
|
|
/* make the target caps by copying over all the fixed caps, removing the
|
|
|
|
* unfixed caps. */
|
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
|
|
|
}
|
|
|
|
|
2009-12-02 14:10:58 +00:00
|
|
|
update_max_ptime (payload);
|
|
|
|
|
2008-10-13 09:16:59 +00:00
|
|
|
res = gst_pad_set_caps (GST_BASE_RTP_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);
|
|
|
|
|
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-10 16:18:00 +00:00
|
|
|
* gst_base_rtp_payload_is_filled:
|
2007-08-12 16:30:36 +00:00
|
|
|
* @payload: a #GstBaseRTPPayload
|
|
|
|
* @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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_is_filled (GstBaseRTPPayload * 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
|
|
|
{
|
2009-06-19 13:52:34 +00:00
|
|
|
GstBaseRTPPayload *payload;
|
|
|
|
guint32 ssrc;
|
|
|
|
guint16 seqnum;
|
|
|
|
guint8 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
|
|
|
GstClockTime timestamp;
|
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
|
|
|
|
find_timestamp (GstBuffer ** buffer, guint idx, HeaderData * data)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
|
|
|
data->timestamp = GST_BUFFER_TIMESTAMP (*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. */
|
2009-10-16 08:50:35 +00:00
|
|
|
if (data->timestamp != -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
|
|
|
}
|
|
|
|
|
2011-03-31 15:47:43 +00:00
|
|
|
static gboolean
|
2009-06-19 13:52:34 +00:00
|
|
|
set_headers (GstBuffer ** buffer, guint group, guint idx, HeaderData * data)
|
|
|
|
{
|
2011-03-27 11:55:15 +00:00
|
|
|
GstRTPBuffer rtp;
|
|
|
|
|
|
|
|
gst_rtp_buffer_map (*buffer, GST_MAP_WRITE, &rtp);
|
|
|
|
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);
|
|
|
|
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;
|
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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_prepare_push (GstBaseRTPPayload * payload,
|
2009-06-19 13:52:34 +00:00
|
|
|
gpointer obj, gboolean is_list)
|
|
|
|
{
|
2007-07-14 17:23:42 +00:00
|
|
|
GstBaseRTPPayloadPrivate *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) {
|
2009-10-16 08:50:35 +00:00
|
|
|
data.timestamp = -1;
|
|
|
|
data.offset = GST_BUFFER_OFFSET_NONE;
|
2009-06-19 13:52:34 +00:00
|
|
|
gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj),
|
|
|
|
(GstBufferListFunc) find_timestamp, &data);
|
|
|
|
} else {
|
|
|
|
data.timestamp = GST_BUFFER_TIMESTAMP (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) {
|
2009-09-02 17:47:26 +00:00
|
|
|
/* if we have an offset, use that for making an RTP timestamp */
|
2011-07-09 03:06:46 +00:00
|
|
|
data.rtptime = payload->ts_base + priv->base_rtime +
|
|
|
|
data.offset - priv->base_offset;
|
2009-09-03 12:13:12 +00:00
|
|
|
GST_LOG_OBJECT (payload,
|
|
|
|
"Using offset %" G_GUINT64_FORMAT " for RTP timestamp", data.offset);
|
2009-09-02 17:47:26 +00:00
|
|
|
} else if (GST_CLOCK_TIME_IS_VALID (data.timestamp)) {
|
2005-11-30 19:08:14 +00:00
|
|
|
gint64 rtime;
|
|
|
|
|
2009-09-02 17:47:26 +00:00
|
|
|
/* no offset, use the gstreamer timestamp */
|
2007-09-14 20:52:00 +00:00
|
|
|
rtime = gst_segment_to_running_time (&payload->segment, GST_FORMAT_TIME,
|
2009-06-19 13:52:34 +00:00
|
|
|
data.timestamp);
|
2007-09-14 20:52:00 +00:00
|
|
|
|
2010-12-20 17:29:15 +00:00
|
|
|
if (rtime == -1) {
|
|
|
|
GST_LOG_OBJECT (payload, "Clipped timestamp, using base RTP timestamp");
|
|
|
|
rtime = 0;
|
|
|
|
} else {
|
|
|
|
GST_LOG_OBJECT (payload,
|
|
|
|
"Using running_time %" GST_TIME_FORMAT " for RTP timestamp",
|
|
|
|
GST_TIME_ARGS (rtime));
|
|
|
|
rtime =
|
|
|
|
gst_util_uint64_scale_int (rtime, payload->clock_rate, GST_SECOND);
|
2011-07-09 03:06:46 +00:00
|
|
|
priv->base_offset = data.offset;
|
|
|
|
priv->base_rtime = rtime;
|
2010-12-20 17:29:15 +00:00
|
|
|
}
|
2007-09-16 19:31:06 +00:00
|
|
|
/* add running_time in clock-rate units to the base timestamp */
|
2009-06-19 13:52:34 +00:00
|
|
|
data.rtptime = payload->ts_base + rtime;
|
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 */
|
|
|
|
if (is_list) {
|
|
|
|
gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj),
|
|
|
|
(GstBufferListFunc) set_headers, &data);
|
|
|
|
} else {
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (obj);
|
|
|
|
set_headers (&buf, 0, 0, &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
|
|
|
|
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
|
|
|
|
2011-08-09 14:39:31 +00:00
|
|
|
GST_LOG_OBJECT (payload, "Preparing to push packet with size %"
|
|
|
|
G_GSIZE_FORMAT ", seq=%d, rtptime=%u, timestamp %" GST_TIME_FORMAT,
|
|
|
|
(is_list) ? -1 : gst_buffer_get_size (GST_BUFFER (obj)),
|
|
|
|
payload->seqnum, data.rtptime, GST_TIME_ARGS (data.timestamp));
|
2005-11-30 19:08:14 +00:00
|
|
|
|
2011-11-10 16:18:00 +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-10 16:18:00 +00:00
|
|
|
* gst_base_rtp_payload_push_list:
|
2009-06-19 13:52:34 +00:00
|
|
|
* @payload: a #GstBaseRTPPayload
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* Since: 0.10.24
|
|
|
|
*/
|
|
|
|
GstFlowReturn
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_push_list (GstBaseRTPPayload * payload,
|
|
|
|
GstBufferList * list)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
|
2011-11-10 16:18:00 +00:00
|
|
|
res = gst_base_rtp_payload_prepare_push (payload, list, TRUE);
|
2009-06-19 13:52:34 +00:00
|
|
|
|
|
|
|
if (G_LIKELY (res == GST_FLOW_OK))
|
|
|
|
res = gst_pad_push_list (payload->srcpad, list);
|
|
|
|
else
|
|
|
|
gst_buffer_list_unref (list);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-11-10 16:18:00 +00:00
|
|
|
* gst_base_rtp_payload_push:
|
2009-06-19 13:52:34 +00:00
|
|
|
* @payload: a #GstBaseRTPPayload
|
|
|
|
* @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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_payload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
|
2009-06-19 13:52:34 +00:00
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
|
2011-11-10 16:18:00 +00:00
|
|
|
res = gst_base_rtp_payload_prepare_push (payload, buffer, FALSE);
|
2009-06-19 13:52:34 +00:00
|
|
|
|
|
|
|
if (G_LIKELY (res == GST_FLOW_OK))
|
|
|
|
res = gst_pad_push (payload->srcpad, buffer);
|
|
|
|
else
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
|
|
|
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
|
|
|
static void
|
2011-11-10 16:18:00 +00:00
|
|
|
gst_base_rtp_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)
|
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
2007-07-14 17:23:42 +00:00
|
|
|
GstBaseRTPPayloadPrivate *priv;
|
|
|
|
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
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (object);
|
2007-07-14 17:23:42 +00:00
|
|
|
priv = basertppayload->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:
|
|
|
|
basertppayload->mtu = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case PROP_PT:
|
|
|
|
basertppayload->pt = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case PROP_SSRC:
|
2007-07-16 10:10:28 +00:00
|
|
|
val = g_value_get_uint (value);
|
2007-07-14 17:23:42 +00:00
|
|
|
basertppayload->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);
|
2007-07-14 17:23:42 +00:00
|
|
|
basertppayload->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);
|
|
|
|
basertppayload->seqnum_offset = val;
|
|
|
|
priv->seqnum_offset_random = (val == -1);
|
|
|
|
GST_DEBUG_OBJECT (basertppayload, "seqnum offset 0x%04x, random %d",
|
|
|
|
basertppayload->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:
|
2009-12-02 14:10:58 +00:00
|
|
|
basertppayload->priv->prop_max_ptime = g_value_get_int64 (value);
|
|
|
|
update_max_ptime (basertppayload);
|
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:
|
|
|
|
basertppayload->min_ptime = g_value_get_int64 (value);
|
|
|
|
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:
|
|
|
|
basertppayload->abidata.ABI.ptime_multiple = g_value_get_int64 (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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_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)
|
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
2007-07-14 17:23:42 +00:00
|
|
|
GstBaseRTPPayloadPrivate *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
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (object);
|
2007-07-14 17:23:42 +00:00
|
|
|
priv = basertppayload->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:
|
|
|
|
g_value_set_uint (value, basertppayload->mtu);
|
|
|
|
break;
|
|
|
|
case PROP_PT:
|
|
|
|
g_value_set_uint (value, basertppayload->pt);
|
|
|
|
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
|
2007-07-16 10:10:28 +00:00
|
|
|
g_value_set_uint (value, basertppayload->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
|
2007-07-16 10:10:28 +00:00
|
|
|
g_value_set_uint (value, (guint32) basertppayload->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
|
|
|
|
g_value_set_int (value, (guint16) basertppayload->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:
|
|
|
|
g_value_set_int64 (value, basertppayload->max_ptime);
|
|
|
|
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:
|
|
|
|
g_value_set_int64 (value, basertppayload->min_ptime);
|
|
|
|
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:
|
|
|
|
g_value_set_uint (value, basertppayload->timestamp);
|
|
|
|
break;
|
|
|
|
case PROP_SEQNUM:
|
|
|
|
g_value_set_uint (value, basertppayload->seqnum);
|
|
|
|
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:
|
|
|
|
g_value_set_int64 (value, basertppayload->abidata.ABI.ptime_multiple);
|
|
|
|
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-10 16:18:00 +00:00
|
|
|
gst_base_rtp_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)
|
|
|
|
{
|
|
|
|
GstBaseRTPPayload *basertppayload;
|
2007-07-14 17:23:42 +00:00
|
|
|
GstBaseRTPPayloadPrivate *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;
|
|
|
|
|
|
|
|
basertppayload = GST_BASE_RTP_PAYLOAD (element);
|
2007-07-14 17:23:42 +00:00
|
|
|
priv = basertppayload->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:
|
2005-11-30 19:08:14 +00:00
|
|
|
gst_segment_init (&basertppayload->segment, GST_FORMAT_UNDEFINED);
|
2005-09-20 13:34:02 +00:00
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->seqnum_offset_random)
|
2009-09-01 08:39:52 +00:00
|
|
|
basertppayload->seqnum_base = g_random_int_range (0, G_MAXUINT16);
|
2005-09-20 13:34:02 +00:00
|
|
|
else
|
|
|
|
basertppayload->seqnum_base = basertppayload->seqnum_offset;
|
2007-07-14 17:23:42 +00:00
|
|
|
priv->next_seqnum = basertppayload->seqnum_base;
|
2008-10-06 16:31:27 +00:00
|
|
|
basertppayload->seqnum = basertppayload->seqnum_base;
|
2005-09-20 13:34:02 +00:00
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->ssrc_random)
|
2009-09-01 08:39:52 +00:00
|
|
|
basertppayload->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
|
|
|
|
basertppayload->current_ssrc = basertppayload->ssrc;
|
2005-09-20 13:34:02 +00:00
|
|
|
|
2007-07-14 17:23:42 +00:00
|
|
|
if (priv->ts_offset_random)
|
2009-09-01 08:39:52 +00:00
|
|
|
basertppayload->ts_base = g_random_int ();
|
2005-09-20 11:50:20 +00:00
|
|
|
else
|
|
|
|
basertppayload->ts_base = basertppayload->ts_offset;
|
2008-10-06 16:31:27 +00:00
|
|
|
basertppayload->timestamp = basertppayload->ts_base;
|
2010-09-06 11:14:00 +00:00
|
|
|
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
|
2011-07-09 03:06:46 +00:00
|
|
|
priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
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:
|
|
|
|
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
|
|
|
|
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 GST_STATE_CHANGE_READY_TO_NULL:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|