Exemplo n.º 1
0
    void
    DDS_Dissector::dissect_transport_header (proto_tree* ltree,
                                             const DCPS::TransportHeader& header,
                                             gint& offset)
    {
      gint len;

      offset += sizeof(header.protocol_) - 2; // skip preamble

      // hf_version
      len = sizeof(header.protocol_) - offset;
      const guint8 *data_ptr =
        reinterpret_cast<const guint8*>(header.protocol_ + offset);
      proto_tree_add_bytes_format_value (ltree, hf_version, tvb_,
                                         offset, len, data_ptr,
                                         "%d.%d",
                                         header.protocol_[4],
                                         header.protocol_[5]);
      offset += len;

      // hf_flags
      len = sizeof(ACE_CDR::Octet);
      proto_tree_add_bitmask(ltree, tvb_, offset, hf_flags, ett_trans_flags,
                             flags_fields, FALSE);
      offset += len;

      offset += sizeof(header.reserved_);     // skip reserved

      // hf_length
      len = sizeof(header.length_);
      proto_tree_add_uint_format_value(ltree, hf_length, tvb_, offset, len,
                                       header.length_, "%d octets",
                                       header.length_);
      offset += len;

      // hf_sequence
      size_t size = 0, padding = 0;
      gen_find_size(header.sequence_, size, padding);
      len = static_cast<gint>(size);
      proto_tree_add_uint64(ltree, hf_sequence, tvb_, offset, len,
                            gint64(header.sequence_.getValue()));
      offset += len;

      // hf_source
      len = sizeof(header.source_);
      proto_tree_add_uint(ltree, hf_source, tvb_, offset, len,
                          guint32(header.source_));
      offset += len;
    }
Exemplo n.º 2
0
///////////////////////////////////////////////////////////////////////////////
// virtual
bool LLMediaImplGStreamer::seek(double time)
{
	bool success = false;
	if (mPlaybin)
	{
		success = gst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
				GstSeekFlags(GST_SEEK_FLAG_FLUSH |
					     GST_SEEK_FLAG_KEY_UNIT),
				GST_SEEK_TYPE_SET, gint64(time*1000000000.0F),
				GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
	}
	LL_DEBUGS("MediaImpl") << "MEDIA SEEK REQUEST to " << float(time)
	    << "sec result was " << int(success) << LL_ENDL;
	return success;
}
bool
MediaPluginGStreamer010::seek(double time_sec)
{
	bool success = false;
	if (mDoneInit && mPlaybin)
	{
		success = gst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
				GstSeekFlags(GST_SEEK_FLAG_FLUSH |
					     GST_SEEK_FLAG_KEY_UNIT),
				GST_SEEK_TYPE_SET, gint64(time_sec*GST_SECOND),
				GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
	}
	DEBUGMSG("MEDIA SEEK REQUEST to %fsec result was %d",
		 float(time_sec), int(success));
	return success;
}
Exemplo n.º 4
0
///////////////////////////////////////////////////////////////////////////////
// virtual
bool
LLMediaImplGStreamer::
seek( double time )
{
	bool success = false;
	if (mPlaybin)
	{
		success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
				GstSeekFlags(GST_SEEK_FLAG_FLUSH |
					     GST_SEEK_FLAG_KEY_UNIT),
				GST_SEEK_TYPE_SET, gint64(time*1000000000.0F),
				GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
	}
	DEBUGMSG("MEDIA SEEK REQUEST to %fsec result was %d",
		 float(time), int(success));
	return success;
}
Exemplo n.º 5
0
    void
    DDS_Dissector::dissect_sample_header (proto_tree* ltree,
                                          const DCPS::DataSampleHeader& sample,
                                          gint& offset)
    {
      gint len;

      // hf_sample_id
      len = sizeof(sample.message_id_);
      proto_tree_add_item(ltree, hf_sample_id, tvb_, offset, len, FALSE);
      offset += len;

      // hf_sample_sub_id
      len = sizeof(sample.submessage_id_);
      if (sample.submessage_id_ != SUBMESSAGE_NONE)
        {
          proto_tree_add_item(ltree, hf_sample_sub_id, tvb_, offset, len, FALSE);
        }
      offset += len;

      // hf_sample_flags
      len = sizeof(ACE_CDR::Octet);
      proto_tree_add_bitmask(ltree, tvb_, offset,
                             hf_sample_flags,
                             ett_sample_flags, sample_flags_fields, FALSE);
      offset += len;

      // hf_sample_flags2
      len = sizeof(ACE_CDR::Octet);
      proto_tree_add_bitmask(ltree, tvb_, offset,
                             hf_sample_flags2,
                             ett_sample_flags2, sample_flags2_fields, FALSE);
      offset += len;

      // hf_sample_length
      len = sizeof(sample.message_length_);
      proto_tree_add_uint_format_value(ltree, hf_sample_length,
                                       tvb_, offset, len,
                                       sample.message_length_,
                                       "%d octets", sample.message_length_);
      offset += len;

      // hf_sample_sequence
      size_t size = 0, padding = 0;
      gen_find_size(sample.sequence_, size, padding);
      len = static_cast<gint>(size);
      if (sample.message_id_ == SAMPLE_DATA) {
        proto_tree_add_uint64(ltree, hf_sample_sequence, tvb_, offset, len,
                              gint64(sample.sequence_.getValue()));
      }
      offset += len;

      // hf_sample_timestamp
      len = sizeof(sample.source_timestamp_sec_) +
        sizeof(sample.source_timestamp_nanosec_);
      if (sample.message_id_ != TRANSPORT_CONTROL)
        {
          nstime_t ns =
            {
              sample.source_timestamp_sec_,
              int(sample.source_timestamp_nanosec_)
            };
          proto_tree_add_time(ltree, hf_sample_timestamp, tvb_, offset, len, &ns);
        }
      offset += len;

      // hf_sample_lifespan
      if (sample.lifespan_duration_)
        {
          len = sizeof(sample.lifespan_duration_sec_) +
            sizeof(sample.lifespan_duration_nanosec_);
          if (sample.message_id_ != TRANSPORT_CONTROL)
            {
              nstime_t ns =
                {
                  sample.lifespan_duration_sec_,
                  int(sample.lifespan_duration_nanosec_)
                };
              proto_tree_add_time(ltree, hf_sample_lifespan, tvb_,
                                  offset, len, &ns);
            }
          offset += len;
        }

      // hf_sample_publication
      size = 0;
      gen_find_size(sample.publication_id_, size, padding);
      len = static_cast<gint>(size);
      const guint8 *data_ptr =
        reinterpret_cast<const guint8*>(&sample.publication_id_);
      if (sample.message_id_ != TRANSPORT_CONTROL)
        {
          GuidConverter converter (sample.publication_id_);
          proto_tree_add_bytes_format_value (ltree, hf_sample_publication,
                                             tvb_, offset, len, data_ptr, "%s",
                                             std::string(converter).c_str());
        }
      offset += len;

      // hf_sample_publisher
      if (sample.group_coherent_)
        {
          size = 0;
          gen_find_size(sample.publisher_id_, size, padding);
          len = static_cast<gint>(size);
          data_ptr = reinterpret_cast<const guint8*>(&sample.publisher_id_);
          if (sample.message_id_ != DCPS::TRANSPORT_CONTROL)
            {
              DCPS::GuidConverter converter(sample.publisher_id_);
              proto_tree_add_bytes_format_value (ltree, hf_sample_publisher,
                                                 tvb_, offset, len,
                                                 data_ptr, "%s",
                                                 std::string(converter).c_str()
                                                 );
            }
          offset += len;
        }

      // hf_sample_content_filt
      if (sample.content_filter_)
        {
          size = 0;
          gen_find_size(sample.content_filter_entries_, size, padding);
          gint total_len = static_cast<gint>(size);
          len = sizeof(CORBA::ULong);
          if (sample.message_id_ != DCPS::TRANSPORT_CONTROL)
            {
              proto_item *item =
                proto_tree_add_uint_format_value
                (ltree, hf_sample_content_filt, tvb_,
                 offset, len,
                 sample.content_filter_entries_.length(),
                 "%d entries",
                 sample.content_filter_entries_.length());
              offset += len;
              proto_tree *subtree = proto_item_add_subtree (item, ett_filters);
              for (CORBA::ULong i = 0;
                   i < sample.content_filter_entries_.length();
                   i++)
                {
                  const GUID_t &filter = sample.content_filter_entries_[i];
                  DCPS::GuidConverter converter(filter);
                  std::stringstream strm;
                  strm << "filter [" << i << "] = " << converter << std::ends;
                  size = 0;
                  gen_find_size(filter, size, padding);
                  len = static_cast<gint>(size);
                  proto_tree_add_text (subtree, tvb_, offset, len, "%s",
                                       strm.str().c_str());
                  offset += len;
                }

            }
          else
            {
              offset += total_len;
            }
        }
    }