|
数据流的打包分组stream_to_tagged_stream:
Wiki Page for this Block: https://wiki.gnuradio.org/index.php/Stream_to_Tagged_Stream
blocks_stream_to_tagged_stream
int stream_to_tagged_stream_impl::work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items)
{
gr::thread::scoped_lock guard(d_setlock);
const unsigned char* in = (const unsigned char*)input_items[0];
unsigned char* out = (unsigned char*)output_items[0];
// 拷贝数据 没有改变什么
memcpy(out, in, noutput_items * d_itemsize);
// Add tags every d_packet_len
while (d_next_tag_pos < nitems_written(0) + noutput_items) {
add_item_tag(0, d_next_tag_pos, d_len_tag_key, d_packet_len_pmt);
d_next_tag_pos += d_packet_len;
}
return noutput_items;
}
显示数据流的打包信息:tag debug
|
|