{"action":"created","issue":{"url":"https://api.github.com/repos/openpeer/ortc/issues/447","repository_url":"https://api.github.com/repos/openpeer/ortc","labels_url":"https://api.github.com/repos/openpeer/ortc/issues/447/labels{/name}","comments_url":"https://api.github.com/repos/openpeer/ortc/issues/447/comments","events_url":"https://api.github.com/repos/openpeer/ortc/issues/447/events","html_url":"https://github.com/openpeer/ortc/issues/447","id":145052671,"number":447,"title":"[Proposal] Add static RTCRtpParameters.factory() method","user":{"login":"ibc","id":16191,"avatar_url":"https://avatars.githubusercontent.com/u/16191?v=3","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openpeer/ortc/labels/propose-at-next-CG-meeting","name":"propose-at-next-CG-meeting","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2016-04-01T00:22:43Z","updated_at":"2016-04-16T11:36:36Z","closed_at":"2016-04-16T11:36:36Z","body":"Let's assume I want to send video.\r\n\r\nI get my video capabilities:\r\n\r\n```js\r\nvar myVideoCaps = RTCRtpSender.getCapabilities('video');\r\n\r\n// I get this:\r\n{\r\n  codecs :\r\n  [\r\n    {\r\n      name                 : 'VP8',\r\n      kind                 : 'video',\r\n      clockRate            : 90000,\r\n      preferredPayloadType : 100,\r\n      rtx :\r\n      {\r\n        preferredPayloadType : 96,\r\n        rtxTime              : 1234  // No idea\r\n      },\r\n      rtcpFeedback :\r\n      [\r\n        { type: 'ccm', parameter: 'fir' },\r\n        { type: 'nack' }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nSo just VP8 with RTX and some RTCP stuff.\r\n\r\nAssuming I exchange my capabilities with the remote peer and we both agree on VP8, I need to construct my `RTCRtpParameters` which would look as follows:\r\n\r\n```js\r\nvar myRtpParameters =\r\n{\r\n  muxId  : 'my-video',  // Yeah!\r\n  codecs :\r\n  [\r\n    {\r\n      name        : 'VP8',\r\n      clockRate   : 90000,\r\n      payloadType : 100,\r\n      rtx :\r\n      {\r\n        payloadType : 96,\r\n        rtxTime     : 1234\r\n      },\r\n      rtcpFeedback :\r\n      [\r\n        { type: 'ccm', parameter: 'fir' },\r\n        { type: 'nack' }\r\n      ]\r\n    }\r\n  ],\r\n  encodings : [],  // Empty\r\n  rtcp      :  // TODO\r\n};\r\n```\r\n\r\n**QUESTION 1:**\r\n\r\nHow can I set the `RTCRtcpParameters` `rtcp` field?\r\n\r\n**QUESTION 2:**\r\n\r\nSimple scenario so, of course, I can leave the `encodings` field empty. But... it happens that I need to generate a SDP offer so I need the SSRCs.\r\n\r\nThis means that I need to create the `encodings` sequence by myself. Ok, we know that we'll just send VP8 and its RTX, so it is clear that just 2 streams are needed, so we can create this `encodings`:\r\n\r\n```js\r\nmyRtpParameters.encodings =\r\n[\r\n  {\r\n    ssrc             : 11111111, // why not?\r\n    codecPayloadType : 100\r\n  },\r\n  {\r\n    ssrc             : 22222222, // why not?\r\n    codecPayloadType : 96\r\n  }\r\n];\r\n```\r\n\r\n**QUESTION 3:**\r\n\r\nThis is a very simple example. Let's imagine multiple codecs, FEC, RED, etc. And I do need the SSRCs before sending media. Do I really need to create a complex `encodings` sequence with as many entries as media codecs + feature codecs?\r\n\r\nSimpler API solution:\r\n\r\n**UPDATE:** See comment below for a better proposal.\r\n\r\n```js\r\nvar myRtpParameters;  // The above RTCRtpParameters with no `encodings` nor `rtcp`\r\n\r\n// Set my RTP parameters but don't send RTP yet\r\nvideoRtpSender.setParameters(myRtpParameters);\r\n\r\n// Get the completed & updated parameters (includes `encodings` and `rtcp`)\r\nvar myUpdatedRtpParameters = videoRtpSender.getParameters();\r\n\r\n// Let's create a SDP offer and send it, etc\r\n\r\n// Send RTP\r\nvideoRtpSender.send();  // No arguments\r\n```\r\n\r\n**QUESTION 4:**\r\n\r\nHow am I supposed to set the remaining `RTCRtpEncodingParameters` fields? I mean:\r\n\r\n```\r\nunsigned long       maxBitrate;\r\ndouble              minQuality = 0;\r\ndouble              resolutionScale;\r\ndouble              framerateScale;\r\nboolean             active = true;\r\nDOMString           encodingId;\r\nsequence<DOMString> dependencyEncodingIds;\r\n```\r\n\r\nWho is supposed to fill them? how can I know which values are supported by my browser?\r\n"},"comment":{"url":"https://api.github.com/repos/openpeer/ortc/issues/comments/210794932","html_url":"https://github.com/openpeer/ortc/issues/447#issuecomment-210794932","issue_url":"https://api.github.com/repos/openpeer/ortc/issues/447","id":210794932,"user":{"login":"ibc","id":16191,"avatar_url":"https://avatars.githubusercontent.com/u/16191?v=3","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"created_at":"2016-04-16T11:36:36Z","updated_at":"2016-04-16T11:36:36Z","body":"@robin-raymond I agree that this subject (and others) should be placed into a WG meeting.\r\n\r\nJust to summarize my opinion, the current `RtpParameters` API is not an API but the \"description\" of what a real API should internally produce and, optionally, a read-only Object retrievable via a `getParameters()` API method or a `parameters` getter.\r\n\r\nPlease ignore it. Let's wait for the WG meeting and proposals will show up."}}