How do I read source data from a FILE* ?

Carlos Rafael Giani dv at pseudoterminal.org
Fri May 31 12:50:25 PDT 2013


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, like:
>
>     QGst::PipelinePtr pipeline = 
> QGst::ElementFactory::make("playbin2").dynamicCast<QGst::Pipeline>();
>     pipeline->setProperty("uri", "/path/to/some/video.ogv");
>
> 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.
>
> For example:
>
>   FILE* src_file = fopen("media.dat", "r");
>   fseek(src_file, 40000, SEEK_SET);
>
> So now I want to have 'src_file' as my source and I know there's 
> Theora video data starting at that offset and ending 8MBs later. What 
> would I need to do to get the pipeline to read from that FILE*?
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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*.


More information about the gstreamer-devel mailing list