[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Modify data inside a blob
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] Modify data inside a blob |
Date: |
Mon, 08 Oct 2012 11:00:16 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 |
On 10/07/2012 07:05 PM, Jose Torres Diaz wrote:
> 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
>
Generally, you dont want to modify a message from the upstream. Thats
because this message may be shared by other downstream consumers.
Its best to make a copy of the data into a new blob.
I think you have everything you need between these two header entries:
http://gnuradio.org/cgit/gnuradio.git/tree/gruel/src/include/gruel/pmt.h#n329
https://github.com/guruofquality/grextras/blob/master/include/gruel/pmt_blob.h#L30
-josh