static void parse_input_pad (xmlNodePtr node, InputPadGroup **pgroup) { xmlNodePtr current; gboolean has_pad_child = FALSE; for (current = node; current; current = current->next) { if (current->type == XML_ELEMENT_NODE && !g_strcmp0 ((char *) current->name, "pad")) { if (current->children) { parse_pad (current->children, pgroup); has_pad_child = TRUE; break; } else { g_error ("tag %s does not have child tags in the file %s", (char *) current->name, xml_file); } } } if (!has_pad_child) { g_error ("tag %s does not find \"pad\" tag in file %s", node->parent ? node->parent->name ? (char *) node->parent->name : "(null)" : "(null)", xml_file); } }
void MediaInfo::on_bus_message(const Glib::RefPtr<Gst::Message>& msg) { //log_info("MediaInfo::on_bus_message"); if (msg->get_message_type() & Gst::MESSAGE_ERROR) { Glib::RefPtr<Gst::MessageError> error_msg = Glib::RefPtr<Gst::MessageError>::cast_dynamic(msg); log_info("Error: " << msg->get_source()->get_name() << ": " << error_msg->parse().what()); //assert(!"Failure"); Glib::signal_idle().connect(sigc::mem_fun(this, &MediaInfo::shutdown)); } else if (msg->get_message_type() & Gst::MESSAGE_STATE_CHANGED) { Glib::RefPtr<Gst::MessageStateChanged> state_msg = Glib::RefPtr<Gst::MessageStateChanged>::cast_dynamic(msg); Gst::State oldstate; Gst::State newstate; Gst::State pending; state_msg->parse(oldstate, newstate, pending); //log_info("-- message: " << msg->get_source()->get_name() << " " << oldstate << " " << newstate); if (msg->get_source() == m_pipeline && newstate == Gst::STATE_PAUSED) { get_information(); Glib::signal_idle().connect(sigc::mem_fun(this, &MediaInfo::shutdown)); } } else if (msg->get_message_type() & Gst::MESSAGE_TAG) { if (true) { log_info("TAG: "); auto tag_msg = Glib::RefPtr<Gst::MessageTag>::cast_dynamic(msg); log_info("<<<<<<<<<<<<<<: " << tag_msg); Gst::TagList tag_list = tag_msg->parse(); log_info(" is_empty: " << tag_list.is_empty()); tag_list.foreach(ForEach(tag_list)); log_info(">>>>>>>>>>>>>>"); if (false) // does not work { Glib::RefPtr<Gst::Pad> pad = tag_msg->parse_pad(); log_info(" PAD: " << pad); } } } }