{"action":"created","issue":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/6680","labels_url":"https://api.github.com/repos/xbmc/xbmc/issues/6680/labels{/name}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/6680/comments","events_url":"https://api.github.com/repos/xbmc/xbmc/issues/6680/events","html_url":"https://github.com/xbmc/xbmc/pull/6680","id":60537962,"number":6680,"title":"add helper for dealing with video dimensions","user":{"login":"Jalle19","id":1106133,"avatar_url":"https://avatars.githubusercontent.com/u/1106133?v=3","gravatar_id":"","url":"https://api.github.com/users/Jalle19","html_url":"https://github.com/Jalle19","followers_url":"https://api.github.com/users/Jalle19/followers","following_url":"https://api.github.com/users/Jalle19/following{/other_user}","gists_url":"https://api.github.com/users/Jalle19/gists{/gist_id}","starred_url":"https://api.github.com/users/Jalle19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jalle19/subscriptions","organizations_url":"https://api.github.com/users/Jalle19/orgs","repos_url":"https://api.github.com/users/Jalle19/repos","events_url":"https://api.github.com/users/Jalle19/events{/privacy}","received_events_url":"https://api.github.com/users/Jalle19/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xbmc/xbmc/labels/Cleanup","name":"Cleanup","color":"DDDDDD"},{"url":"https://api.github.com/repos/xbmc/xbmc/labels/Improvement","name":"Improvement","color":"0b02e1"},{"url":"https://api.github.com/repos/xbmc/xbmc/labels/RFC","name":"RFC","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-10T17:33:46Z","updated_at":"2015-03-11T10:20:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/6680","html_url":"https://github.com/xbmc/xbmc/pull/6680","diff_url":"https://github.com/xbmc/xbmc/pull/6680.diff","patch_url":"https://github.com/xbmc/xbmc/pull/6680.patch"},"body":"This is a first attempt at hopefully consolidating the logic behind determining whether a video is SD or HD etc. It replaces `CStreamDetails::VideoDimsToResolutionDescription` with a new helper class `CVideoDimensions` which provides the same functionality and more.\r\n\r\nThis also changes the logic for converting width and height to e.g. \"720\" to use a list of boundaries that each \"descriptor\" can have, e.g. for a file to be \"720\" its width must be between 960 and 1280 while its height must be between 540, 720. The way this is implemented means it should be easy to create unit tests to make sure this crap doesn't keep breaking everyone someone so much as looks at the code.\r\n\r\nThe use of boundaries to specify what \"descriptor\" a video item has can also be used backwards, e.g. in order to find all videos having a resolution matching \"720\". Before that was not possible because the boundaries weren't defined anywhere. This is needed in order to implement some of the suggestions in https://github.com/xbmc/xbmc/pull/6611\r\n\r\nRFC:\r\n* should we try to bake this into e.g. `CStreamDetailsVideo` instead? Somewhere else? There are lots of classes that have just two members (widht and height) so there's probably more room for consolidation\r\n* The naming scheme could probably be more descriptive (no pun intended)\r\n\r\nTODO:\r\n* Not sure where `GetFidelity` could be used at the moment, I need to check the code for the lists (where the SD/HD icon is shown).\r\n\r\n@mkortstiege @Montellese @topfs2 @fritsch "},"comment":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/comments/78237385","html_url":"https://github.com/xbmc/xbmc/pull/6680#issuecomment-78237385","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/6680","id":78237385,"user":{"login":"Montellese","id":75864,"avatar_url":"https://avatars.githubusercontent.com/u/75864?v=3","gravatar_id":"","url":"https://api.github.com/users/Montellese","html_url":"https://github.com/Montellese","followers_url":"https://api.github.com/users/Montellese/followers","following_url":"https://api.github.com/users/Montellese/following{/other_user}","gists_url":"https://api.github.com/users/Montellese/gists{/gist_id}","starred_url":"https://api.github.com/users/Montellese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Montellese/subscriptions","organizations_url":"https://api.github.com/users/Montellese/orgs","repos_url":"https://api.github.com/users/Montellese/repos","events_url":"https://api.github.com/users/Montellese/events{/privacy}","received_events_url":"https://api.github.com/users/Montellese/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T10:20:57Z","updated_at":"2015-03-11T10:20:57Z","body":"IMO let's first get this done as a replacement for the logic we already have in `CStreamDetails` otherwise it won't be finished (and maybe even abandoned) for a while."}}