Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interoperate with linphone using vp8. #1818

Open
bkirnum opened this issue Sep 29, 2022 · 1 comment
Open

Interoperate with linphone using vp8. #1818

bkirnum opened this issue Sep 29, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@bkirnum
Copy link

bkirnum commented Sep 29, 2022

Is your feature request related to a problem? Please describe.
When using linphone with vp8 enabled, video fails to be decoded.

Describe the solution you'd like
I would like freeswitch to properly handle vp8 streams from linphone.

Describe alternatives you've considered
I have isolated the issue to vp8 partitioning. This is enabled by default in linphone but disabled by default in freeswitch. For encoding this is fine, linphone handles both cases as input. However, freeswitch only handles vp8 streams with partitioning disabled. I have modified linphone to disable vp8 partitioning which avoids the issue but the correct fix would be to support partitioning in freeswitch for ingress vp8 streams.

Additional context
Add any other context or screenshots about the feature request here.

Package version or git hash

  • Observed using FreeSWITCH v1.10.7 but appears to be present in latest master source as well.
@bkirnum bkirnum added the enhancement New feature or request label Sep 29, 2022
@bkirnum
Copy link
Author

bkirnum commented Sep 29, 2022

The following patch fixes the issue.

diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index e35d87712f..3e07e2f182 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -993,7 +993,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
        uint8_t *data = frame->data;
        uint8_t S;
        uint8_t DES;
-       //      uint8_t PID;
+       uint8_t PID;
        int len;
 
        if (context->debug > 0) {
@@ -1011,7 +1011,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
        DES = *data;
        data++;
        S = (DES & 0x10);
-       //      PID = DES & 0x07;
+       PID = DES & 0x07;
 
        //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DATA LEN %d S BIT %d PID: %d\n", frame->datalen, S, PID);
 
@@ -1047,7 +1047,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
                return SWITCH_STATUS_MORE_DATA;
        }
 
-       if (S) {
+       if (S && (PID == 0)) {
                switch_buffer_zero(context->vpx_packet_buffer);
                context->last_received_timestamp = frame->timestamp;
 #if 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant