How do I read source data from a FILE* ?

Nikos Chantziaras realnc at gmail.com
Sun Jun 2 19:48:03 PDT 2013


On 03/06/13 05:31, Thiago Sousa Santos wrote:
> On Fri, 2013-05-31 at 23:02 +0300, Nikos Chantziaras wrote:
>> On 31/05/13 22:50, Carlos Rafael Giani wrote:
>>> On 2013-05-31 21:39, Nikos Chantziaras wrote:
>>>> Hello, everyone.
>>>>
>>>> I'm using QtGStreamer 0.10.2 with GStreamer 0.10.36.  It works nicely
>>>> when loading media data from files
>>>>   [...]
>>>> But I cannot find any information on how to have a FILE* as a source,
>>>> where the media data only starts at some specific offset and has a
>>>> specific length.
>>>
>>> You could do this indirectly, by using fdsrc . It expects a Unix file
>>> descriptor , which is an integer. use the fileno() function to get a
>>> file descriptor out of FILE*.
>>
>> I need to also be compatible with Windows.  I suppose _fileno() would
>> work there.
>>
>> But looking at the docs of playbin2, the "source" property is read-only.
>>    It doesn't appear I can set it to an fdsrc?
>
> You use the 'uri' property, and set it to "fd://%d".
>
> Or it might be possible to simply set it to "fd://" and use the
> 'source-setup' signal to configure the source yourself.


I've set it to "appsrc://" and wrote my own file reader. Seems to work.


More information about the gstreamer-devel mailing list