36 : cReceiver(NULL, MINPRIORITY),
39 LOGDEBUG(
"pipreceiver: %s", __FUNCTION__);
40 AddPid(channel->Vpid());
48 LOGDEBUG(
"pipreceiver: %s", __FUNCTION__);
57 LOGDEBUG(
"pipreceiver: %s %s", __FUNCTION__, on ?
"on" :
"off");
63#define ERRORDELTASEC 60
69void cPipReceiver::Receive(const uchar *data, int size)
72 if (ParseTs(data, size) > 0)
78 LOGWARNING(
"pipreceiver: %d TS packet(s) not accepted in pip stream", m_numLostPackets);
80 m_lastErrorReport = cTimeMs::Now();
94 LOGWARNING(
"pipreceiver: %s null data received, reset pes buffer!", __FUNCTION__);
100 LOGWARNING(
"pipreceiver: %s TS fragment received!", __FUNCTION__);
104 while (size >= TS_SIZE) {
105 if (
int skipped = TS_SYNC(data, size)) {
106 LOGWARNING(
"pipreceiver: %s TS stream not in sync!", __FUNCTION__);
107 return played + skipped;
110 if (TsHasPayload(data)) {
111 int payloadOffset = TsPayloadOffset(data);
112 if (payloadOffset < TS_SIZE) {
113 int w =
PlayTs(data, TS_SIZE);
115 return played ? played : w;
136 if (TsPayloadStart(data)) {
161 m_pEventReceiver(device)
228 channelNum =
m_pDevice->CurrentChannel();
231 const cChannel *channel;
235 if (channelNum && (channel = Channels->GetByNumber(channelNum)) &&
236 (device =
m_pDevice->GetDevice(channel, 0,
false,
false))) {
238 device->SwitchChannel(channel,
false);
240 device->AttachReceiver(receiver);
245 LOGDEBUG(
"piphandler: %s: New receiver for channel (%d) %s", __FUNCTION__, channel->Number(), channel->Name());
251 LOGERROR(
"piphandler: %s: No receiver for channel num %d available", __FUNCTION__, channelNum);
290 LOGDEBUG(
"piphandler: %s: pip is already enabled", __FUNCTION__);
296 LOGDEBUG(
"piphandler: %s: pip is already disabled", __FUNCTION__);
298 LOGDEBUG(
"piphandler: %s: disabling pip", __FUNCTION__);
316 const cChannel *channel;
317 const cChannel *first;
329 channel = direction > 0 ? Channels->Next(channel) : Channels->Prev(channel);
330 if (!channel && Setup.ChannelsWrap)
331 channel = direction > 0 ? Channels->First() : Channels->Last();
333 if (channel && !channel->GroupSep() && (device = cDevice::GetDevice(channel, 0,
false,
true)) &&
334 device->ProvidesChannel(channel, 0, &ndr) && !ndr) {
335 Start(channel->Number());
339 if (channel == first) {
340 Skins.Message(mtError, tr(
"Channel not available!"));
422 LOGDEBUG(
"piphandler: %s: switch main stream to %d", __FUNCTION__, channel->Number());
423 Channels->SwitchTo(channel->Number());
virtual void OnEventReceived(const Event &)=0
void ChannelChange(int)
Change the pip channel.
void SwapPosition(void)
Swap pip between normal and alternative position.
void HandleEnable(bool)
Enable/ disable picture-in-picture.
cPipReceiver * m_pPipReceiver
pointer to pip receiver
void Toggle(void)
Toggle picture-in-picture.
void HandleChannelChange(int)
Change the pip channel.
const cChannel * m_pPipChannel
current pip channel
virtual ~cPipHandler(void)
int Start(int)
Create a new pip receiver and render the pip stream.
void HandleEvent(enum PipState)
Handle the pip event.
void Disable(void)
Stop picture-in-picture.
void ChannelSwap(bool)
Swap the pip channel with main live channel.
IEventReceiver * m_pEventReceiver
pointer to event receiver
bool m_active
true, if pip is active
int m_pipChannelNum
current pip channel number
void Stop(void)
Delete the pip receiver, clear decoder and display buffers and disable rendering the pip window.
cPipHandler(cSoftHdDevice *)
cPipHandler constructor
void Enable(void)
Start picture-in-picture.
void SetSize(void)
Set size and position for the pip window.
cSoftHdDevice * m_pDevice
pointer to device
cPipReceiver - receiver class for pip
virtual ~cPipReceiver(void)
pip receiver class destructor
int PlayTs(const uchar *, int)
Get the pes payload and send it to the player.
virtual void Activate(bool)
called before the receiver gets attached or after it got detached
int ParseTs(const uchar *, int)
Parse the ts stream and send it to the pes player.
cSoftHdDevice * m_pDevice
cPipReceiver(const cChannel *, cSoftHdDevice *)
pip receiver class constructor
void SetRenderPipSize(void)
Wrapper functions for cVideoRender and cPipHandler.
void SetRenderPipActive(bool)
void ResetPipStream(void)
Resets pip stream and render pipeline.
int PlayPipVideo(const uchar *, int)
Play a video packet of the pip videostream.
void ToggleRenderPipPosition(void)
State machine and event header file.
Logger class header file.
Pip receiver header file.
Device class header file.