Bug 189921 - [WPE][GTK][WebRTC] Fixup VP8 encoding support
Summary: [WPE][GTK][WebRTC] Fixup VP8 encoding support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Thibault Saunier
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-24 11:46 PDT by Thibault Saunier
Modified: 2018-09-25 11:42 PDT (History)
5 users (show)

See Also:


Attachments
Patch (8.52 KB, patch)
2018-09-24 11:52 PDT, Thibault Saunier
no flags Details | Formatted Diff | Diff
Patch (10.54 KB, patch)
2018-09-25 04:56 PDT, Thibault Saunier
no flags Details | Formatted Diff | Diff
Patch (10.54 KB, patch)
2018-09-25 05:33 PDT, Thibault Saunier
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thibault Saunier 2018-09-24 11:46:14 PDT
[WPE][GTK][WebRTC] Fixup VP8 encoding support
Comment 1 Thibault Saunier 2018-09-24 11:52:14 PDT
Created attachment 350658 [details]
Patch
Comment 2 Philippe Normand 2018-09-25 01:58:29 PDT
Comment on attachment 350658 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350658&action=review

> Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:380
>          fragmentationInfo->fragmentationTimeDiff[0] = 0;
> +        gst_buffer_unmap(buffer, &map);

You could use the GstMappedBuffer thing here maybe?
Comment 3 Thibault Saunier 2018-09-25 04:56:23 PDT
Created attachment 350746 [details]
Patch
Comment 4 Philippe Normand 2018-09-25 05:20:48 PDT
Comment on attachment 350746 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350746&action=review

> Source/WebCore/ChangeLog:14
> +        + And do not raise a GStreamer error when GStreanerVideoEnclder::OnEncodedImage

typo Enclder

> Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:84
> +        SetRestrictionCaps(WTFMove(caps));

Are all the SetRestrictionCaps call sites OK now?

> Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:255
> +            GST_ERROR_OBJECT(m_pipeline.get(), "Encode callback failed: %d", result.error);
>  
>          return GST_FLOW_OK;

Is it OK to return FLOW_OK also when an error is raised?

> Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:370
> +        memcpy(encodedImage->_buffer, map.data(), map.size());

I know we had this before but would there be a way to avoid this?
Comment 5 Thibault Saunier 2018-09-25 05:31:38 PDT
(In reply to Philippe Normand from comment #4)
> Comment on attachment 350746 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=350746&action=review
> 
> > Source/WebCore/ChangeLog:14
> > +        + And do not raise a GStreamer error when GStreanerVideoEnclder::OnEncodedImage
> 
> typo Enclder

Fixed.

> > Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:84
> > +        SetRestrictionCaps(WTFMove(caps));
> 
> Are all the SetRestrictionCaps call sites OK now?

It is the only call yes.

> > Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:255
> > +            GST_ERROR_OBJECT(m_pipeline.get(), "Encode callback failed: %d", result.error);
> >  
> >          return GST_FLOW_OK;
> 
> Is it OK to return FLOW_OK also when an error is raised?

It is not raising an error anymore, just a "small" runtime `GST_ERROR`, the only 2 return values for `webrtc::EncodedImageCallback::Result` are:
  * OK
  * ERROR_SEND_FAILED

so basically we should not stop processing when `ERROR_SEND_FAILED` happens, so no reason to post an error on the bus.

> > Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:370
> > +        memcpy(encodedImage->_buffer, map.data(), map.size());
> 
> I know we had this before but would there be a way to avoid this?

There might be a way but I can't see any encoder implementation avoiding this memcpy, it is an encoded frame so it shouldn't be a huge deal in practice.
Comment 6 Xabier Rodríguez Calvar 2018-09-25 05:32:11 PDT
Comment on attachment 350746 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350746&action=review

>> Source/WebCore/ChangeLog:14
>> +        + And do not raise a GStreamer error when GStreanerVideoEnclder::OnEncodedImage
> 
> typo Enclder

and GStreaner :)
Comment 7 Thibault Saunier 2018-09-25 05:33:22 PDT
Created attachment 350748 [details]
Patch
Comment 8 WebKit Commit Bot 2018-09-25 11:41:18 PDT
Comment on attachment 350748 [details]
Patch

Clearing flags on attachment: 350748

Committed r236466: <https://trac.webkit.org/changeset/236466>
Comment 9 WebKit Commit Bot 2018-09-25 11:41:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-09-25 11:42:23 PDT
<rdar://problem/44768397>