mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 12:02:27 +00:00
play: Update video_snapshot
to support playbin3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6563>
This commit is contained in:
parent
21975e8d62
commit
2aef1d6ccd
1 changed files with 15 additions and 4 deletions
|
@ -4484,6 +4484,7 @@ gst_play_get_video_snapshot (GstPlay * self,
|
||||||
GstPlaySnapshotFormat format, const GstStructure * config)
|
GstPlaySnapshotFormat format, const GstStructure * config)
|
||||||
{
|
{
|
||||||
gint video_tracks = 0;
|
gint video_tracks = 0;
|
||||||
|
GstPlayVideoInfo *video_info = NULL;
|
||||||
GstSample *sample = NULL;
|
GstSample *sample = NULL;
|
||||||
GstCaps *caps = NULL;
|
GstCaps *caps = NULL;
|
||||||
gint width = -1;
|
gint width = -1;
|
||||||
|
@ -4492,11 +4493,21 @@ gst_play_get_video_snapshot (GstPlay * self,
|
||||||
gint par_d = 1;
|
gint par_d = 1;
|
||||||
g_return_val_if_fail (GST_IS_PLAY (self), NULL);
|
g_return_val_if_fail (GST_IS_PLAY (self), NULL);
|
||||||
|
|
||||||
|
if (self->use_playbin3) {
|
||||||
|
video_info = gst_play_get_current_video_track (self);
|
||||||
|
if (video_info == NULL) {
|
||||||
|
GST_DEBUG_OBJECT (self, "no current video track");
|
||||||
|
return NULL;
|
||||||
|
} else {
|
||||||
|
g_object_unref (video_info);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
g_object_get (self->playbin, "n-video", &video_tracks, NULL);
|
g_object_get (self->playbin, "n-video", &video_tracks, NULL);
|
||||||
if (video_tracks == 0) {
|
if (video_tracks == 0) {
|
||||||
GST_DEBUG_OBJECT (self, "total video track num is 0");
|
GST_DEBUG_OBJECT (self, "total video track num is 0");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case GST_PLAY_THUMBNAIL_RAW_xRGB:
|
case GST_PLAY_THUMBNAIL_RAW_xRGB:
|
||||||
|
|
Loading…
Reference in a new issue