Skip to content

Commit

Permalink
[GStreamer] video size fixes
Browse files Browse the repository at this point in the history
Try to use the video sink sink pad caps as last fallback to determine
the video dimensions.
  • Loading branch information
philn committed Aug 27, 2015
1 parent cc591f9 commit bf4f405
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ void MediaPlayerPrivateGStreamer::notifyPlayerOfVideo()
}
#endif

m_player->sizeChanged();
m_player->client().mediaPlayerEngineUpdated(m_player);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ FloatSize MediaPlayerPrivateGStreamerBase::naturalSize() const
if (GST_IS_SAMPLE(m_sample.get()) && !caps)
caps = gst_sample_get_caps(m_sample.get());

if (!caps) {
GRefPtr<GstPad> videoSinkPad = adoptGRef(gst_element_get_static_pad(m_videoSink.get(), "sink"));
if (videoSinkPad)
caps = gst_pad_get_current_caps(videoSinkPad.get());
}

if (!caps)
return FloatSize();

Expand Down Expand Up @@ -776,6 +782,7 @@ void MediaPlayerPrivateGStreamerBase::triggerDrain()

void MediaPlayerPrivateGStreamerBase::setSize(const IntSize& size)
{
INFO_MEDIA_MESSAGE("Setting size to %dx%d", size.width(), size.height());
m_size = size;
}

Expand Down

0 comments on commit bf4f405

Please sign in to comment.