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] Obtain live stream URL from client addon before starting playba… #12587

Merged
merged 1 commit into from Jul 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions xbmc/addons/PVRClient.h
Expand Up @@ -648,9 +648,9 @@ namespace PVR
bool GetDescrambleInfo(PVR_DESCRAMBLE_INFO &descrambleinfo) const;

/*!
* @brief Get the stream URL for a channel from the server. Used by the MediaPortal add-on.
* @brief Get the stream URL for a channel from the PVR backend.
* @param channel The channel to get the stream URL for.
* @return The requested URL.
* @return The requested URL or empty string if not available.
*/
std::string GetLiveStreamURL(const CPVRChannelPtr &channel);

Expand Down
4 changes: 4 additions & 0 deletions xbmc/pvr/PVRGUIActions.cpp
Expand Up @@ -989,6 +989,10 @@ namespace PVR

void CPVRGUIActions::StartPlayback(CFileItem *item, bool bFullscreen) const
{
const CPVRChannelPtr channel = item->GetPVRChannelInfoTag();
if (channel)
item->SetDynPath(CServiceBroker::GetPVRManager().Clients()->GetLiveStreamURL(channel));

CApplicationMessenger::GetInstance().PostMsg(TMSG_MEDIA_PLAY, 0, 0, static_cast<void*>(item));
CheckAndSwitchToFullscreen(bFullscreen);
}
Expand Down
9 changes: 9 additions & 0 deletions xbmc/pvr/addons/PVRClients.cpp
Expand Up @@ -978,6 +978,15 @@ bool CPVRClients::GetPlayingClient(PVR_CLIENT &client) const
return GetCreatedClient(GetPlayingClientID(), client);
}

std::string CPVRClients::GetLiveStreamURL(const CPVRChannelPtr &channel)
{
PVR_CLIENT client;
if (GetCreatedClient(channel->ClientID(), client))
return client->GetLiveStreamURL(channel);

return std::string();
}

bool CPVRClients::OpenStream(const CPVRChannelPtr &channel, bool bIsSwitchingChannel)
{
assert(channel.get());
Expand Down
7 changes: 7 additions & 0 deletions xbmc/pvr/addons/PVRClients.h
Expand Up @@ -281,6 +281,13 @@ namespace PVR
*/
bool IsEncrypted(void) const;

/*!
* @brief Get the stream URL for a given channel from the respective client.
* @param channel The channel to get the stream URL for.
* @return The stream URL or empty string if not available.
*/
std::string GetLiveStreamURL(const CPVRChannelPtr &channel);

/*!
* @brief Open a stream on the given channel.
* @param channel The channel to start playing.
Expand Down