discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Modify data inside a blob


From: Jose Torres Diaz
Subject: [Discuss-gnuradio] Modify data inside a blob
Date: Mon, 8 Oct 2012 12:35:54 +1030

Hi,

I would like to ask about how to modify data inside a block that work with blobs. I've finished a block (let name as "BLOCK_1"), which post message downstream. In particular, it posts 2 blobs with metadata and data. The idea is the following:

-----------------                                                                                           -------------------  
| BLOCK_1 |        ---->  post message downstream (blob 1, blob 2 )   ---->  | BLOCK_2 |
------------------                                                                                         -------------------

So, I've finished my BLOCK_1, which post:

this->post_msg(0,blob_1, blob_2), where

blob_1: Metadata that I don't want to modify
blob_2: Data I want to modify

I'm following the examples blob_to_stream, stream_to_blob and socket_to_blob. However, I am not sure how can I manipulate the data (ie. blob_2) in my BLOCK_2.

For example, I thought something like this in BLOCK_2:

int work(
        const InputItems &input_items,
        const OutputItems &output_items
)

{  
  //Loop until a blob is received
  while (_offset==0){ //start of while until a blob is received
  _msg=this->pop_msg_queue(); //Read the blob

//How to manipulate data here from _msg?
//Or can I use just input_items in the work function?

}


Many thanks for your help,

Jose

reply via email to

[Prev in Thread] Current Thread [Next in Thread]