[Sumover-dev] Retrieving a user's video data

Piers O'Hanlon p.ohanlon at cs.ucl.ac.uk
Thu Nov 20 11:45:39 GMT 2008


Hi Thibault,

You need to reimplement/modify the ::render() method in the new
colorspace handler (not the consume method as they is implemented in
the render.cpp base class). The uncompressed frame is passed to the
render() method as the const u_char* frm argument. The pixbuf_
represents the screen memory which the render draws to - in the
appropriate depth.

I don't know how tcl3d operates (or how you want to use it) but you
probably need to either inlcude some of the tcl3d header files into
the new colorspace module or call the tcl3d module from the new
colorspace module. To pass it the value of a pointer you'll need to
convert the pointer to ascii then call the function using tcl.evalc -
e.g using sprintf.

Piers.

2008/11/20 Thibault Daoulas <thibault.daoulas at canterbury.ac.nz>:
> Hi,
>   Just to update my previous mail,
> I made structure of the new renderer, which has a consume method which just
> get the data from the VideoFrame it's consuming. And then I get in trouble
> when I want to pass the VideoFrame->bp_ to my tcl3d function. I've been
> suggested a few methods, but still do not have it clear how to manipulate
> this set of data from tcl, and as I told you I think I am wrong when using
> something like "tcl.evalc("getTex vf->bp_")" since it just transfers the
> string vf->bp_, and not the pointer itself...
> Am I omitting something obvious?
>
> Thanks,
> Thibault.
>
> Thibault Daoulas wrote:
>>
>> Hi Piers,
>>   I had got indeed your previous mail, which put me on the right way, but
>> I still have some things that I am not sure that I'm doing right, or
>> understanding right. To take the colour-swscale.cpp as an example for
>> testing, I should get the video data from the (u_char *) pixbuf_ attribute
>> right? Then, one of the things I have tried, is to create in tcl a proc
>> getTexData {texData}, which sets a global variable, to this texData, which
>> is then called in my tcl3d loading texture function. As for the c++ side, I
>> used a tcl.evalc("getTexData pixbuf_"), that I thought would transmit the
>> pixbuf_ to texData.
>> Apparently I am wrong. My global variable is then set to the string
>> "pixbuf_", and then unusable when it comes to load it as a texture.
>>
>> I also tried with the tcl extension tclx to transfer the (u_char*)pixbuf_
>> from c++ to tcl, via a handle, but once again, I get the string
>> representation of the data, and do not know how to use or convert it so that
>> the tcl3d function (glTexImage2D) accepts it. (the format needed is a
>> tcl3dVector, which seems to be a pointer to unsigned char : this is what I
>> get when printing a newly created tcl3dVector GLubyte
>> :_d8063409_p_unsigned_char).
>>
>> I am sorry since I feel it is not that hard to do, but I have been stuck
>> on this for a while, and I am wondering now if there is more than the tcl
>> handles that I have confused!
>>
>> Thanks for your help,
>>
>> Thibault.
>>
>> Piers O'Hanlon wrote:
>>>
>>> Hi Thibault,
>>>
>>> I'm not sure if you my previous email on this subject but here's some
>>> more info: Basically you need to obtain the data after it has been
>>> decompressed by the codec. The head_->video_data() data structure is
>>> not used in VIC's normal operation (it is only used when lip sync is
>>> in operation - It currently doesn't work properly). If you have a look
>>> at  (I've just added a new section on the renderers):
>>> http://frostie.cs.ucl.ac.uk/nets/mmedia/wiki/VicDev
>>> You can see what the normal course of events is function by function
>>> for receiving packets. As I mentioned I think the best approach would
>>> be to copy one of the existing renders - then ensure that it is chosen
>>> on start up by VIC (see my wiki page) or via some command line switch,
>>> vic resource, or environment variable etc. This render could just
>>> extract the video data and pass it to your tcl3d function.
>>>
>>> For testing you could just modify the colour-scale.cpp renderer to
>>> pass the video to the tcl3d function using tcl.evalc("your_3d_func"),
>>> though I wouldn't recommend it for proper use as it will slow things
>>> down.
>>>
>>> Piers.
>>>
>>>
>>>
>>> 2008/11/17 Thibault Daoulas <thibault.daoulas at canterbury.ac.nz>:
>>>
>>>>
>>>> Hi,
>>>>  I have a question about an issue I am quite stuck on for a while.
>>>> Basically I want to render each video streaming of each participant,
>>>> frame
>>>> per frame, on an OpenGL texture. In order to do this, I want to get the
>>>> video frames of each source, so ideally there would be a method in the
>>>> rtp/Source class "getData()" which would return a u_char*, which I would
>>>> then transfer to the tcl interface, and finally map as a bitmap onto an
>>>> OpenGL (tcl3d in our case) texture.
>>>> The point is that I do not really understand how to get this data. The
>>>> method I thought adequate was "head_->video_data()", but each time I try
>>>> to
>>>> access it, I get a segmentation fault, and actually I do not know if the
>>>> PacketData * head_ represents...
>>>> Can anyone help me about this?
>>>>
>>>> Thank you very much for any advice,
>>>>
>>>> Thibault.
>>>>
>>>> _______________________________________________
>>>> Sumover-dev mailing list
>>>> Sumover-dev at cs.ucl.ac.uk
>>>> http://oakham.cs.ucl.ac.uk/mailman/listinfo/sumover-dev
>>>>
>>>>
>>
>>
>
>



More information about the Sumover-dev mailing list