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

[pvr] add optional support for playing recordings from epg timeline or epg osd #3900

Merged
merged 6 commits into from Jul 11, 2014
Merged

[pvr] add optional support for playing recordings from epg timeline or epg osd #3900

merged 6 commits into from Jul 11, 2014

Conversation

vkosh
Copy link
Contributor

@vkosh vkosh commented Dec 25, 2013

This allows user to play recording through programme info dialog, which is shown by clicking on programme in the past in epg timeline or epg osd view. It also switches to a recording playback from epg search result if selected programme has one.
Programmes with associated recordings are shown with HasRecording marker (skin.confluence).
To associate recording to a programme pvr client should set recording id for corresponding epg tag. This will turn on epg updates on recordings update.
If pvr client doesn't use epg-recordings linking, then no such updates occured and everything else remains as it is now (views, switching to live stream, etc.).
If pvr backend has ability of recording everything (e.g. network pvr), then pvr client should implement its own recordings update logic to trigger recordings update on each programme end.
More info at http://forum.xbmc.org/showthread.php?tid=179792

@@ -79,7 +79,8 @@ bool CEpgDatabase::CreateTables(void)
"iSeriesId integer, "
"iEpisodeId integer, "
"iEpisodePart integer, "
"sEpisodeName varchar(128)"
"sEpisodeName varchar(128), "
"sRecordingId varchar(1024) "

This comment was marked as spam.

This comment was marked as spam.

@Jalle19
Copy link
Member

Jalle19 commented Dec 26, 2013

In my opinion you should split the changes into a couple of commits. You have pure cosmetics (some minor comment changes), iterator typedefs, CPVRRecordingPtr implementation and the main PR material in one commit now. Splitting it up makes it easier to see what has really been added/changed.

@Jalle19
Copy link
Member

Jalle19 commented Dec 26, 2013

May I also suggest that you use std::string instead of CStdString, especially since you already use the former in CPVRRecordingUid. Your current approach makes for implicit casts all over the place.

@vkosh
Copy link
Contributor Author

vkosh commented Dec 26, 2013

@Jalle19 thanks for the review. I'll split the commit. As for CStdString - may be it would be better to do in separate PR? I used std::string in new code that doesn't actually affect much on current implementation.

@vkosh
Copy link
Contributor Author

vkosh commented Dec 27, 2013

@Jalle19 I fixed the issues you pointed out, reorganized the commits as you suggest, made recording ID of std::string type to avoid implicit casts, and also added "has recording" marker to programme search view. Could you re-review please.

@Jalle19
Copy link
Member

Jalle19 commented Dec 27, 2013

Thanks, looks way better now.

I can't really comment on the main implementation since I haven't been able to test this yet, though I did notice that the changes in GUIDialogPVRGuideInfo and GUIWindowPVRCommon are very similar, infact both methods seem to accomplish the exact same thing, with the latter having a more polished implementation. @xhaggi didn't you comment on this a while back?

Anyway, refactoring of that belongs in another PR.

@xhaggi
Copy link
Member

xhaggi commented Dec 28, 2013

@Jalle19 thanks for your review, i don't have time to do this now and we need to discuss the entire idea with @opdenkamp.

@ghost ghost assigned opdenkamp Jan 2, 2014
@opdenkamp
Copy link
Member

i'll review this later when i got more time. we won't change the interface until the release

@MartijnKaijser
Copy link
Member

@vkosh please re-base against current master
@xhaggi and @Jalle19 added for review

@vkosh
Copy link
Contributor Author

vkosh commented May 21, 2014

@MartijnKaijser, @xhaggi, @Jalle19 rebased and refactored.

@Jalle19
Copy link
Member

Jalle19 commented May 22, 2014

@xhaggi I think we should use the "epgUid" field already present in recordings. I don't think any addons use it at the moment since XBMC itself doesn't use it, but this and the code that gets a recording based on an EPG tag could use it. It would be faster too I suppose.

I can pull this to a local branch and have a look.

@Jalle19
Copy link
Member

Jalle19 commented May 22, 2014

I meant "and the code that gets a timer based on an EPG tag" earlier.

@@ -55,6 +55,9 @@ CEpgInfoTag::CEpgInfoTag(void) :

CPVRTimerInfoTagPtr emptyTimer;
m_timer = emptyTimer;

CPVRRecordingPtr emptyRecording;
m_recording = emptyRecording;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@Jalle19
Copy link
Member

Jalle19 commented May 22, 2014

Apparently only PVR_TIMER has en epgUid member. I'd like to see it added to PVR_RECORDING too, this way we could set the recording tag for EPG items when recordings are fetched (should do the same for timers instead of the manual lookup like now, but that's for another PR).

@@ -71,7 +71,8 @@ void CEpgDatabase::CreateTables(void)
"iSeriesId integer, "
"iEpisodeId integer, "
"iEpisodePart integer, "
"sEpisodeName varchar(128)"
"sEpisodeName varchar(128), "
"sRecordingId text"

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

PVRRecordingMap::const_iterator it = m_recordings.find(CPVRRecordingUid(iClientId, strRecordingId));
if (it != m_recordings.end())
{
return it->second;

This comment was marked as spam.

@Jalle19
Copy link
Member

Jalle19 commented May 22, 2014

I think you'll need to ignore my comments about epgUid earlier, apparently it's used when adding a timer on the backend.

@opdenkamp
Copy link
Member

correct, backend may want to link the epg data to the timer/recording too

@vkosh
Copy link
Contributor Author

vkosh commented May 25, 2014

Fixed and rebased. Please re-review.

@xhaggi
Copy link
Member

xhaggi commented May 26, 2014

@ronie could you please take a look at the confluence part, commit 6f06898

@xhaggi
Copy link
Member

xhaggi commented May 26, 2014

@vkosh except the small cleanups, it looks good.

@Jalle19
Copy link
Member

Jalle19 commented May 26, 2014

While looking at some of the recordings related code I'm wondering if we can just change the == operator for recordings to check only the client and recording ID. That way we wouldn't need a separate class for comparing. @opdenkamp do you know off the top of your head why a recording is only considered equal if absolutely everything matches?

@ronie
Copy link
Member

ronie commented May 26, 2014

@ronie could you please take a look at the confluence part, commit 6f06898

looks good to me :-)

@vkosh
Copy link
Contributor Author

vkosh commented May 28, 2014

Rebased and polished.

@Jalle19 returning to CPVRRecordingsUid with overloaded operators and recordings map implementation. Each recording can be uniquely identified by clientId+recordingId tuple provided by backend, and we need to find recordings by this tuple as fast as we can during pvr loading/updating, because each EPG tag may have associated recording (e.g. my pvr client links all past EPG's to recordings).
Therefore I decided to map recordings by the uid tuple and use std::map for this with tuple keys represented by CPVRRecordingsUid. In this case we have O(log n) complexity for recordings lookup.
The previous implementation uses vector for recordings and it has O(n) complexity for lookup which is worse than O(log n).
So i'd prefer to leave CPVRRecordingsUid implementation as is.

@Jalle19
Copy link
Member

Jalle19 commented May 28, 2014

You're right, I guess this is fine by me then.

@jmarshallnz
Copy link
Contributor

@Jalle19, @xhaggi by the looks this is ready for a button push?

@Jalle19
Copy link
Member

Jalle19 commented Jul 11, 2014

Yeah I think so. @xhaggi ?

@jmarshallnz
Copy link
Contributor

Cool - it'd be good to get this (plus anything else that hits epg/pvr) in before I push in the stdstring changes, as otherwise they'll all need yet another rebase.

Much easier if I rebase the stdstring stuff than having a bunch of others having to rebase stuff up :)

@xhaggi
Copy link
Member

xhaggi commented Jul 11, 2014

everything else is fine by me too.

@jmarshallnz
Copy link
Contributor

@xhaggi I agree, but I don't care about it enough to delay this any longer. It can always be cleaned up later if you like :)

jenkins build this please

@xhaggi
Copy link
Member

xhaggi commented Jul 11, 2014

sure ;)

jmarshallnz added a commit that referenced this pull request Jul 11, 2014
[pvr] add optional support for playing recordings from epg timeline or epg osd
@jmarshallnz jmarshallnz merged commit dd9b215 into xbmc:master Jul 11, 2014
@xhaggi
Copy link
Member

xhaggi commented Jul 12, 2014

@vkosh and @jmarshallnz we missed syncing the xbmc_epg_types.h with the addon repo.
https://github.com/opdenkamp/xbmc-pvr-addons/blob/master/xbmc/xbmc_epg_types.h

@opdenkamp
Copy link
Member

what happened to merge windows? this indeed needs to be done, the api version needs to be bumped, add-on versions needs to be bumped, and then it needs to be pulled along with the API change. I bet all PVR add-ons are now crashing.

@xhaggi
Copy link
Member

xhaggi commented Jul 12, 2014

i'll do a PR for both

@xhaggi
Copy link
Member

xhaggi commented Jul 12, 2014

done. #5012 and opdenkamp/xbmc-pvr-addons#331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PVR Type: Improvement non-breaking change which improves existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants