1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18 #include "pv_2way_dec_data_channel_datapath.h"
19
NewL(PVLogger * aLogger,PVMFFormatType aFormat,CPV324m2Way * a2Way)20 CPV2WayDecDataChannelDatapath *CPV2WayDecDataChannelDatapath::NewL(PVLogger *aLogger,
21 PVMFFormatType aFormat,
22 CPV324m2Way *a2Way)
23 {
24 CPV2WayDecDataChannelDatapath *self = OSCL_NEW(CPV2WayDecDataChannelDatapath, (aLogger, aFormat, a2Way));
25 OsclError::LeaveIfNull(self);
26
27 if (self)
28 {
29 OSCL_TRAPSTACK_PUSH(self);
30 self->ConstructL();
31 }
32
33 OSCL_TRAPSTACK_POP();
34 return self;
35 }
36
TSCPortClosed()37 void CPV2WayDecDataChannelDatapath::TSCPortClosed()
38 {
39 if (iState != EClosed)
40 {
41 iPortPairList.front().Disconnect();
42 iPortPairList.front().iSrcPort.SetPort(NULL);
43 SetCmd(NULL);
44 }
45 }
46
GetTSCPort()47 PVMFPortInterface *CPV2WayDecDataChannelDatapath::GetTSCPort()
48 {
49 return iPortPairList.empty() ? NULL : iPortPairList.front().iSrcPort.GetPort();
50 }
51
OpenComplete()52 void CPV2WayDecDataChannelDatapath::OpenComplete()
53 {
54 CommandComplete(PVMFSuccess);
55 }
56
SkipComplete(TPV2WayNode * aNode)57 void CPV2WayDecDataChannelDatapath::SkipComplete(TPV2WayNode* aNode)
58 {
59 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "CPV2WayDecDataChannelDatapath::SkipComplete, Format=%s, Node=%x\n", iFormat.getMIMEStrPtr(), aNode->iNode));
60
61 if (!IsNodeInDatapath(aNode->iNode))
62 return;
63 // Check if it is the sink node. The sink node is the last node in the vector
64 if (iNodeList[iNodeList.size()-1].iNode.iNode == aNode->iNode)
65 {
66 iSkipComplete = true;
67 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "CPV2WayDecDataChannelDatapath::SkipComplete, Format=%s, Node=%x\n Skip complete for datapath", iFormat.getMIMEStrPtr(), aNode->iNode));
68 }
69 }
70
IsSkipComplete() const71 bool CPV2WayDecDataChannelDatapath::IsSkipComplete() const
72 {
73 return iSkipComplete;
74 }
75