2 * Copyright (C) 2006 Thomas Vander Stichele <thomas at apestaart dot org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * SECTION:element-gdppay
26 * This element payloads GStreamer buffers and events using the
27 * GStreamer Data Protocol.
31 * gst-launch -v -m videotestsrc num-buffers=50 ! gdppay ! filesink location=test.gdp
33 * This pipeline creates a serialized video stream that can be played back
34 * with the example shown in gdpdepay.
43 #include <gst/dataprotocol/dataprotocol.h>
45 #include "gstgdppay.h"
47 /* elementfactory information */
48 static const GstElementDetails gdp_pay_details =
49 GST_ELEMENT_DETAILS ("GDP Payloader",
51 "Payloads GStreamer Data Protocol buffers",
52 "Thomas Vander Stichele <thomas at apestaart dot org>");
54 static GstStaticPadTemplate gdp_pay_sink_template =
55 GST_STATIC_PAD_TEMPLATE ("sink",
60 static GstStaticPadTemplate gdp_pay_src_template =
61 GST_STATIC_PAD_TEMPLATE ("src",
64 GST_STATIC_CAPS ("application/x-gdp"));
66 GST_DEBUG_CATEGORY_STATIC (gst_gdp_pay_debug);
67 #define GST_CAT_DEFAULT gst_gdp_pay_debug
69 #define DEFAULT_CRC_HEADER TRUE
70 #define DEFAULT_CRC_PAYLOAD FALSE
71 #define DEFAULT_VERSION GST_DP_VERSION_1_0
82 GST_DEBUG_CATEGORY_INIT (gst_gdp_pay_debug, "gdppay", 0, \
85 GST_BOILERPLATE_FULL (GstGDPPay, gst_gdp_pay, GstElement,
86 GST_TYPE_ELEMENT, _do_init);
88 static void gst_gdp_pay_reset (GstGDPPay * this);
89 static GstFlowReturn gst_gdp_pay_chain (GstPad * pad, GstBuffer * buffer);
91 static gboolean gst_gdp_pay_src_event (GstPad * pad, GstEvent * event);
92 static gboolean gst_gdp_pay_sink_event (GstPad * pad, GstEvent * event);
94 static GstStateChangeReturn gst_gdp_pay_change_state (GstElement *
95 element, GstStateChange transition);
97 static void gst_gdp_pay_set_property (GObject * object, guint prop_id,
98 const GValue * value, GParamSpec * pspec);
99 static void gst_gdp_pay_get_property (GObject * object, guint prop_id,
100 GValue * value, GParamSpec * pspec);
102 static void gst_gdp_pay_finalize (GObject * gobject);
105 gst_gdp_pay_base_init (gpointer g_class)
107 GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
109 gst_element_class_set_details (element_class, &gdp_pay_details);
111 gst_element_class_add_pad_template (element_class,
112 gst_static_pad_template_get (&gdp_pay_sink_template));
113 gst_element_class_add_pad_template (element_class,
114 gst_static_pad_template_get (&gdp_pay_src_template));
118 gst_gdp_pay_class_init (GstGDPPayClass * klass)
120 GObjectClass *gobject_class;
121 GstElementClass *gstelement_class;
123 gobject_class = (GObjectClass *) klass;
124 gstelement_class = (GstElementClass *) klass;
126 gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_gdp_pay_set_property);
127 gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_gdp_pay_get_property);
128 gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gdp_pay_finalize);
130 g_object_class_install_property (gobject_class, PROP_CRC_HEADER,
131 g_param_spec_boolean ("crc-header", "CRC Header",
132 "Calculate and store a CRC checksum on the header",
133 DEFAULT_CRC_HEADER, G_PARAM_READWRITE));
134 g_object_class_install_property (gobject_class, PROP_CRC_PAYLOAD,
135 g_param_spec_boolean ("crc-payload", "CRC Payload",
136 "Calculate and store a CRC checksum on the payload",
137 DEFAULT_CRC_PAYLOAD, G_PARAM_READWRITE));
138 g_object_class_install_property (gobject_class, PROP_VERSION,
139 g_param_spec_enum ("version", "Version",
140 "Version of the GStreamer Data Protocol",
141 GST_TYPE_DP_VERSION, DEFAULT_VERSION, G_PARAM_READWRITE));
143 gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_gdp_pay_change_state);
147 gst_gdp_pay_init (GstGDPPay * gdppay, GstGDPPayClass * g_class)
150 gst_pad_new_from_static_template (&gdp_pay_sink_template, "sink");
151 gst_pad_set_chain_function (gdppay->sinkpad,
152 GST_DEBUG_FUNCPTR (gst_gdp_pay_chain));
153 gst_pad_set_event_function (gdppay->sinkpad,
154 GST_DEBUG_FUNCPTR (gst_gdp_pay_sink_event));
155 gst_element_add_pad (GST_ELEMENT (gdppay), gdppay->sinkpad);
158 gst_pad_new_from_static_template (&gdp_pay_src_template, "src");
159 gst_pad_set_event_function (gdppay->srcpad,
160 GST_DEBUG_FUNCPTR (gst_gdp_pay_src_event));
161 gst_element_add_pad (GST_ELEMENT (gdppay), gdppay->srcpad);
163 gdppay->crc_header = DEFAULT_CRC_HEADER;
164 gdppay->crc_payload = DEFAULT_CRC_PAYLOAD;
165 gdppay->header_flag = gdppay->crc_header | gdppay->crc_payload;
166 gdppay->version = DEFAULT_VERSION;
169 gdppay->packetizer = gst_dp_packetizer_new (gdppay->version);
173 gst_gdp_pay_finalize (GObject * gobject)
175 GstGDPPay *this = GST_GDP_PAY (gobject);
177 gst_gdp_pay_reset (this);
178 gst_dp_packetizer_free (this->packetizer);
180 GST_CALL_PARENT (G_OBJECT_CLASS, finalize, (gobject));
184 gst_gdp_pay_reset (GstGDPPay * this)
186 GST_DEBUG_OBJECT (this, "Resetting GDP object");
187 /* clear the queued buffers */
188 while (this->queue) {
191 buffer = GST_BUFFER_CAST (this->queue->data);
192 GST_DEBUG_OBJECT (this, "Pushing queued GDP buffer %p", buffer);
194 /* delete buffer from queue now */
195 this->queue = g_list_delete_link (this->queue, this->queue);
198 gst_caps_unref (this->caps);
201 if (this->caps_buf) {
202 gst_buffer_unref (this->caps_buf);
203 this->caps_buf = NULL;
206 gst_buffer_unref (this->tag_buf);
207 this->tag_buf = NULL;
209 if (this->new_segment_buf) {
210 gst_buffer_unref (this->new_segment_buf);
211 this->new_segment_buf = NULL;
213 this->sent_streamheader = FALSE;
217 /* set OFFSET and OFFSET_END with running count */
219 gst_gdp_stamp_buffer (GstGDPPay * this, GstBuffer * buffer)
221 GST_BUFFER_OFFSET (buffer) = this->offset;
222 GST_BUFFER_OFFSET_END (buffer) = this->offset + GST_BUFFER_SIZE (buffer);
223 this->offset = GST_BUFFER_OFFSET_END (buffer);
227 gst_gdp_buffer_from_caps (GstGDPPay * this, GstCaps * caps)
229 GstBuffer *headerbuf;
230 GstBuffer *payloadbuf;
231 guint8 *header, *payload;
234 if (!this->packetizer->packet_from_caps (caps, this->header_flag, &len,
238 GST_LOG_OBJECT (this, "creating GDP header and payload buffer from caps");
239 headerbuf = gst_buffer_new ();
240 gst_buffer_set_data (headerbuf, header, len);
241 GST_BUFFER_MALLOCDATA (headerbuf) = header;
243 payloadbuf = gst_buffer_new ();
244 gst_buffer_set_data (payloadbuf, payload,
245 gst_dp_header_payload_length (header));
246 GST_BUFFER_MALLOCDATA (payloadbuf) = payload;
248 return gst_buffer_join (headerbuf, payloadbuf);
253 GST_WARNING_OBJECT (this, "could not create GDP header from caps");
259 gst_gdp_pay_buffer_from_buffer (GstGDPPay * this, GstBuffer * buffer)
261 GstBuffer *headerbuf;
265 if (!this->packetizer->header_from_buffer (buffer, this->header_flag, &len,
269 GST_LOG_OBJECT (this, "creating GDP header and payload buffer from buffer");
270 headerbuf = gst_buffer_new ();
271 gst_buffer_set_data (headerbuf, header, len);
272 GST_BUFFER_MALLOCDATA (headerbuf) = header;
274 /* we do not want to lose the ref on the incoming buffer */
275 gst_buffer_ref (buffer);
277 return gst_buffer_join (headerbuf, buffer);
282 GST_WARNING_OBJECT (this, "could not create GDP header from buffer");
288 gst_gdp_buffer_from_event (GstGDPPay * this, GstEvent * event)
290 GstBuffer *headerbuf;
291 GstBuffer *payloadbuf;
292 guint8 *header, *payload;
297 this->packetizer->packet_from_event (event, this->header_flag, &len,
302 GST_LOG_OBJECT (this, "creating GDP header and payload buffer from event");
303 headerbuf = gst_buffer_new ();
304 gst_buffer_set_data (headerbuf, header, len);
305 GST_BUFFER_MALLOCDATA (headerbuf) = header;
307 payloadbuf = gst_buffer_new ();
308 gst_buffer_set_data (payloadbuf, payload,
309 gst_dp_header_payload_length (header));
310 GST_BUFFER_MALLOCDATA (payloadbuf) = payload;
312 return gst_buffer_join (headerbuf, payloadbuf);
317 GST_WARNING_OBJECT (this, "could not create GDP header from event %s (%d)",
318 gst_event_type_get_name (event->type), event->type);
324 /* set our caps with streamheader, based on the latest newsegment and caps,
325 * and (possibly) GDP-serialized buffers of the streamheaders on the src pad */
327 gst_gdp_pay_reset_streamheader (GstGDPPay * this)
331 /* We use copies of these to avoid circular refcounts */
332 GstBuffer *new_segment_buf, *caps_buf, *tag_buf;
333 GstStructure *structure;
334 GstFlowReturn r = GST_FLOW_OK;
335 gboolean version_one_zero = TRUE;
337 GValue array = { 0 };
338 GValue value = { 0 };
340 /* In version 0.2, we didn't need or send new segment or tags */
341 if (this->version == GST_DP_VERSION_0_2)
342 version_one_zero = FALSE;
344 if (version_one_zero) {
345 if (!this->new_segment_buf || !this->caps_buf)
352 /* put copies of the buffers in a fixed list */
353 g_value_init (&array, GST_TYPE_ARRAY);
355 if (version_one_zero) {
356 new_segment_buf = gst_buffer_copy (this->new_segment_buf);
357 g_value_init (&value, GST_TYPE_BUFFER);
358 gst_value_set_buffer (&value, new_segment_buf);
359 gst_value_array_append_value (&array, &value);
360 g_value_unset (&value);
361 gst_buffer_unref (new_segment_buf);
364 tag_buf = gst_buffer_copy (this->tag_buf);
365 g_value_init (&value, GST_TYPE_BUFFER);
366 gst_value_set_buffer (&value, tag_buf);
367 gst_value_array_append_value (&array, &value);
368 g_value_unset (&value);
369 gst_buffer_unref (tag_buf);
373 caps_buf = gst_buffer_copy (this->caps_buf);
374 g_value_init (&value, GST_TYPE_BUFFER);
375 gst_value_set_buffer (&value, caps_buf);
376 gst_value_array_append_value (&array, &value);
377 g_value_unset (&value);
378 gst_buffer_unref (caps_buf);
380 /* we also need to add GDP serializations of the streamheaders of the
382 structure = gst_caps_get_structure (this->caps, 0);
383 if (gst_structure_has_field (structure, "streamheader")) {
389 sh = gst_structure_get_value (structure, "streamheader");
390 buffers = g_value_peek_pointer (sh);
391 GST_DEBUG_OBJECT (this,
392 "Need to serialize %d incoming streamheader buffers on ours",
394 for (i = 0; i < buffers->len; ++i) {
396 GstBuffer *outbuffer;
398 bufval = &g_array_index (buffers, GValue, i);
399 buffer = g_value_peek_pointer (bufval);
400 outbuffer = gst_gdp_pay_buffer_from_buffer (this, buffer);
402 g_value_unset (&array);
406 g_value_init (&value, GST_TYPE_BUFFER);
407 gst_value_set_buffer (&value, outbuffer);
408 gst_value_array_append_value (&array, &value);
409 g_value_unset (&value);
411 gst_buffer_unref (outbuffer);
415 caps = gst_caps_from_string ("application/x-gdp");
416 structure = gst_caps_get_structure (caps, 0);
418 gst_structure_set_value (structure, "streamheader", &array);
419 g_value_unset (&array);
421 GST_DEBUG_OBJECT (this, "Setting caps on src pad %" GST_PTR_FORMAT, caps);
422 gst_pad_set_caps (this->srcpad, caps);
423 gst_buffer_set_caps (this->caps_buf, caps);
424 gst_buffer_set_caps (this->new_segment_buf, caps);
426 /* if these are our first ever buffers, send out new_segment first */
427 if (!this->sent_streamheader) {
429 gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 0, -1, 0);
430 GST_DEBUG_OBJECT (this, "Sending out new_segment event %p", event);
431 if (!gst_pad_push_event (this->srcpad, event)) {
432 GST_WARNING_OBJECT (this, "pushing new segment failed");
438 /* push out these streamheader buffers, then flush our internal queue */
439 GST_DEBUG_OBJECT (this, "Pushing GDP new_segment buffer %p",
440 this->new_segment_buf);
441 /* we stored these bufs with refcount 1, so make sure we keep a ref */
442 r = gst_pad_push (this->srcpad, gst_buffer_ref (this->new_segment_buf));
443 if (r != GST_FLOW_OK) {
444 GST_WARNING_OBJECT (this, "pushing GDP newsegment buffer returned %d", r);
448 GST_DEBUG_OBJECT (this, "Pushing GDP tag buffer %p", this->tag_buf);
449 /* we stored these bufs with refcount 1, so make sure we keep a ref */
450 r = gst_pad_push (this->srcpad, gst_buffer_ref (this->tag_buf));
451 if (r != GST_FLOW_OK) {
452 GST_WARNING_OBJECT (this, "pushing GDP tag buffer returned %d", r);
456 GST_DEBUG_OBJECT (this, "Pushing GDP caps buffer %p", this->caps_buf);
457 r = gst_pad_push (this->srcpad, gst_buffer_ref (this->caps_buf));
458 if (r != GST_FLOW_OK) {
459 GST_WARNING_OBJECT (this, "pushing GDP caps buffer returned %d", r);
462 this->sent_streamheader = TRUE;
463 GST_DEBUG_OBJECT (this, "need to push %d queued buffers",
464 g_list_length (this->queue));
465 while (this->queue) {
468 buffer = GST_BUFFER_CAST (this->queue->data);
469 GST_DEBUG_OBJECT (this, "Pushing queued GDP buffer %p", buffer);
471 /* delete buffer from queue now */
472 this->queue = g_list_delete_link (this->queue, this->queue);
474 /* set caps and push */
475 gst_buffer_set_caps (buffer, caps);
476 r = gst_pad_push (this->srcpad, buffer);
477 if (r != GST_FLOW_OK) {
478 GST_WARNING_OBJECT (this, "pushing queued GDP buffer returned %d", r);
484 gst_caps_unref (caps);
490 GST_ELEMENT_ERROR (this, STREAM, FORMAT, (NULL),
491 ("failed to create GDP buffer from streamheader"));
492 return GST_FLOW_ERROR;
496 /* queue a buffer internally if we haven't sent streamheader buffers yet;
497 * otherwise, just push on, this takes ownership of the buffer. */
499 gst_gdp_queue_buffer (GstGDPPay * this, GstBuffer * buffer)
501 if (this->sent_streamheader) {
502 GST_LOG_OBJECT (this, "Pushing GDP buffer %p, caps %" GST_PTR_FORMAT,
504 return gst_pad_push (this->srcpad, buffer);
507 /* store it on an internal queue. buffer remains reffed. */
508 this->queue = g_list_append (this->queue, buffer);
509 GST_DEBUG_OBJECT (this, "queued buffer %p, now %d buffers queued",
510 buffer, g_list_length (this->queue));
516 gst_gdp_pay_chain (GstPad * pad, GstBuffer * buffer)
520 GstBuffer *outbuffer;
523 this = GST_GDP_PAY (gst_pad_get_parent (pad));
525 /* we should have received a new_segment before, otherwise it's a bug.
526 * fake one in that case */
527 if (!this->new_segment_buf) {
530 GST_WARNING_OBJECT (this,
531 "did not receive new-segment before first buffer");
532 event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 0, -1, 0);
533 outbuffer = gst_gdp_buffer_from_event (this, event);
534 gst_event_unref (event);
536 /* GDP 0.2 doesn't know about new-segment, so this is not fatal */
538 GST_ELEMENT_WARNING (this, STREAM, ENCODE, (NULL),
539 ("Could not create GDP buffer from new segment event"));
541 gst_gdp_stamp_buffer (this, outbuffer);
542 GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer);
543 GST_BUFFER_DURATION (outbuffer) = 0;
544 GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf",
546 this->new_segment_buf = outbuffer;
550 /* make sure we've received caps before */
551 caps = gst_buffer_get_caps (buffer);
552 if (!this->caps && !caps)
555 /* if the caps have changed, process caps first */
556 if (caps && !gst_caps_is_equal (this->caps, caps)) {
557 GST_LOG_OBJECT (this, "caps changed to %p, %" GST_PTR_FORMAT, caps, caps);
558 gst_caps_replace (&(this->caps), caps);
559 outbuffer = gst_gdp_buffer_from_caps (this, caps);
563 gst_gdp_stamp_buffer (this, outbuffer);
564 GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer);
565 GST_BUFFER_DURATION (outbuffer) = 0;
566 GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS);
567 this->caps_buf = outbuffer;
568 gst_gdp_pay_reset_streamheader (this);
572 gst_caps_unref (caps);
574 /* create a GDP header packet,
575 * then create a GST buffer of the header packet and the buffer contents */
576 outbuffer = gst_gdp_pay_buffer_from_buffer (this, buffer);
580 gst_gdp_stamp_buffer (this, outbuffer);
581 GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer);
582 GST_BUFFER_DURATION (outbuffer) = GST_BUFFER_DURATION (buffer);
584 ret = gst_gdp_queue_buffer (this, outbuffer);
587 gst_buffer_unref (buffer);
588 gst_object_unref (this);
594 /* when returning a fatal error as a GstFlowReturn we must post an error
596 GST_ELEMENT_ERROR (this, STREAM, FORMAT, (NULL),
597 ("first received buffer does not have caps set"));
599 gst_caps_unref (caps);
600 ret = GST_FLOW_NOT_NEGOTIATED;
605 GST_ELEMENT_ERROR (this, STREAM, ENCODE, (NULL),
606 ("Could not create GDP buffer from caps %" GST_PTR_FORMAT, caps));
607 gst_caps_unref (caps);
608 ret = GST_FLOW_ERROR;
613 GST_ELEMENT_ERROR (this, STREAM, ENCODE, (NULL),
614 ("Could not create GDP buffer from buffer"));
615 ret = GST_FLOW_ERROR;
621 gst_gdp_pay_sink_event (GstPad * pad, GstEvent * event)
623 GstBuffer *outbuffer;
624 GstGDPPay *this = GST_GDP_PAY (gst_pad_get_parent (pad));
625 GstFlowReturn flowret;
628 GST_DEBUG_OBJECT (this, "received event %p of type %s (%d)",
629 event, gst_event_type_get_name (event->type), event->type);
631 /* now turn the event into a buffer */
632 outbuffer = gst_gdp_buffer_from_event (this, event);
636 gst_gdp_stamp_buffer (this, outbuffer);
637 GST_BUFFER_TIMESTAMP (outbuffer) = GST_EVENT_TIMESTAMP (event);
638 GST_BUFFER_DURATION (outbuffer) = 0;
640 /* if we got a new segment, we should put it on our streamheader,
641 * and not send it on */
642 switch (GST_EVENT_TYPE (event)) {
643 case GST_EVENT_NEWSEGMENT:
644 GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf",
647 if (this->new_segment_buf)
648 gst_buffer_unref (this->new_segment_buf);
649 this->new_segment_buf = outbuffer;
651 gst_gdp_pay_reset_streamheader (this);
654 GST_DEBUG_OBJECT (this, "Storing buffer %p as tag_buf", outbuffer);
657 gst_buffer_unref (this->tag_buf);
658 this->tag_buf = outbuffer;
660 gst_gdp_pay_reset_streamheader (this);
663 GST_DEBUG_OBJECT (this, "queuing GDP buffer %p of event %p", outbuffer,
665 flowret = gst_gdp_queue_buffer (this, outbuffer);
666 if (flowret != GST_FLOW_OK)
671 /* if we have EOS, we should send on EOS ourselves */
672 if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
673 GST_DEBUG_OBJECT (this, "Sending on EOS event %p", event);
674 /* ref, we unref later again */
675 ret = gst_pad_push_event (this->srcpad, gst_event_ref (event));
679 gst_event_unref (event);
680 gst_object_unref (this);
687 GST_ELEMENT_WARNING (this, STREAM, ENCODE, (NULL),
688 ("Could not create GDP buffer from received event (type %s)",
689 gst_event_type_get_name (event->type)));
695 GST_WARNING_OBJECT (this, "queueing GDP event buffer returned %d", flowret);
702 gst_gdp_pay_src_event (GstPad * pad, GstEvent * event)
707 this = GST_GDP_PAY (gst_pad_get_parent (pad));
709 switch (GST_EVENT_TYPE (event)) {
711 /* we refuse seek for now. */
712 gst_event_unref (event);
716 case GST_EVENT_NAVIGATION:
718 /* everything else is passed */
719 res = gst_pad_push_event (this->sinkpad, event);
722 gst_object_unref (this);
728 gst_gdp_pay_set_property (GObject * object, guint prop_id,
729 const GValue * value, GParamSpec * pspec)
733 g_return_if_fail (GST_IS_GDP_PAY (object));
734 this = GST_GDP_PAY (object);
737 case PROP_CRC_HEADER:
739 g_value_get_boolean (value) ? GST_DP_HEADER_FLAG_CRC_HEADER : 0;
740 this->header_flag = this->crc_header | this->crc_payload;
742 case PROP_CRC_PAYLOAD:
744 g_value_get_boolean (value) ? GST_DP_HEADER_FLAG_CRC_PAYLOAD : 0;
745 this->header_flag = this->crc_header | this->crc_payload;
748 this->version = g_value_get_enum (value);
751 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
757 gst_gdp_pay_get_property (GObject * object, guint prop_id,
758 GValue * value, GParamSpec * pspec)
762 g_return_if_fail (GST_IS_GDP_PAY (object));
763 this = GST_GDP_PAY (object);
766 case PROP_CRC_HEADER:
767 g_value_set_boolean (value, this->crc_header);
769 case PROP_CRC_PAYLOAD:
770 g_value_set_boolean (value, this->crc_payload);
773 g_value_set_enum (value, this->version);
776 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
781 static GstStateChangeReturn
782 gst_gdp_pay_change_state (GstElement * element, GstStateChange transition)
784 GstStateChangeReturn ret;
785 GstGDPPay *this = GST_GDP_PAY (element);
787 switch (transition) {
788 case GST_STATE_CHANGE_READY_TO_PAUSED:
794 ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
796 switch (transition) {
797 case GST_STATE_CHANGE_PAUSED_TO_READY:
798 gst_gdp_pay_reset (this);
808 gst_gdp_pay_plugin_init (GstPlugin * plugin)
810 if (!gst_element_register (plugin, "gdppay", GST_RANK_NONE, GST_TYPE_GDP_PAY))