⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242881 in webkit


Ignore:
Timestamp:
Mar 13, 2019, 8:28:08 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer][WebRTC]: Use codec setting video height/width as fallback
https://bugs.webkit.org/show_bug.cgi?id=195675

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-03-13
Reviewed by Philippe Normand.

In some cases the frame height and width is not set (not sure why/ in
what conditions but it happens) so make sure to get the information from
the VideoCodec when configuring the encoder.

  • platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:

(WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
(WebCore::GStreamerVideoDecoder::GetCapsForFrame):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r242864 r242881  
     12019-03-13  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GStreamer][WebRTC]: Use codec setting video height/width as fallback
     4        https://bugs.webkit.org/show_bug.cgi?id=195675
     5
     6        Reviewed by Philippe Normand.
     7
     8        In some cases the frame height and width is not set (not sure why/ in
     9        what conditions but it happens) so make sure to get the information from
     10        the VideoCodec when configuring the encoder.
     11
     12        * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
     13        (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
     14        (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
     15
    1162019-03-13  Miguel Gomez  <magomez@igalia.com>
    217
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp

    r238557 r242881  
    5555    GStreamerVideoDecoder()
    5656        : m_pictureId(0)
     57        , m_width(0)
     58        , m_height(0)
    5759        , m_firstBufferPts(GST_CLOCK_TIME_NONE)
    5860        , m_firstBufferDts(GST_CLOCK_TIME_NONE)
     
    8183    }
    8284
    83     int32_t InitDecode(const webrtc::VideoCodec*, int32_t) override
     85    int32_t InitDecode(const webrtc::VideoCodec* codecSettings, int32_t) override
    8486    {
    8587        m_src = makeElement("appsrc");
     
    8789        auto capsfilter = CreateFilter();
    8890        auto decoder = makeElement("decodebin");
     91
     92        if (codecSettings) {
     93            m_width = codecSettings->width;
     94            m_height = codecSettings->height;
     95        }
    8996
    9097        // Make the decoder output "parsed" frames only and let the main decodebin
     
    194201        if (!m_caps) {
    195202            m_caps = adoptGRef(gst_caps_new_simple(Caps(),
    196                 "width", G_TYPE_INT, image._encodedWidth,
    197                 "height", G_TYPE_INT, image._encodedHeight,
     203                "width", G_TYPE_INT, image._encodedWidth ? image._encodedWidth : m_width,
     204                "height", G_TYPE_INT, image._encodedHeight ? image._encodedHeight : m_height,
    198205                nullptr));
    199206        }
     
    270277    GRefPtr<GstCaps> m_caps;
    271278    gint m_pictureId;
     279    gint m_width;
     280    gint m_height;
    272281
    273282private:
     
    328337        if (!m_caps) {
    329338            m_caps = adoptGRef(gst_caps_new_simple(Caps(),
    330                 "width", G_TYPE_INT, image._encodedWidth,
    331                 "height", G_TYPE_INT, image._encodedHeight,
    332                 "profile", G_TYPE_STRING, m_profile ? m_profile : "baseline",
    333                 "stream-format", G_TYPE_STRING, "byte-stream",
     339                "width", G_TYPE_INT, image._encodedWidth ? image._encodedWidth : m_width,
     340                "height", G_TYPE_INT, image._encodedHeight ? image._encodedHeight : m_height,
    334341                "alignment", G_TYPE_STRING, "au",
    335342                nullptr));
Note: See TracChangeset for help on using the changeset viewer.