How to send EOS in plugin?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to send EOS in plugin?

killerrats
This post was updated on .
I'm rewriting the filesink to overwrite the file bytes. The plugin gets to the end of file but I want to send EOS in the plugin instead of my main program.

example

gst-launch-1.0 -e rtspsrc protocols=4 location=[SOURCE] name=source ! rtph264depay name=vdepay ! h264parse ! avimux name=mux ! overwritefilesink location=[FILENAME] name=EOfSinkName source. ! rtpmp4gdepay name=adepay ! aacparse ! mux.

int main()
{
    //to EOS
    GstElement* source = gst_bin_get_by_name(GST_BIN(_videoD.srcPipeline),"EOfSinkName");
    gst_bus_post(_videoD.bus,gst_message_new_eos(GST_OBJECT(source)));
}

Above is and example of how to do that through the main program. I want to use the overwritefilesink plugin to send the eos through the pipeline.

Is that even Possible?

gstoverwritefilesink.cpp
gstoverwritefilesink.h

when I use the ctrl+c in windows it works to end of the file but if I let the program handle up to the max of the file can't seem to make it end of file. The -e makes a difference in the file but is there anyway to make it work without it with my plugin.

If i view the video file I can fast forward and backwards in the file if i use the ctrl+c. If i let the plugin not to write the file anymore it get to the end will stop but when I view the file i can't seem to go forward and backwards in the video.
------------------------------
Gstreamer 1.14.3
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: How to send EOS in plugin?

Sebastian Dröge-3
On Mon, 2016-08-15 at 11:26 -0700, killerrats wrote:
> I'm rewriting the filesink to overwrite the file bytes. The plugin gets to
> the end of file but I want to send EOS in the plugin instead of my main
> program.

You can return GST_FLOW_EOS from your create/fill function.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (949 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to send EOS in plugin?

killerrats
I'm new to the writing plugins. what is the create/fill function?
------------------------------
Gstreamer 1.14.3
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: How to send EOS in plugin?

killerrats
In reply to this post by Sebastian Dröge-3
I successfull returned GST_FLOW_EOS in the gst_overwritef_render_buffers.

The only thing I can't figure out is if let automatically EOS then the file you cannot fast forward or rewind in the player. If I ctrl+c the file is able to fast forward and rewind in the player.

gstoverwritefilesink.h
gstoverwritefilesink.cpp

Any Ideas?
------------------------------
Gstreamer 1.14.3
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: How to send EOS in plugin?

killerrats
In reply to this post by killerrats
Okay I got it to work now. I customized the gstelements_private.cpp and gstelements_private.h that I now use as gstelements_privateCustom.cpp and gstelements_privateCustom.h. In the gstelements_privateCustom.cpp I made it return and wouldn't write the rest of the stuff to finalize the file. so I had to make sure it didn't skip the writing part to finalize the file.

gstelements_privateCustom.cpp
gstelements_privateCustom.h

I also edited the gst_overwritef_render_buffers function to only return the gstflowreturn. that is in the:

gstoverwritefilesink.cpp
gstoverwritefilesink.h
------------------------------
Gstreamer 1.14.3
------------------------------
Windows