char *articlehtmlfilename(struct emailinfo *email) { char *buf; char *name; name = message_name(email); trio_asprintf(&buf, "%s%s.%s", email->subdir ? email->subdir->full_path : set_dir, name, set_htmlsuffix); return buf; }
std::string NameMessage(StringView method_name, types::MessageKind kind) { std::string message_name(method_name); switch (kind) { case types::MessageKind::kRequest: message_name += "Request"; break; case types::MessageKind::kResponse: message_name += "Response"; break; case types::MessageKind::kEvent: message_name += "Event"; break; } return message_name; }
gboolean bus_callback(GstBus* sender, GstMessage* message, void* data) { gPlay* gplay = reinterpret_cast<gPlay*> (data); switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_STATE_CHANGED: { GstState newState; gst_message_parse_state_changed(message, NULL, &newState, NULL); std::string message_name(GST_MESSAGE_SRC_NAME(message));//TODO: Avoid this copy using glib if (message_name.compare("playbin") == 0){ gplay->on_state_changed(newState); } } break; case GST_MESSAGE_TAG: { GstTagList* tag_list = 0; gst_message_parse_tag(message, &tag_list); Track t; track_from_tag(tag_list, &t); gplay->on_tag_found(t); gst_tag_list_free(tag_list); } break; case GST_MESSAGE_EOS: gplay->on_eos(); break; case GST_MESSAGE_STREAM_STATUS: GstStreamStatusType message_type; gst_message_parse_stream_status(message, &message_type, NULL); g_print("Stream status: %d\n", message_type); break; default: g_print("Message from %s: %s\n", GST_MESSAGE_SRC_NAME(message), gst_message_type_get_name(GST_MESSAGE_TYPE(message))); break; } //TODO: Should I dispose message? return true; }
char *msg_relpath(struct emailinfo *to_email, struct emailinfo *from_email) /* called by msg_href() : note: you probably have to make a copy of * the buffer returned before the next call to this function. */ { static char buffer[MAXFILELEN]; char *name; name = message_name(to_email); if (!from_email && to_email->subdir) trio_snprintf(buffer, MAXFILELEN, "%s%s.%s", to_email->subdir->subdir, name, set_htmlsuffix); else if (!to_email->subdir || to_email->subdir == from_email->subdir) trio_snprintf(buffer, MAXFILELEN, "%s.%s", name, set_htmlsuffix); else trio_snprintf(buffer, MAXFILELEN, "%s%s%s.%s", to_email->subdir->rel_path_to_top, to_email->subdir->subdir, name, set_htmlsuffix); return buffer; }
void VideoWidget::OnSyncMessage(GstBus *bus, GstMessage *message, VideoWidget *self) { //return; // Seems to work even with this ? if (!self->video_overlay_) return; // Return if we are not interested in the message content if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT) return; if (GST_MESSAGE_SRC(message) != (GstObject *)self->video_overlay_) { const GstStructure *s = gst_message_get_structure(message); QString message_name(gst_structure_get_name(s)); QString note("VideoWidget::OnSyncMessage, name="); note.append(message_name); qDebug() << note; return; } // If message is about preparing xwindow id its from the current video sink // and we want to set our own qt widget window id where we want to render video const GstStructure *s = gst_message_get_structure(message); if (gst_structure_has_name(s, "prepare-xwindow-id") && self->video_overlay_) { qDebug() << self->name_ << " >> sync-message CALLBACK >> found 'prepare-xwindow-id' from GstMessage"; //GstState state, pending_state; //GstClockTime timeout_ns = 1000000; //gst_element_get_state(self->video_overlay_, &state, &pending_state, timeout_ns); //if (state == GST_STATE_PLAYING) QMetaObject::invokeMethod(self, "SetOverlay", Qt::QueuedConnection); // we only need to get this message once. //if (self->bus_) // g_signal_handler_disconnect(self->bus_, self->on_sync_message_g_signal_); // todo: method to call for this } }