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

Add support for streaming profiles #119

Merged
merged 3 commits into from
Oct 26, 2015

Conversation

Jalle19
Copy link
Contributor

@Jalle19 Jalle19 commented Oct 18, 2015

See #40

@ksooo for review. I've split the feature into three commits for easier review, we can squash it before merging if you want to.

I'm thinking whether we should add another boolean option to disable predictive tuning if a streaming profile is set. Having multiple transcoded subscriptions can easily overwhelm a low-powered server.

Since this touches settings I'd like to get #116 merged before this one. #79 would be nice to get in before as well since it refactors Subscription into a class (if the feature is not ready we could opt for just merging that particular part).

@TheTroll can you test this?

@ksooo
Copy link
Member

ksooo commented Oct 18, 2015

Yeah, looks good. Obviously the new setting heavily interferes with #116...

@ghost
Copy link

ghost commented Oct 18, 2015

Hi,

I ll take a look thx!

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 18, 2015

@ksooo yeah I'll rebase once it's in.
@TheTroll thanks

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 20, 2015

@TheTroll can you test?

@ghost
Copy link

ghost commented Oct 20, 2015

Hi, I will before the end of the week.
Sorry for the delay!

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 20, 2015

No problem, I'll test again when I get home (just checking that the rebase went well).

@ksooo @Glenn-1990 we should refactor SendSubscribe so that there are two separate methods for "restart" and "normal subscribe". That way we don't have to make all the parameters optional and it improves readability a bit. Currently you have to use e.g. GetProfile() inside the method instead of just using the parameter directly which may be a bit confusing and prone to errors.

void SendSubscribe(uint32_t channelId = 0,
uint32_t weight = SUBSCRIPTION_WEIGHT_NORMAL,
const std::string &profile = "",
bool restart = false);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to change the profile on run-time?
Otherwise we could just pass the profile with the constructor, that will make all this profile passing unnecessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it should be but currently no since an addon restart is triggered if you change the setting. I'm perfectly fine with requiring a restart and feeding the desired profile through the constructor instead, anything to keep the parameter count on this method down is good in by book. @ksooo thoughts?

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 20, 2015

@ksooo I had to move the logic that queries for available profiles to CTvheadend::SyncCompleted(). The initial sync is done on a separate thread than client.cpp which meant that when connecting to the server over WAN (which is slower) the getProfiles call timed out because tvheadend was busy pushing all the initial sync data over the wire. Now that I moved the logic the issue disappears, plus we can keep the streaming profile related methods private in CTvheadend.

Will do some final runtime testing when I get home, then I'll merge and update the changelog etc.

{
XBMC->QueueNotification(
QUEUE_ERROR,
XBMC->GetLocalizedString(30502), streamingProfile.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error is shown when I didn't set any streaming profile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha could be that I didn't test that scenario yet :-D

@Glenn-1990
Copy link
Contributor

It's probably a silly question, but why do wee need this, we can set the desired streaming profile in the tvheadend config right?

@sorano
Copy link

sorano commented Oct 20, 2015

I'm thinking that we can provide different profiles for end-users, and they can choose the profile that fits their current scenario?

For example, if the user is in a place with low bandwidth, he can select a profile with heavy transcoding to save bandwidth.

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 20, 2015

@Glenn-1990 see #40, there are a few reasonable use cases for this (especially the one about recordings)

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 21, 2015

@Glenn-1990 you mind giving this a final spin (mainly to check that untouched configurations still work)? @ksooo I squashed the latest fixups, mind doing a final review before merging?

@@ -15,6 +15,9 @@
<setting id="autorec_approxtime" type="enum" label="30051" lvalues="30052|30053" default="0"/>
<setting id="autorec_maxdiff" enable="eq(-1,1)" type="slider" option="int" range="0,5,120" label="30054" default="15" />

<setting label="30500" type="lsep"/>
<setting id="streaming_profile" type="text" label="30501" default="" />

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling that our "Advanced settings" page becomes to big. Is it just me or should we do a settings pages redesign soon?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Glenn-1990 already refactored it, but yeah, we may need an additional tab. I'd leave that to a separate PR though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, nothing for this PR. Maybe you can file an issue for that so we don't forget.

@Glenn-1990
Copy link
Contributor

@Jalle19 working now with default config ;-)

@Jalle19
Copy link
Contributor Author

Jalle19 commented Oct 22, 2015

Good, I'll just have to plug the leaks then and we should be good to go.

@Glenn-1990 Glenn-1990 mentioned this pull request Oct 24, 2015
Jalle19 added a commit that referenced this pull request Oct 26, 2015
Add support for streaming profiles
@Jalle19 Jalle19 merged commit e14678a into kodi-pvr:master Oct 26, 2015
@ghost
Copy link

ghost commented Nov 2, 2015

Hi,

I have moved to 15.2 and pvr.hts master, is it the right combination to test the new feature ?
Where can I select the profile ?

Thanks

@Jalle19
Copy link
Contributor Author

Jalle19 commented Nov 3, 2015

You can't use pvr.hts master with 15.2, if you want to test this you should grab a nightly build.

@ghost
Copy link

ghost commented Nov 3, 2015

So master is meant to be for kodi master ?

@Jalle19
Copy link
Contributor Author

Jalle19 commented Nov 3, 2015

Yes, exactly.

@ghost
Copy link

ghost commented Nov 3, 2015

Let me check again :)

@ghost
Copy link

ghost commented Nov 3, 2015

Ok my bad, I was using the the isengard branch!
Let me test with the right branch

@ghost
Copy link

ghost commented Nov 3, 2015

Now it works thanks :)
Why not adding this settings in "client specific" instead of the addon's settings ?

@Jalle19
Copy link
Contributor Author

Jalle19 commented Nov 3, 2015

Because none of us have any idea how to use that and users are less likely to find it.

@ghost
Copy link

ghost commented Nov 3, 2015

Ok :)
Last question, I see that the profile is entered manually. Any way to retrieve it and let the user choose from a list ?

@Jalle19
Copy link
Contributor Author

Jalle19 commented Nov 3, 2015

Nope.

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

Successfully merging this pull request may close these issues.

None yet

4 participants