summaryrefslogtreecommitdiff
path: root/command/vdr2pkt.cpp
blob: c7f0ffdd3b2a4e9898a804ee194a562414131012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * vdr2pkt.cpp: A program for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#include "vdr2pkt.h"

cMarkAdVDR2Pkt::cMarkAdVDR2Pkt(const char *QueueName, int QueueSize)
{
    queue = new cMarkAdPaketQueue(QueueName,QueueSize);
}

cMarkAdVDR2Pkt::~cMarkAdVDR2Pkt()
{
    if (queue) delete queue;
}

void cMarkAdVDR2Pkt::Clear()
{
    if (queue) queue->Clear();
}

void cMarkAdVDR2Pkt::Process(MarkAdPid Pid, uchar *VDRData, int VDRSize, uchar **PktData, int *PktSize)
{
    if ((!PktData) || (!PktSize) || (!queue)) return;
    *PktData=NULL;
    *PktSize=0;
    if (!Pid.Type) return;

    if (VDRData) queue->Put(VDRData,VDRSize);
    *PktData=queue->GetPacket(PktSize,MA_PACKET_PKT);
    return;
}