Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool take_snapshot (string destination, string mime) {
- var caps = Gst.Caps.from_string (mime);
- Gst.Sample sample;
- Signal.emit_by_name (playbin, "convert-sample", caps, out sample);
- if (sample == null)
- return false;
- var buffer = sample.get_buffer();
- if (buffer == null)
- return false;
- Gst.MapInfo info;
- buffer.get_memory (0).map (out info, Gst.MapFlags.READ);
- FileUtils.set_data (destination, info.data);
- }
Add Comment
Please, Sign In to add comment