Unscaled Snapshots When Scaling?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Unscaled Snapshots When Scaling?

wafflesrg00d
I'm very new to GStreamer, and I'm currently using the following versions and launch string for a media player in a Qt 4.7.5 project:

- gstreamer-1.6.2
- gst-plugins-base-1.6.2
- gst-plugins-good-1.6.2
- gst-plugins-bad-1.6.2

gst-launch-1.0 udpsrc uri=udp://192.168.1.100:5004 buffer-size=10485760 ! downloadbuffer temp-template=/tmp/video_XXXXXX.tmp max-size-bytes=1073741824 max-size-time=0 ! decodebin ! videoconvert ! videoscale ! ximagesink

Note that the incoming stream is currently MPEG-TS but could be some other format in the future, and I'm using ximagesink for potential limitations imposed by target hardware.

My problem:
I'm trying to figure out the best way to get a snapshot for a frame in its unscaled resolution, but with videoscale performing scaling, I cannot seem to simply use gst_base_sink_get_last_sample() to achieve this.

Thus far, the only way I have been able to get an unscaled snapshot is by first calling gst_video_overlay_set_window_handle() with a value of -1, followed by gst_video_overlay_expose().  I do this so that the buffer is drawn but the user does not see it in the UI.

I then call gst_element_send_event(pipeline, gst_event_new_step(GST_FORMAT_BUFFERS, 1, 1.0, TRUE, FALSE)) and get the unscaled sample via gst_base_sink_get_last_sample() on receipt of GST_MESSAGE_ASYNC_DONE.  Lastly, I restore the original window handle for normal playback.

My question:
Is there a better, more well-known approach to getting an unscaled sample, and, if so, could someone shed a little bit of light as to how?

Thanks.