2 * Copyright (c) 2005 Edward Hervey <bilboed@bilboed.com>
3 * Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * SECTION:element-imagefreeze
24 * The imagefreeze element generates a still frame video stream from
25 * the input. It duplicates the first frame with the framerate requested
26 * by downstream, allows seeking and answers queries.
29 * <title>Example launch line</title>
31 * gst-launch -v filesrc location=some.png ! decodebin2 ! imagefreeze ! autovideosink
32 * ]| This pipeline shows a still frame stream of a PNG file.
36 /* This is based on the imagefreeze element from PiTiVi:
37 * http://git.gnome.org/browse/pitivi/tree/pitivi/elements/imagefreeze.py
44 #include "gstimagefreeze.h"
46 static void gst_image_freeze_finalize (GObject * object);
48 static void gst_image_freeze_reset (GstImageFreeze * self);
50 static GstStateChangeReturn gst_image_freeze_change_state (GstElement * element,
51 GstStateChange transition);
53 static GstFlowReturn gst_image_freeze_sink_chain (GstPad * pad,
55 static gboolean gst_image_freeze_sink_event (GstPad * pad, GstEvent * event);
56 static gboolean gst_image_freeze_sink_setcaps (GstPad * pad, GstCaps * caps);
57 static GstCaps *gst_image_freeze_sink_getcaps (GstPad * pad);
58 static gboolean gst_image_freeze_sink_query (GstPad * pad, GstQuery * query);
59 static void gst_image_freeze_src_loop (GstPad * pad);
60 static gboolean gst_image_freeze_src_event (GstPad * pad, GstEvent * event);
61 static gboolean gst_image_freeze_src_query (GstPad * pad, GstQuery * query);
62 static const GstQueryType *gst_image_freeze_src_query_type (GstPad * pad);
64 static GstStaticPadTemplate sink_pad_template = GST_STATIC_PAD_TEMPLATE ("sink",
67 GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb; video/x-raw-gray"));
69 static GstStaticPadTemplate src_pad_template =
70 GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
71 GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb; video/x-raw-gray"));
73 GST_DEBUG_CATEGORY_STATIC (gst_image_freeze_debug);
74 #define GST_CAT_DEFAULT gst_image_freeze_debug
76 GST_BOILERPLATE (GstImageFreeze, gst_image_freeze, GstElement,
80 gst_image_freeze_base_init (gpointer g_class)
82 GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
84 gst_element_class_set_details_simple (gstelement_class,
85 "Still frame stream generator",
87 "Generates a still frame stream from an image",
88 "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
90 gst_element_class_add_pad_template (gstelement_class,
91 gst_static_pad_template_get (&sink_pad_template));
92 gst_element_class_add_pad_template (gstelement_class,
93 gst_static_pad_template_get (&src_pad_template));
97 gst_image_freeze_class_init (GstImageFreezeClass * klass)
99 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
100 GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
102 gobject_class->finalize = gst_image_freeze_finalize;
104 gstelement_class->change_state =
105 GST_DEBUG_FUNCPTR (gst_image_freeze_change_state);
109 gst_image_freeze_init (GstImageFreeze * self, GstImageFreezeClass * g_class)
111 self->sinkpad = gst_pad_new_from_static_template (&sink_pad_template, "sink");
112 gst_pad_set_chain_function (self->sinkpad,
113 GST_DEBUG_FUNCPTR (gst_image_freeze_sink_chain));
114 gst_pad_set_event_function (self->sinkpad,
115 GST_DEBUG_FUNCPTR (gst_image_freeze_sink_event));
116 gst_pad_set_query_function (self->sinkpad,
117 GST_DEBUG_FUNCPTR (gst_image_freeze_sink_query));
118 gst_pad_set_setcaps_function (self->sinkpad,
119 GST_DEBUG_FUNCPTR (gst_image_freeze_sink_setcaps));
120 gst_pad_set_getcaps_function (self->sinkpad,
121 GST_DEBUG_FUNCPTR (gst_image_freeze_sink_getcaps));
122 gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);
124 self->srcpad = gst_pad_new_from_static_template (&src_pad_template, "src");
125 gst_pad_set_event_function (self->srcpad,
126 GST_DEBUG_FUNCPTR (gst_image_freeze_src_event));
127 gst_pad_set_query_function (self->srcpad,
128 GST_DEBUG_FUNCPTR (gst_image_freeze_src_query));
129 gst_pad_set_query_type_function (self->srcpad,
130 GST_DEBUG_FUNCPTR (gst_image_freeze_src_query_type));
131 gst_pad_use_fixed_caps (self->sinkpad);
132 gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
134 gst_image_freeze_reset (self);
138 gst_image_freeze_finalize (GObject * object)
140 GstImageFreeze *self = GST_IMAGE_FREEZE (object);
142 gst_image_freeze_reset (self);
144 G_OBJECT_CLASS (parent_class)->finalize (object);
148 gst_image_freeze_reset (GstImageFreeze * self)
150 GST_DEBUG_OBJECT (self, "Resetting internal state");
152 GST_OBJECT_LOCK (self);
153 gst_buffer_replace (&self->buffer, NULL);
155 gst_segment_init (&self->segment, GST_FORMAT_TIME);
156 self->need_segment = TRUE;
157 gst_event_replace (&self->close_segment, NULL);
159 self->fps_n = self->fps_d = 0;
161 GST_OBJECT_UNLOCK (self);
165 gst_image_freeze_sink_setcaps (GstPad * pad, GstCaps * caps)
167 GstImageFreeze *self = GST_IMAGE_FREEZE (gst_pad_get_parent (pad));
168 gboolean ret = FALSE;
171 GstCaps *othercaps, *intersection;
174 caps = gst_caps_make_writable (gst_caps_ref (caps));
176 GST_DEBUG_OBJECT (pad, "Setting caps: %" GST_PTR_FORMAT, caps);
178 s = gst_caps_get_structure (caps, 0);
180 /* 1. Remove framerate */
181 gst_structure_remove_field (s, "framerate");
182 gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1,
185 /* 2. Intersect with template caps */
186 othercaps = (GstCaps *) gst_pad_get_pad_template_caps (pad);
187 intersection = gst_caps_intersect (caps, othercaps);
188 GST_DEBUG_OBJECT (pad, "Intersecting: %" GST_PTR_FORMAT, caps);
189 GST_DEBUG_OBJECT (pad, "with: %" GST_PTR_FORMAT, othercaps);
190 GST_DEBUG_OBJECT (pad, "gave: %" GST_PTR_FORMAT, intersection);
191 gst_caps_unref (caps);
193 intersection = othercaps = NULL;
195 /* 3. Intersect with downstream peer caps */
196 othercaps = gst_pad_peer_get_caps (self->srcpad);
198 intersection = gst_caps_intersect (caps, othercaps);
199 GST_DEBUG_OBJECT (pad, "Intersecting: %" GST_PTR_FORMAT, caps);
200 GST_DEBUG_OBJECT (pad, "with: %" GST_PTR_FORMAT, othercaps);
201 GST_DEBUG_OBJECT (pad, "gave: %" GST_PTR_FORMAT, intersection);
202 gst_caps_unref (othercaps);
203 gst_caps_unref (caps);
205 intersection = othercaps = NULL;
208 /* 4. For every candidate check if it's accepted downstream
209 * and fixate framerate to nearest 25/1 */
210 n = gst_caps_get_size (caps);
211 for (i = 0; i < n; i++) {
212 GstCaps *candidate = gst_caps_new_empty ();
213 GstStructure *s = gst_structure_copy (gst_caps_get_structure (caps, i));
215 gst_caps_append_structure (candidate, s);
216 if (gst_pad_peer_accept_caps (self->srcpad, candidate)) {
217 if (gst_structure_has_field_typed (s, "framerate", GST_TYPE_FRACTION) ||
218 gst_structure_fixate_field_nearest_fraction (s, "framerate", 25, 1)) {
219 gst_structure_get_fraction (s, "framerate", &fps_n, &fps_d);
221 GST_OBJECT_LOCK (self);
224 GST_OBJECT_UNLOCK (self);
225 GST_DEBUG_OBJECT (pad, "Setting caps %" GST_PTR_FORMAT, candidate);
226 gst_pad_set_caps (self->srcpad, candidate);
227 gst_caps_unref (candidate);
231 GST_WARNING_OBJECT (pad, "Invalid caps with framerate %d/%d", fps_n,
236 gst_caps_unref (candidate);
241 GST_ERROR_OBJECT (pad, "No usable caps found");
243 gst_caps_unref (caps);
244 gst_object_unref (self);
250 gst_image_freeze_sink_getcaps (GstPad * pad)
252 GstImageFreeze *self = GST_IMAGE_FREEZE (gst_pad_get_parent (pad));
255 if (GST_PAD_CAPS (pad)) {
256 ret = gst_caps_copy (GST_PAD_CAPS (pad));
260 tmp = gst_pad_peer_get_caps (self->srcpad);
262 ret = gst_caps_intersect (tmp, gst_pad_get_pad_template_caps (pad));
263 gst_caps_unref (tmp);
265 ret = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
269 gst_object_unref (self);
271 GST_LOG_OBJECT (pad, "Returning caps: %" GST_PTR_FORMAT, ret);
277 gst_image_freeze_sink_query (GstPad * pad, GstQuery * query)
279 GstImageFreeze *self = GST_IMAGE_FREEZE (gst_pad_get_parent (pad));
281 GstPad *peer = gst_pad_get_peer (self->srcpad);
283 GST_LOG_OBJECT (pad, "Handling query of type '%s'",
284 gst_query_type_get_name (GST_QUERY_TYPE (query)));
287 GST_INFO_OBJECT (pad, "No peer yet, dropping query");
290 ret = gst_pad_query (peer, query);
291 gst_object_unref (peer);
294 gst_object_unref (self);
299 gst_image_freeze_convert (GstImageFreeze * self,
300 GstFormat src_format, gint64 src_value,
301 GstFormat * dest_format, gint64 * dest_value)
303 gboolean ret = FALSE;
305 if (src_format == *dest_format) {
306 *dest_value = src_value;
310 if (src_value == -1) {
315 switch (src_format) {
316 case GST_FORMAT_DEFAULT:{
317 switch (*dest_format) {
318 case GST_FORMAT_TIME:
319 GST_OBJECT_LOCK (self);
320 if (self->fps_n == 0)
324 gst_util_uint64_scale (src_value, GST_SECOND * self->fps_d,
326 GST_OBJECT_UNLOCK (self);
333 case GST_FORMAT_TIME:{
334 switch (*dest_format) {
335 case GST_FORMAT_DEFAULT:
336 GST_OBJECT_LOCK (self);
338 gst_util_uint64_scale (src_value, self->fps_n,
339 self->fps_d * GST_SECOND);
340 GST_OBJECT_UNLOCK (self);
355 static const GstQueryType *
356 gst_image_freeze_src_query_type (GstPad * pad)
358 static const GstQueryType types[] = {
370 gst_image_freeze_src_query (GstPad * pad, GstQuery * query)
372 GstImageFreeze *self = GST_IMAGE_FREEZE (gst_pad_get_parent (pad));
373 gboolean ret = FALSE;
375 GST_LOG_OBJECT (pad, "Handling query of type '%s'",
376 gst_query_type_get_name (GST_QUERY_TYPE (query)));
378 switch (GST_QUERY_TYPE (query)) {
379 case GST_QUERY_CONVERT:{
380 GstFormat src_format, dest_format;
381 gint64 src_value, dest_value;
383 gst_query_parse_convert (query, &src_format, &src_value, &dest_format,
386 gst_image_freeze_convert (self, src_format, src_value, &dest_format,
389 gst_query_set_convert (query, src_format, src_value, dest_format,
393 case GST_QUERY_POSITION:{
397 gst_query_parse_position (query, &format, NULL);
399 case GST_FORMAT_DEFAULT:{
400 GST_OBJECT_LOCK (self);
401 position = self->offset;
402 GST_OBJECT_UNLOCK (self);
405 case GST_FORMAT_TIME:{
406 GST_OBJECT_LOCK (self);
407 position = self->segment.last_stop;
408 GST_OBJECT_UNLOCK (self);
416 gst_query_set_position (query, format, position);
417 GST_DEBUG_OBJECT (pad,
418 "Returning position %" G_GINT64_FORMAT " in format %s", position,
419 gst_format_get_name (format));
421 GST_DEBUG_OBJECT (pad, "Position query failed");
425 case GST_QUERY_DURATION:{
429 gst_query_parse_duration (query, &format, NULL);
431 case GST_FORMAT_TIME:{
432 GST_OBJECT_LOCK (self);
433 duration = self->segment.stop;
434 GST_OBJECT_UNLOCK (self);
437 case GST_FORMAT_DEFAULT:{
438 GST_OBJECT_LOCK (self);
439 duration = self->segment.stop;
442 gst_util_uint64_scale (duration, self->fps_n,
443 GST_SECOND * self->fps_d);
444 GST_OBJECT_UNLOCK (self);
452 gst_query_set_duration (query, format, duration);
453 GST_DEBUG_OBJECT (pad,
454 "Returning duration %" G_GINT64_FORMAT " in format %s", duration,
455 gst_format_get_name (format));
457 GST_DEBUG_OBJECT (pad, "Duration query failed");
461 case GST_QUERY_SEEKING:{
465 gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
466 seekable = (format == GST_FORMAT_TIME || format == GST_FORMAT_DEFAULT);
468 gst_query_set_seeking (query, format, seekable, (seekable ? 0 : -1), -1);
477 gst_object_unref (self);
483 gst_image_freeze_sink_event (GstPad * pad, GstEvent * event)
485 GstImageFreeze *self = GST_IMAGE_FREEZE (gst_pad_get_parent (pad));
488 GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event));
490 switch (GST_EVENT_TYPE (event)) {
492 case GST_EVENT_NEWSEGMENT:
493 GST_DEBUG_OBJECT (pad, "Dropping event");
494 gst_event_unref (event);
497 case GST_EVENT_FLUSH_START:
498 gst_image_freeze_reset (self);
501 ret = gst_pad_push_event (self->srcpad, event);
505 gst_object_unref (self);
510 gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
512 GstImageFreeze *self = GST_IMAGE_FREEZE (gst_pad_get_parent (pad));
515 GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event));
517 switch (GST_EVENT_TYPE (event)) {
518 case GST_EVENT_NAVIGATION:
520 case GST_EVENT_LATENCY:
522 GST_DEBUG_OBJECT (pad, "Dropping event");
523 gst_event_unref (event);
526 case GST_EVENT_SEEK:{
530 GstSeekType start_type, stop_type;
534 gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
536 gst_event_unref (event);
538 if (format != GST_FORMAT_TIME && format != GST_FORMAT_DEFAULT) {
539 GST_ERROR_OBJECT (pad, "Seek in invalid format: %s",
540 gst_format_get_name (format));
545 if (format == GST_FORMAT_DEFAULT) {
546 format = GST_FORMAT_TIME;
547 if (!gst_image_freeze_convert (self, GST_FORMAT_DEFAULT, start, &format,
549 || !gst_image_freeze_convert (self, GST_FORMAT_DEFAULT, stop,
551 || start == -1 || stop == -1) {
552 GST_ERROR_OBJECT (pad,
553 "Failed to convert seek from DEFAULT format into TIME format");
559 if ((flags & GST_SEEK_FLAG_FLUSH)) {
562 e = gst_event_new_flush_start ();
563 gst_pad_push_event (self->srcpad, e);
565 gst_pad_pause_task (self->srcpad);
568 GST_PAD_STREAM_LOCK (self->srcpad);
570 GST_OBJECT_LOCK (self);
571 gst_event_replace (&self->close_segment, NULL);
572 if (self->segment.rate >= 0) {
573 self->close_segment =
574 gst_event_new_new_segment_full (TRUE, self->segment.rate,
575 self->segment.applied_rate, self->segment.format,
576 self->segment.start, self->segment.last_stop, self->segment.time);
580 if ((stop = self->segment.stop) == -1)
581 stop = self->segment.duration;
583 self->close_segment =
584 gst_event_new_new_segment_full (TRUE, self->segment.rate,
585 self->segment.applied_rate, self->segment.format,
586 self->segment.last_stop, stop, self->segment.last_stop);
589 gst_segment_set_seek (&self->segment, rate, format, flags, start_type,
590 start, stop_type, stop, NULL);
591 self->need_segment = TRUE;
592 last_stop = self->segment.last_stop;
594 GST_OBJECT_UNLOCK (self);
596 if ((flags & GST_SEEK_FLAG_FLUSH)) {
599 e = gst_event_new_flush_stop ();
600 gst_pad_push_event (self->srcpad, e);
603 if (flags & GST_SEEK_FLAG_SEGMENT) {
606 m = gst_message_new_segment_start (GST_OBJECT (self),
608 gst_element_post_message (GST_ELEMENT (self), m);
611 GST_PAD_STREAM_UNLOCK (self->srcpad);
613 GST_DEBUG_OBJECT (pad, "Seek successful");
615 gst_pad_start_task (self->srcpad,
616 (GstTaskFunction) gst_image_freeze_src_loop, self->srcpad);
620 case GST_EVENT_FLUSH_START:
621 gst_image_freeze_reset (self);
624 ret = gst_pad_push_event (self->sinkpad, event);
628 gst_object_unref (self);
633 gst_image_freeze_sink_chain (GstPad * pad, GstBuffer * buffer)
635 GstImageFreeze *self = GST_IMAGE_FREEZE (GST_PAD_PARENT (pad));
636 GstFlowReturn ret = GST_FLOW_OK;
638 GST_OBJECT_LOCK (self);
640 GST_DEBUG_OBJECT (pad, "Already have a buffer, dropping");
641 gst_buffer_unref (buffer);
642 GST_OBJECT_UNLOCK (self);
646 self->buffer = buffer;
647 GST_OBJECT_UNLOCK (self);
649 gst_pad_start_task (self->srcpad, (GstTaskFunction) gst_image_freeze_src_loop,
655 gst_image_freeze_src_loop (GstPad * pad)
657 GstImageFreeze *self = GST_IMAGE_FREEZE (GST_PAD_PARENT (pad));
660 GstClockTime timestamp, duration;
661 gint64 cstart, cstop;
662 gboolean in_seg, eos;
664 GST_OBJECT_LOCK (self);
666 GST_ERROR_OBJECT (pad, "Have no buffer yet");
667 GST_OBJECT_UNLOCK (self);
668 gst_pad_pause_task (self->srcpad);
671 buffer = gst_buffer_ref (self->buffer);
672 buffer = gst_buffer_make_metadata_writable (buffer);
673 GST_OBJECT_UNLOCK (self);
675 if (self->close_segment) {
676 GST_DEBUG_OBJECT (pad, "Closing previous segment");
677 gst_pad_push_event (self->srcpad, self->close_segment);
678 self->close_segment = NULL;
681 if (self->need_segment) {
684 GST_DEBUG_OBJECT (pad, "Pushing NEWSEGMENT event: %" GST_SEGMENT_FORMAT,
686 e = gst_event_new_new_segment_full (FALSE, self->segment.rate,
687 self->segment.applied_rate, self->segment.format, self->segment.start,
688 self->segment.stop, self->segment.start);
690 GST_OBJECT_LOCK (self);
691 if (self->segment.rate >= 0) {
693 gst_util_uint64_scale (self->segment.start, self->fps_n,
694 self->fps_d * GST_SECOND);
697 gst_util_uint64_scale (self->segment.stop, self->fps_n,
698 self->fps_d * GST_SECOND);
700 GST_OBJECT_UNLOCK (self);
702 self->need_segment = FALSE;
704 gst_pad_push_event (self->srcpad, e);
707 GST_OBJECT_LOCK (self);
708 offset = self->offset;
710 if (self->fps_n != 0) {
712 gst_util_uint64_scale (offset, self->fps_d * GST_SECOND, self->fps_n);
713 duration = gst_util_uint64_scale_int (GST_SECOND, self->fps_d, self->fps_n);
715 timestamp = self->segment.start;
716 duration = GST_CLOCK_TIME_NONE;
718 eos = (self->fps_n == 0 && offset > 0) ||
719 (self->segment.rate >= 0 && self->segment.stop != -1
720 && timestamp > self->segment.stop) || (self->segment.rate < 0
721 && offset == 0) || (self->segment.rate < 0
722 && self->segment.start != -1
723 && timestamp + duration < self->segment.start);
725 if (self->fps_n == 0 && offset > 0)
729 gst_segment_clip (&self->segment, GST_FORMAT_TIME, timestamp,
730 timestamp + duration, &cstart, &cstop);
733 gst_segment_set_last_stop (&self->segment, GST_FORMAT_TIME, cstart);
735 if (self->segment.rate >= 0)
739 GST_OBJECT_UNLOCK (self);
741 GST_DEBUG_OBJECT (pad, "Handling buffer with timestamp %" GST_TIME_FORMAT,
742 GST_TIME_ARGS (timestamp));
747 GST_BUFFER_TIMESTAMP (buffer) = cstart;
748 GST_BUFFER_DURATION (buffer) = cstop - cstart;
749 GST_BUFFER_OFFSET (buffer) = offset;
750 GST_BUFFER_OFFSET_END (buffer) = offset + 1;
751 gst_buffer_set_caps (buffer, GST_PAD_CAPS (self->srcpad));
752 ret = gst_pad_push (self->srcpad, buffer);
753 GST_DEBUG_OBJECT (pad, "Pushing buffer resulted in %s",
754 gst_flow_get_name (ret));
755 if (ret != GST_FLOW_OK)
756 gst_pad_pause_task (self->srcpad);
758 gst_buffer_unref (buffer);
762 if ((self->segment.flags & GST_SEEK_FLAG_SEGMENT)) {
765 GST_DEBUG_OBJECT (pad, "Sending segment done at end of segment");
766 if (self->segment.rate >= 0)
767 m = gst_message_new_segment_done (GST_OBJECT_CAST (self),
768 GST_FORMAT_TIME, self->segment.stop);
770 m = gst_message_new_segment_done (GST_OBJECT_CAST (self),
771 GST_FORMAT_TIME, self->segment.start);
772 gst_element_post_message (GST_ELEMENT_CAST (self), m);
774 GST_DEBUG_OBJECT (pad, "Sending EOS at end of segment");
775 gst_pad_push_event (self->srcpad, gst_event_new_eos ());
777 gst_pad_pause_task (self->srcpad);
781 static GstStateChangeReturn
782 gst_image_freeze_change_state (GstElement * element, GstStateChange transition)
784 GstImageFreeze *self = GST_IMAGE_FREEZE (element);
785 GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
787 switch (transition) {
788 case GST_STATE_CHANGE_READY_TO_PAUSED:
789 gst_image_freeze_reset (self);
791 case GST_STATE_CHANGE_PAUSED_TO_READY:
792 gst_pad_stop_task (self->srcpad);
793 gst_image_freeze_reset (self);
799 if (GST_ELEMENT_CLASS (parent_class)->change_state)
800 ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
802 switch (transition) {
811 plugin_init (GstPlugin * plugin)
813 GST_DEBUG_CATEGORY_INIT (gst_image_freeze_debug, "imagefreeze", 0,
814 "imagefreeze element");
816 if (!gst_element_register (plugin, "imagefreeze", GST_RANK_NONE,
817 GST_TYPE_IMAGE_FREEZE))
823 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
826 "Still frame stream generator",
827 plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)