After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578908 - [fdsink] implement seeking on seekable fds
[fdsink] implement seeking on seekable fds
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.22
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-14 08:57 UTC by lei.wang
Modified: 2009-06-18 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to make fdsink seekable (4.63 KB, patch)
2009-06-17 15:21 UTC, Benjamin Gaignard
committed Details | Review

Description lei.wang 2009-04-14 08:57:17 UTC
I find that fdsink doesn't support GST_EVENT_NEWSEGMENT event.
So that fdsink don't work normally after push one gstbuffer(we specify gstbuffer->offset) to fdsink.
Comment 1 lei.wang 2009-04-14 09:03:16 UTC
The plugin filesink can compute new offset by call gst_file_sink_do_seek after received one GST_EVENT_NEWSEGMENT event. 
Why does fdsink do like filesink ? 
Comment 2 Wim Taymans 2009-04-15 17:15:54 UTC
because fdsink is not supposed to be used with seekable file descriptors. It can be changed, though.
Comment 3 lei.wang 2009-04-20 05:52:25 UTC
(In reply to comment #2)
> because fdsink is not supposed to be used with seekable file descriptors. It
> can be changed, though.
> 

Hi Wim,

I don't know why fdsink is not supposed to be used with seekable file descriptors.
Can you explain it ?

And I think that we frequently need use fdsink by seekable file descriptors.
For example:
alsasrc ! 'audio/x-raw-int, rate=(int)8000, channels=(int)1, endianness=(int)1234, width=(int)16, depth=(int)16, signed=(boolean)true' ! wavenc ! fdsink fd=xx

The plugin wavenc will use the last buffer to update the file header of wav.
If fdsink don't support seekable file descriptors, the wav will have one wrong header in this pipeline.


Thanks,
lei.wang
Comment 4 Wim Taymans 2009-04-20 21:19:16 UTC
> I don't know why fdsink is not supposed to be used with seekable file 
> descriptors.
> Can you explain it ?

Because the author of the element did not implement this feature. Possibly because the use case was to only use fdsink on sockets or pipes, not on seekable files. Possibly because filesink existed for dealing with files...
Comment 5 lei.wang 2009-04-21 03:09:04 UTC
(In reply to comment #4)
> > I don't know why fdsink is not supposed to be used with seekable file 
> > descriptors.
> > Can you explain it ?
> 
> Because the author of the element did not implement this feature. Possibly
> because the use case was to only use fdsink on sockets or pipes, not on
> seekable files. Possibly because filesink existed for dealing with files...
> 

Hi Wim,

I think that seekable file descriptors is important feature.And it is impossible 
that forbid user to use fdsink as one seekable file descriptors.

The gstreamer core include fdsink, but it lack this feature.

Do you plan to implement this feature? schedule?


Thanks,
lei.wang
Comment 6 Wim Taymans 2009-04-21 19:51:41 UTC
> Do you plan to implement this feature? schedule?

I have no plans or schedule for this feature. patches are welcome.
Comment 7 Benjamin Gaignard 2009-06-17 15:21:24 UTC
Created attachment 136842 [details] [review]
patch to make fdsink seekable
Comment 8 Benjamin Gaignard 2009-06-17 15:27:17 UTC
To test the patch I have replace all g_print in gst-launch.c by PRINT macro. 
So I can test seek with fdsink with this command:
gst-launch -q videotestsrc num-buffers=10 ! ffenc_h263 ! gppmux ! fdsink fd=1 > test_fdsink.3gp
I use gppmux because it make a seek at the end of encoding to write 3gp header at beginning of the file. 
Comment 9 Wim Taymans 2009-06-18 08:56:48 UTC
commit 1a6f82f4b01c4f71baf9416c6544426c432dbb9b
Author: Benjamin Gaignard <benjamin at gaignard.net>
Date:   Thu Jun 18 10:55:39 2009 +0200

    fdsink: make fdsink seekable
    
    Implement the same logic as filesink to implement seeking.
    
    Fixes #578908