• Home
  • Raw
  • Download

Lines Matching refs:ke

137 static gboolean gst_kate_enc_setcaps (GstKateEnc * ke, GstCaps * caps);
237 gst_kate_enc_init (GstKateEnc * ke) in gst_kate_enc_init() argument
239 GST_DEBUG_OBJECT (ke, "gst_kate_enc_init"); in gst_kate_enc_init()
241 ke->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); in gst_kate_enc_init()
242 gst_pad_set_chain_function (ke->sinkpad, in gst_kate_enc_init()
244 gst_pad_set_event_function (ke->sinkpad, in gst_kate_enc_init()
246 gst_element_add_pad (GST_ELEMENT (ke), ke->sinkpad); in gst_kate_enc_init()
248 ke->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); in gst_kate_enc_init()
249 gst_pad_set_query_function (ke->srcpad, in gst_kate_enc_init()
251 gst_element_add_pad (GST_ELEMENT (ke), ke->srcpad); in gst_kate_enc_init()
253 ke->initialized = FALSE; in gst_kate_enc_init()
254 ke->headers_sent = FALSE; in gst_kate_enc_init()
255 ke->last_timestamp = 0; in gst_kate_enc_init()
256 ke->latest_end_time = 0; in gst_kate_enc_init()
257 ke->language = NULL; in gst_kate_enc_init()
258 ke->category = NULL; in gst_kate_enc_init()
259 ke->format = GST_KATE_FORMAT_UNDEFINED; in gst_kate_enc_init()
260 ke->granule_rate_numerator = 1000; in gst_kate_enc_init()
261 ke->granule_rate_denominator = 1; in gst_kate_enc_init()
262 ke->granule_shift = 32; in gst_kate_enc_init()
263 ke->original_canvas_width = 0; in gst_kate_enc_init()
264 ke->original_canvas_height = 0; in gst_kate_enc_init()
265 ke->keepalive_min_time = DEFAULT_KEEPALIVE_MIN_TIME; in gst_kate_enc_init()
266 ke->default_spu_duration = DEFAULT_DEFAULT_SPU_DURATION; in gst_kate_enc_init()
267 memcpy (ke->spu_clut, gst_kate_spu_default_clut, in gst_kate_enc_init()
269 ke->delayed_spu = FALSE; in gst_kate_enc_init()
270 ke->delayed_bitmap = NULL; in gst_kate_enc_init()
271 ke->delayed_palette = NULL; in gst_kate_enc_init()
272 ke->delayed_region = NULL; in gst_kate_enc_init()
278 GstKateEnc *ke = GST_KATE_ENC (object); in gst_kate_enc_dispose() local
280 GST_LOG_OBJECT (ke, "disposing"); in gst_kate_enc_dispose()
282 if (ke->language) { in gst_kate_enc_dispose()
283 g_free (ke->language); in gst_kate_enc_dispose()
284 ke->language = NULL; in gst_kate_enc_dispose()
286 if (ke->category) { in gst_kate_enc_dispose()
287 g_free (ke->category); in gst_kate_enc_dispose()
288 ke->category = NULL; in gst_kate_enc_dispose()
298 GstKateEnc *ke = GST_KATE_ENC (object); in gst_kate_enc_set_property() local
303 if (ke->language) { in gst_kate_enc_set_property()
304 g_free (ke->language); in gst_kate_enc_set_property()
305 ke->language = NULL; in gst_kate_enc_set_property()
309 ke->language = g_strdup (str); in gst_kate_enc_set_property()
312 if (ke->category) { in gst_kate_enc_set_property()
313 g_free (ke->category); in gst_kate_enc_set_property()
314 ke->category = NULL; in gst_kate_enc_set_property()
318 ke->category = g_strdup (str); in gst_kate_enc_set_property()
321 ke->granule_rate_numerator = g_value_get_int (value); in gst_kate_enc_set_property()
324 ke->granule_rate_denominator = g_value_get_int (value); in gst_kate_enc_set_property()
327 ke->granule_rate_denominator = g_value_get_int (value); in gst_kate_enc_set_property()
330 ke->keepalive_min_time = g_value_get_float (value); in gst_kate_enc_set_property()
333 ke->original_canvas_width = g_value_get_int (value); in gst_kate_enc_set_property()
336 ke->original_canvas_height = g_value_get_int (value); in gst_kate_enc_set_property()
339 ke->default_spu_duration = g_value_get_float (value); in gst_kate_enc_set_property()
351 GstKateEnc *ke = GST_KATE_ENC (object); in gst_kate_enc_get_property() local
355 g_value_set_string (value, ke->language ? ke->language : ""); in gst_kate_enc_get_property()
358 g_value_set_string (value, ke->category ? ke->category : ""); in gst_kate_enc_get_property()
361 g_value_set_int (value, ke->granule_rate_numerator); in gst_kate_enc_get_property()
364 g_value_set_int (value, ke->granule_rate_denominator); in gst_kate_enc_get_property()
367 g_value_set_int (value, ke->granule_shift); in gst_kate_enc_get_property()
370 g_value_set_float (value, ke->keepalive_min_time); in gst_kate_enc_get_property()
373 g_value_set_int (value, ke->original_canvas_width); in gst_kate_enc_get_property()
376 g_value_set_int (value, ke->original_canvas_height); in gst_kate_enc_get_property()
379 g_value_set_float (value, ke->default_spu_duration); in gst_kate_enc_get_property()
390 gst_kate_enc_create_buffer (GstKateEnc * ke, kate_packet * kp, in gst_kate_enc_create_buffer() argument
401 GST_WARNING_OBJECT (ke, "Failed to allocate buffer for %u bytes", in gst_kate_enc_create_buffer()
421 gst_kate_enc_push_buffer (GstKateEnc * ke, GstBuffer * buffer) in gst_kate_enc_push_buffer() argument
425 ke->last_timestamp = GST_BUFFER_TIMESTAMP (buffer); in gst_kate_enc_push_buffer()
427 ke->latest_end_time) { in gst_kate_enc_push_buffer()
428 ke->latest_end_time = in gst_kate_enc_push_buffer()
432 flow = gst_pad_push (ke->srcpad, buffer); in gst_kate_enc_push_buffer()
434 GST_WARNING_OBJECT (ke->srcpad, "push flow: %s", gst_flow_get_name (flow)); in gst_kate_enc_push_buffer()
441 gst_kate_enc_push_and_free_kate_packet (GstKateEnc * ke, kate_packet * kp, in gst_kate_enc_push_and_free_kate_packet() argument
447 GST_LOG_OBJECT (ke, "Creating buffer, %u bytes", (guint) kp->nbytes); in gst_kate_enc_push_and_free_kate_packet()
449 gst_kate_enc_create_buffer (ke, kp, granpos, timestamp, duration, header); in gst_kate_enc_push_and_free_kate_packet()
451 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_push_and_free_kate_packet()
459 return gst_kate_enc_push_buffer (ke, buffer); in gst_kate_enc_push_and_free_kate_packet()
466 GstKateEnc *ke = GST_KATE_ENC (kateenc); in gst_kate_enc_metadata_set1() local
475 GST_LOG_OBJECT (ke, "Kate comment: %s", vc_string); in gst_kate_enc_metadata_set1()
477 kate_comment_add_tag (&ke->kc, key, val); in gst_kate_enc_metadata_set1()
488 gst_kate_enc_set_metadata (GstKateEnc * ke) in gst_kate_enc_set_metadata() argument
493 user_tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (ke)); in gst_kate_enc_set_metadata()
495 GST_DEBUG_OBJECT (ke, "upstream tags = %" GST_PTR_FORMAT, ke->tags); in gst_kate_enc_set_metadata()
496 GST_DEBUG_OBJECT (ke, "user-set tags = %" GST_PTR_FORMAT, user_tags); in gst_kate_enc_set_metadata()
499 merged_tags = gst_tag_list_merge (user_tags, ke->tags, in gst_kate_enc_set_metadata()
500 gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (ke))); in gst_kate_enc_set_metadata()
503 GST_DEBUG_OBJECT (ke, "merged tags = %" GST_PTR_FORMAT, merged_tags); in gst_kate_enc_set_metadata()
504 gst_tag_list_foreach (merged_tags, gst_kate_enc_metadata_set1, ke); in gst_kate_enc_set_metadata()
510 gst_kate_enc_setcaps (GstKateEnc * ke, GstCaps * caps) in gst_kate_enc_setcaps() argument
512 GST_LOG_OBJECT (ke, "input caps: %" GST_PTR_FORMAT, caps); in gst_kate_enc_setcaps()
521 if (ke->category != NULL) { in gst_kate_enc_setcaps()
529 ke->format = GST_KATE_FORMAT_TEXT_UTF8; in gst_kate_enc_setcaps()
531 ke->format = GST_KATE_FORMAT_TEXT_PANGO_MARKUP; in gst_kate_enc_setcaps()
534 if (strcmp (ke->category, "K-SPU") == 0 || in gst_kate_enc_setcaps()
535 strcmp (ke->category, "spu-subtitles") == 0) { in gst_kate_enc_setcaps()
536 GST_ELEMENT_WARNING (ke, LIBRARY, SETTINGS, (NULL), in gst_kate_enc_setcaps()
537 ("Category set to '%s', but input is text-based.", ke->category)); in gst_kate_enc_setcaps()
540 ke->format = GST_KATE_FORMAT_SPU; in gst_kate_enc_setcaps()
541 if (strcmp (ke->category, "SUB") == 0 || in gst_kate_enc_setcaps()
542 strcmp (ke->category, "subtitles") == 0) { in gst_kate_enc_setcaps()
543 GST_ELEMENT_WARNING (ke, LIBRARY, SETTINGS, (NULL), in gst_kate_enc_setcaps()
544 ("Category set to '%s', but input is subpictures.", ke->category)); in gst_kate_enc_setcaps()
547 GST_ERROR_OBJECT (ke, "unexpected input caps %" GST_PTR_FORMAT, caps); in gst_kate_enc_setcaps()
556 gst_kate_enc_is_simple_subtitle_category (GstKateEnc * ke, const char *category) in gst_kate_enc_is_simple_subtitle_category() argument
576 gst_kate_enc_send_headers (GstKateEnc * ke) in gst_kate_enc_send_headers() argument
582 if (G_UNLIKELY (ke->category == NULL || *ke->category == '\0')) { in gst_kate_enc_send_headers()
584 GST_ELEMENT_ERROR (ke, LIBRARY, SETTINGS, (NULL), in gst_kate_enc_send_headers()
590 gst_kate_enc_set_metadata (ke); in gst_kate_enc_send_headers()
595 int ret = kate_encode_headers (&ke->k, &ke->kc, &kp); in gst_kate_enc_send_headers()
599 buffer = gst_kate_enc_create_buffer (ke, &kp, 0, 0, 0, TRUE); in gst_kate_enc_send_headers()
601 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_send_headers()
611 GST_LOG_OBJECT (ke, "Last header encoded"); in gst_kate_enc_send_headers()
614 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_send_headers()
623 if (gst_kate_enc_is_simple_subtitle_category (ke, ke->category)) { in gst_kate_enc_send_headers()
624 caps = gst_kate_util_set_header_on_caps (&ke->element, in gst_kate_enc_send_headers()
627 caps = gst_kate_util_set_header_on_caps (&ke->element, in gst_kate_enc_send_headers()
631 GST_DEBUG_OBJECT (ke, "here are the caps: %" GST_PTR_FORMAT, caps); in gst_kate_enc_send_headers()
632 gst_pad_set_caps (ke->srcpad, caps); in gst_kate_enc_send_headers()
635 if (ke->pending_segment) in gst_kate_enc_send_headers()
636 gst_pad_push_event (ke->srcpad, ke->pending_segment); in gst_kate_enc_send_headers()
637 ke->pending_segment = NULL; in gst_kate_enc_send_headers()
639 GST_LOG_OBJECT (ke, "pushing headers"); in gst_kate_enc_send_headers()
643 GST_LOG_OBJECT (ke, "pushing header %p", buffer); in gst_kate_enc_send_headers()
644 gst_kate_enc_push_buffer (ke, buffer); in gst_kate_enc_send_headers()
648 GST_ERROR_OBJECT (ke, "Failed to set headers on caps"); in gst_kate_enc_send_headers()
658 gst_kate_enc_flush_headers (GstKateEnc * ke) in gst_kate_enc_flush_headers() argument
661 if (!ke->headers_sent) { in gst_kate_enc_flush_headers()
662 GST_INFO_OBJECT (ke, "headers not yet sent, flushing"); in gst_kate_enc_flush_headers()
663 rflow = gst_kate_enc_send_headers (ke); in gst_kate_enc_flush_headers()
665 ke->headers_sent = TRUE; in gst_kate_enc_flush_headers()
666 GST_INFO_OBJECT (ke, "headers flushed"); in gst_kate_enc_flush_headers()
668 GST_WARNING_OBJECT (ke, "Failed to flush headers: %s", in gst_kate_enc_flush_headers()
676 gst_kate_enc_chain_push_packet (GstKateEnc * ke, kate_packet * kp, in gst_kate_enc_chain_push_packet() argument
682 granpos = kate_encode_get_granule (&ke->k); in gst_kate_enc_chain_push_packet()
684 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_push_packet()
690 gst_kate_enc_push_and_free_kate_packet (ke, kp, granpos, start, duration, in gst_kate_enc_chain_push_packet()
693 GST_WARNING_OBJECT (ke, "Failed to push Kate packet"); in gst_kate_enc_chain_push_packet()
699 gst_kate_enc_generate_keepalive (GstKateEnc * ke, GstClockTime timestamp) in gst_kate_enc_generate_keepalive() argument
704 GST_DEBUG_OBJECT (ke, "keepalive at %f", t); in gst_kate_enc_generate_keepalive()
705 ret = kate_encode_keepalive (&ke->k, t, &kp); in gst_kate_enc_generate_keepalive()
707 GST_WARNING_OBJECT (ke, "Failed to encode keepalive packet: %s", in gst_kate_enc_generate_keepalive()
710 kate_int64_t granpos = kate_encode_get_granule (&ke->k); in gst_kate_enc_generate_keepalive()
711 GST_LOG_OBJECT (ke, "Keepalive packet encoded"); in gst_kate_enc_generate_keepalive()
712 if (gst_kate_enc_push_and_free_kate_packet (ke, &kp, granpos, timestamp, 0, in gst_kate_enc_generate_keepalive()
714 GST_WARNING_OBJECT (ke, "Failed to push keepalive packet"); in gst_kate_enc_generate_keepalive()
720 gst_kate_enc_flush_waiting (GstKateEnc * ke, GstClockTime now) in gst_kate_enc_flush_waiting() argument
723 if (ke->delayed_spu) { in gst_kate_enc_flush_waiting()
728 kate_float t0 = ke->delayed_start / (double) GST_SECOND; in gst_kate_enc_flush_waiting()
731 GST_INFO_OBJECT (ke, in gst_kate_enc_flush_waiting()
735 ret = kate_encode_text (&ke->k, t0, t1, "", 0, &kp); in gst_kate_enc_flush_waiting()
737 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_flush_waiting()
743 gst_kate_enc_chain_push_packet (ke, &kp, ke->delayed_start, in gst_kate_enc_flush_waiting()
744 now - ke->delayed_start + 1); in gst_kate_enc_flush_waiting()
748 GST_DEBUG_OBJECT (ke, "delayed SPU packet flushed"); in gst_kate_enc_flush_waiting()
750 GST_WARNING_OBJECT (ke, "Failed to flush delayed SPU packet: %s", in gst_kate_enc_flush_waiting()
755 ke->delayed_spu = FALSE; in gst_kate_enc_flush_waiting()
758 g_free (ke->delayed_bitmap->pixels); in gst_kate_enc_flush_waiting()
759 g_free (ke->delayed_bitmap); in gst_kate_enc_flush_waiting()
760 ke->delayed_bitmap = NULL; in gst_kate_enc_flush_waiting()
761 g_free (ke->delayed_palette->colors); in gst_kate_enc_flush_waiting()
762 g_free (ke->delayed_palette); in gst_kate_enc_flush_waiting()
763 ke->delayed_palette = NULL; in gst_kate_enc_flush_waiting()
764 g_free (ke->delayed_region); in gst_kate_enc_flush_waiting()
765 ke->delayed_region = NULL; in gst_kate_enc_flush_waiting()
768 if (ke->keepalive_min_time > 0.0f && t1 > t0) { in gst_kate_enc_flush_waiting()
769 GST_INFO_OBJECT (ke, "generating keepalives at %f from %f to %f", in gst_kate_enc_flush_waiting()
770 ke->keepalive_min_time, t0, t1); in gst_kate_enc_flush_waiting()
771 for (keepalive_time = ke->delayed_start; in gst_kate_enc_flush_waiting()
772 (keepalive_time += ke->keepalive_min_time * GST_SECOND) < now;) { in gst_kate_enc_flush_waiting()
773 GST_INFO_OBJECT (ke, "generating keepalive at %f", in gst_kate_enc_flush_waiting()
775 gst_kate_enc_generate_keepalive (ke, keepalive_time); in gst_kate_enc_flush_waiting()
783 gst_kate_enc_chain_spu (GstKateEnc * ke, GstBuffer * buf) in gst_kate_enc_chain_spu() argument
802 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), ("Out of memory")); in gst_kate_enc_chain_spu()
806 rflow = gst_kate_spu_decode_spu (ke, buf, kregion, kbitmap, kpalette); in gst_kate_enc_chain_spu()
808 GST_ERROR_OBJECT (ke, "Failed to decode incoming SPU"); in gst_kate_enc_chain_spu()
828 GST_WARNING_OBJECT (ke, "SPU is totally invisible - dimwits"); in gst_kate_enc_chain_spu()
834 start = GST_BUFFER_TIMESTAMP (buf) + GST_KATE_STM_TO_GST (ke->show_time); in gst_kate_enc_chain_spu()
835 stop = GST_BUFFER_TIMESTAMP (buf) + GST_KATE_STM_TO_GST (ke->hide_time); in gst_kate_enc_chain_spu()
838 GST_DEBUG_OBJECT (ke, "buf ts %f, start/show %hu/%hu", in gst_kate_enc_chain_spu()
839 GST_BUFFER_TIMESTAMP (buf) / (double) GST_SECOND, ke->show_time, in gst_kate_enc_chain_spu()
840 ke->hide_time); in gst_kate_enc_chain_spu()
856 GST_DEBUG_OBJECT (ke, "Encoding %" G_GSIZE_FORMAT "x%" G_GSIZE_FORMAT in gst_kate_enc_chain_spu()
860 ret = kate_encode_set_region (&ke->k, kregion); in gst_kate_enc_chain_spu()
862 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_spu()
867 ret = kate_encode_set_palette (&ke->k, kpalette); in gst_kate_enc_chain_spu()
869 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_spu()
874 ret = kate_encode_set_bitmap (&ke->k, kbitmap); in gst_kate_enc_chain_spu()
876 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_spu()
886 if (ke->hide_time <= ke->show_time) { in gst_kate_enc_chain_spu()
887 GST_INFO_OBJECT (ke, in gst_kate_enc_chain_spu()
890 ke->delayed_spu = TRUE; in gst_kate_enc_chain_spu()
891 ke->delayed_start = start; in gst_kate_enc_chain_spu()
892 ke->delayed_bitmap = kbitmap; in gst_kate_enc_chain_spu()
893 ke->delayed_palette = kpalette; in gst_kate_enc_chain_spu()
894 ke->delayed_region = kregion; in gst_kate_enc_chain_spu()
899 ret = kate_encode_text (&ke->k, t0, t1, "", 0, &kp); in gst_kate_enc_chain_spu()
901 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_spu()
907 rflow = gst_kate_enc_chain_push_packet (ke, &kp, start, stop - start + 1); in gst_kate_enc_chain_spu()
911 if (!ke->delayed_spu) { in gst_kate_enc_chain_spu()
929 gst_kate_enc_chain_text (GstKateEnc * ke, GstBuffer * buf) in gst_kate_enc_chain_text() argument
937 if (ke->format == GST_KATE_FORMAT_TEXT_PANGO_MARKUP) { in gst_kate_enc_chain_text()
938 ret = kate_encode_set_markup_type (&ke->k, kate_markup_simple); in gst_kate_enc_chain_text()
939 } else if (ke->format == GST_KATE_FORMAT_TEXT_UTF8) { in gst_kate_enc_chain_text()
940 ret = kate_encode_set_markup_type (&ke->k, kate_markup_none); in gst_kate_enc_chain_text()
946 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_text()
963 GST_LOG_OBJECT (ke, "Encoding text: %*.*s (%u bytes) from %f to %f", in gst_kate_enc_chain_text()
965 ret = kate_encode_text (&ke->k, t0, t1, (const char *) info.data, info.size, in gst_kate_enc_chain_text()
968 GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), in gst_kate_enc_chain_text()
972 rflow = gst_kate_enc_chain_push_packet (ke, &kp, start, stop - start + 1); in gst_kate_enc_chain_text()
987 GstKateEnc *ke = GST_KATE_ENC (parent); in gst_kate_enc_chain() local
990 GST_DEBUG_OBJECT (ke, "got packet, %" G_GSIZE_FORMAT " bytes", in gst_kate_enc_chain()
994 rflow = gst_kate_enc_flush_headers (ke); in gst_kate_enc_chain()
998 rflow = gst_kate_enc_flush_waiting (ke, GST_BUFFER_TIMESTAMP (buf)); in gst_kate_enc_chain()
1001 if (ke->format == GST_KATE_FORMAT_SPU) { in gst_kate_enc_chain()
1003 rflow = gst_kate_enc_chain_spu (ke, buf); in gst_kate_enc_chain()
1006 rflow = gst_kate_enc_chain_text (ke, buf); in gst_kate_enc_chain()
1019 GstKateEnc *ke = GST_KATE_ENC (element); in gst_kate_enc_change_state() local
1023 GST_INFO_OBJECT (ke, "gst_kate_enc_change_state"); in gst_kate_enc_change_state()
1027 ke->tags = gst_tag_list_new_empty (); in gst_kate_enc_change_state()
1030 GST_DEBUG_OBJECT (ke, "READY -> PAUSED, initializing kate state"); in gst_kate_enc_change_state()
1031 ret = kate_info_init (&ke->ki); in gst_kate_enc_change_state()
1033 GST_WARNING_OBJECT (ke, "failed to initialize kate info structure: %s", in gst_kate_enc_change_state()
1037 if (ke->language) { in gst_kate_enc_change_state()
1038 ret = kate_info_set_language (&ke->ki, ke->language); in gst_kate_enc_change_state()
1040 GST_WARNING_OBJECT (ke, "failed to set stream language: %s", in gst_kate_enc_change_state()
1045 if (ke->category) { in gst_kate_enc_change_state()
1046 ret = kate_info_set_category (&ke->ki, ke->category); in gst_kate_enc_change_state()
1048 GST_WARNING_OBJECT (ke, "failed to set stream category: %s", in gst_kate_enc_change_state()
1054 kate_info_set_original_canvas_size (&ke->ki, in gst_kate_enc_change_state()
1055 ke->original_canvas_width, ke->original_canvas_height); in gst_kate_enc_change_state()
1057 GST_WARNING_OBJECT (ke, "failed to set original canvas size: %s", in gst_kate_enc_change_state()
1061 ret = kate_comment_init (&ke->kc); in gst_kate_enc_change_state()
1063 GST_WARNING_OBJECT (ke, in gst_kate_enc_change_state()
1068 ret = kate_encode_init (&ke->k, &ke->ki); in gst_kate_enc_change_state()
1070 GST_WARNING_OBJECT (ke, "failed to initialize kate state: %s", in gst_kate_enc_change_state()
1074 ke->headers_sent = FALSE; in gst_kate_enc_change_state()
1075 ke->initialized = TRUE; in gst_kate_enc_change_state()
1076 ke->last_timestamp = 0; in gst_kate_enc_change_state()
1077 ke->latest_end_time = 0; in gst_kate_enc_change_state()
1078 ke->format = GST_KATE_FORMAT_UNDEFINED; in gst_kate_enc_change_state()
1083 gst_tag_list_unref (ke->tags); in gst_kate_enc_change_state()
1084 ke->tags = NULL; in gst_kate_enc_change_state()
1092 GST_WARNING_OBJECT (ke, "Parent failed to change state"); in gst_kate_enc_change_state()
1100 GST_DEBUG_OBJECT (ke, "PAUSED -> READY, clearing kate state"); in gst_kate_enc_change_state()
1101 if (ke->initialized) { in gst_kate_enc_change_state()
1102 kate_clear (&ke->k); in gst_kate_enc_change_state()
1103 kate_info_clear (&ke->ki); in gst_kate_enc_change_state()
1104 kate_comment_clear (&ke->kc); in gst_kate_enc_change_state()
1105 ke->initialized = FALSE; in gst_kate_enc_change_state()
1106 ke->last_timestamp = 0; in gst_kate_enc_change_state()
1107 ke->latest_end_time = 0; in gst_kate_enc_change_state()
1109 gst_event_replace (&ke->pending_segment, NULL); in gst_kate_enc_change_state()
1117 GST_DEBUG_OBJECT (ke, "State change done"); in gst_kate_enc_change_state()
1148 GstKateEnc *ke; in gst_kate_enc_convert() local
1156 ke = GST_KATE_ENC (gst_pad_get_parent (pad)); in gst_kate_enc_convert()
1158 if (!ke->initialized) { in gst_kate_enc_convert()
1159 GST_WARNING_OBJECT (ke, "not initialized yet"); in gst_kate_enc_convert()
1160 gst_object_unref (ke); in gst_kate_enc_convert()
1165 GST_WARNING_OBJECT (ke, "unsupported format"); in gst_kate_enc_convert()
1166 gst_object_unref (ke); in gst_kate_enc_convert()
1174 *dest_val = gst_kate_enc_granule_time (&ke->k, src_val); in gst_kate_enc_convert()
1188 GST_WARNING_OBJECT (ke, "unsupported format"); in gst_kate_enc_convert()
1191 gst_object_unref (ke); in gst_kate_enc_convert()
1227 GstKateEnc *ke = GST_KATE_ENC (parent); in gst_kate_enc_sink_event() local
1237 ret = gst_kate_enc_setcaps (ke, caps); in gst_kate_enc_sink_event()
1244 GST_LOG_OBJECT (ke, "Got newsegment event"); in gst_kate_enc_sink_event()
1248 if (!ke->headers_sent) { in gst_kate_enc_sink_event()
1249 if (ke->pending_segment) in gst_kate_enc_sink_event()
1250 gst_event_unref (ke->pending_segment); in gst_kate_enc_sink_event()
1251 ke->pending_segment = event; in gst_kate_enc_sink_event()
1255 if (ke->initialized) { in gst_kate_enc_sink_event()
1256 GST_LOG_OBJECT (ke, "ensuring all headers are in"); in gst_kate_enc_sink_event()
1257 if (gst_kate_enc_flush_headers (ke) != GST_FLOW_OK) { in gst_kate_enc_sink_event()
1258 GST_WARNING_OBJECT (ke, "Failed to flush headers"); in gst_kate_enc_sink_event()
1262 GST_WARNING_OBJECT (ke, in gst_kate_enc_sink_event()
1272 if (ke->delayed_spu in gst_kate_enc_sink_event()
1273 && t - ke->delayed_start / (double) GST_SECOND >= in gst_kate_enc_sink_event()
1274 ke->default_spu_duration) { in gst_kate_enc_sink_event()
1275 if (G_UNLIKELY (gst_kate_enc_flush_waiting (ke, in gst_kate_enc_sink_event()
1277 GST_WARNING_OBJECT (ke, "Failed to encode delayed packet"); in gst_kate_enc_sink_event()
1282 GST_LOG_OBJECT (ke, "ts %f, last %f (min %f)", t, in gst_kate_enc_sink_event()
1283 ke->last_timestamp / (double) GST_SECOND, in gst_kate_enc_sink_event()
1284 ke->keepalive_min_time); in gst_kate_enc_sink_event()
1285 if (ke->keepalive_min_time > 0.0f in gst_kate_enc_sink_event()
1286 && t - ke->last_timestamp / (double) GST_SECOND >= in gst_kate_enc_sink_event()
1287 ke->keepalive_min_time) { in gst_kate_enc_sink_event()
1290 if (!ke->delayed_spu) { in gst_kate_enc_sink_event()
1291 gst_kate_enc_generate_keepalive (ke, seg.start); in gst_kate_enc_sink_event()
1298 ret = gst_pad_push_event (ke->srcpad, event); in gst_kate_enc_sink_event()
1304 GST_LOG_OBJECT (ke, "Got custom downstream event"); in gst_kate_enc_sink_event()
1309 if (ke->initialized) { in gst_kate_enc_sink_event()
1310 GST_LOG_OBJECT (ke, "ensuring all headers are in"); in gst_kate_enc_sink_event()
1311 if (gst_kate_enc_flush_headers (ke) != GST_FLOW_OK) { in gst_kate_enc_sink_event()
1312 GST_WARNING_OBJECT (ke, "Failed to flush headers"); in gst_kate_enc_sink_event()
1322 GST_INFO_OBJECT (ke, "New CLUT received"); in gst_kate_enc_sink_event()
1327 ke->spu_clut[idx] = value; in gst_kate_enc_sink_event()
1329 GST_WARNING_OBJECT (ke, in gst_kate_enc_sink_event()
1337 GST_WARNING_OBJECT (ke, "custom downstream event with no name"); in gst_kate_enc_sink_event()
1342 ret = gst_pad_push_event (ke->srcpad, event); in gst_kate_enc_sink_event()
1346 GST_LOG_OBJECT (ke, "Got tag event"); in gst_kate_enc_sink_event()
1347 if (ke->tags) { in gst_kate_enc_sink_event()
1351 gst_tag_list_insert (ke->tags, list, in gst_kate_enc_sink_event()
1352 gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (ke))); in gst_kate_enc_sink_event()
1360 GST_INFO_OBJECT (ke, "Got EOS event"); in gst_kate_enc_sink_event()
1361 if (ke->initialized) { in gst_kate_enc_sink_event()
1362 GST_LOG_OBJECT (ke, "ensuring all headers are in"); in gst_kate_enc_sink_event()
1363 if (gst_kate_enc_flush_headers (ke) != GST_FLOW_OK) { in gst_kate_enc_sink_event()
1364 GST_WARNING_OBJECT (ke, "Failed to flush headers"); in gst_kate_enc_sink_event()
1369 ke->delayed_start + ke->default_spu_duration * GST_SECOND; in gst_kate_enc_sink_event()
1371 if (G_UNLIKELY (gst_kate_enc_flush_waiting (ke, in gst_kate_enc_sink_event()
1373 GST_WARNING_OBJECT (ke, "Failed to encode delayed packet"); in gst_kate_enc_sink_event()
1377 ret = kate_encode_finish (&ke->k, -1, &kp); in gst_kate_enc_sink_event()
1379 GST_WARNING_OBJECT (ke, "Failed to encode EOS packet: %s", in gst_kate_enc_sink_event()
1382 kate_int64_t granpos = kate_encode_get_granule (&ke->k); in gst_kate_enc_sink_event()
1383 GST_LOG_OBJECT (ke, "EOS packet encoded"); in gst_kate_enc_sink_event()
1384 if (gst_kate_enc_push_and_free_kate_packet (ke, &kp, granpos, in gst_kate_enc_sink_event()
1385 ke->latest_end_time, 0, FALSE)) { in gst_kate_enc_sink_event()
1386 GST_WARNING_OBJECT (ke, "Failed to push EOS packet"); in gst_kate_enc_sink_event()
1395 GST_LOG_OBJECT (ke, "Got unhandled event"); in gst_kate_enc_sink_event()