equal
deleted
inserted
replaced
47 iMsgQHandler(NULL), |
47 iMsgQHandler(NULL), |
48 iObserver(NULL), |
48 iObserver(NULL), |
49 iFormat(NULL), |
49 iFormat(NULL), |
50 iStreamState(TMS_STREAM_UNINITIALIZED) |
50 iStreamState(TMS_STREAM_UNINITIALIZED) |
51 { |
51 { |
52 //TMSStream::Construct(this); |
52 TRACE_PRN_FN_ENT; |
|
53 TRACE_PRN_FN_EXT; |
53 } |
54 } |
54 |
55 |
55 TMSStreamBodyImpl::~TMSStreamBodyImpl() |
56 TMSStreamBodyImpl::~TMSStreamBodyImpl() |
56 { |
57 { |
|
58 TRACE_PRN_FN_ENT; |
57 if (iMsgQHandler) |
59 if (iMsgQHandler) |
58 { |
60 { |
59 iMsgQHandler->Cancel(); |
61 iMsgQHandler->Cancel(); |
60 } |
62 } |
61 delete iMsgQHandler; |
63 delete iMsgQHandler; |
69 if (iContext.CallProxy && (iContext.StreamId != -1)) |
71 if (iContext.CallProxy && (iContext.StreamId != -1)) |
70 { |
72 { |
71 iContext.CallProxy->DeleteStream(iContext.CallType, |
73 iContext.CallProxy->DeleteStream(iContext.CallType, |
72 iContext.StreamType, iContext.StreamId); |
74 iContext.StreamType, iContext.StreamId); |
73 } |
75 } |
|
76 TRACE_PRN_FN_EXT; |
74 } |
77 } |
75 |
78 |
76 gint TMSStreamBodyImpl::Create(TMSCallType callType, TMSStreamType stype, |
79 gint TMSStreamBodyImpl::Create(TMSCallType callType, TMSStreamType stype, |
77 TMSCallProxy* proxy, TMSStream& parent, TMSStreamBody*& bodyimpl) |
80 TMSCallProxy* proxy, TMSStream& parent, TMSStreamBody*& bodyimpl) |
78 { |
81 { |
332 gint TMSStreamBodyImpl::GetStreamId() |
335 gint TMSStreamBodyImpl::GetStreamId() |
333 { |
336 { |
334 return iContext.StreamId; |
337 return iContext.StreamId; |
335 } |
338 } |
336 |
339 |
337 gint TMSStreamBodyImpl::Init() |
340 gint TMSStreamBodyImpl::Init(gint retrytime) |
338 { |
341 { |
339 gint ret(TMS_RESULT_SUCCESS); |
342 gint ret(TMS_RESULT_SUCCESS); |
340 |
343 |
341 ret = ValidateStream(); |
344 ret = ValidateStream(); |
342 |
345 |
353 } |
356 } |
354 |
357 |
355 if (iContext.CallProxy) |
358 if (iContext.CallProxy) |
356 { |
359 { |
357 ret = (iContext.CallProxy)->InitStream(iContext.CallType, |
360 ret = (iContext.CallProxy)->InitStream(iContext.CallType, |
358 iContext.StreamType, iContext.StreamId, fmttype, &iMsgQueue); |
361 iContext.StreamType, iContext.StreamId, fmttype, &iMsgQueue, |
|
362 retrytime); |
359 } |
363 } |
360 else |
364 else |
361 { |
365 { |
362 ret = TMS_RESULT_UNINITIALIZED_OBJECT; |
366 ret = TMS_RESULT_UNINITIALIZED_OBJECT; |
363 } |
367 } |
487 ret = TMS_RESULT_UNINITIALIZED_OBJECT; |
491 ret = TMS_RESULT_UNINITIALIZED_OBJECT; |
488 } |
492 } |
489 return ret; |
493 return ret; |
490 } |
494 } |
491 |
495 |
492 gint TMSStreamBodyImpl::Start() |
496 gint TMSStreamBodyImpl::Start(gint retrytime) |
493 { |
497 { |
494 gint ret(TMS_RESULT_SUCCESS); |
498 gint ret(TMS_RESULT_SUCCESS); |
495 if (iContext.CallProxy) |
499 if (iContext.CallProxy) |
496 { |
500 { |
497 ret = (iContext.CallProxy)->StartStream(iContext.CallType, |
501 ret = (iContext.CallProxy)->StartStream(iContext.CallType, |
498 iContext.StreamType, iContext.StreamId); |
502 iContext.StreamType, iContext.StreamId, retrytime); |
499 } |
503 } |
500 else |
504 else |
501 { |
505 { |
502 ret = TMS_RESULT_UNINITIALIZED_OBJECT; |
506 ret = TMS_RESULT_UNINITIALIZED_OBJECT; |
503 } |
507 } |
716 |
720 |
717 void TMSStreamBodyImpl::QueueEvent(TInt aEventType, TInt aError, |
721 void TMSStreamBodyImpl::QueueEvent(TInt aEventType, TInt aError, |
718 void* user_data) |
722 void* user_data) |
719 { |
723 { |
720 TMSSignalEvent event = {}; //all elements initialized to zeros |
724 TMSSignalEvent event = {}; //all elements initialized to zeros |
721 event.reason = aError; |
725 event.reason = TMSRESULT(aError); |
722 event.user_data = user_data; |
726 event.user_data = user_data; |
723 iStreamState = aEventType; |
727 iStreamState = aEventType; |
724 |
728 |
725 switch (aEventType) |
729 switch (aEventType) |
726 { |
730 { |
731 { |
735 { |
732 event.curr_state = aEventType; |
736 event.curr_state = aEventType; |
733 event.prev_state = iPrevState; |
737 event.prev_state = iPrevState; |
734 if (iObserver) |
738 if (iObserver) |
735 { |
739 { |
736 event.type = TMS_EVENT_STREAM_STATE_CHANGED; |
740 if (aError != TMS_RESULT_SUCCESS) |
|
741 { |
|
742 event.type = TMS_EVENT_STREAM_STATE_CHANGE_ERROR; |
|
743 } |
|
744 else |
|
745 { |
|
746 event.type = TMS_EVENT_STREAM_STATE_CHANGED; |
|
747 } |
737 iObserver->TMSStreamEvent(*iParent, event); |
748 iObserver->TMSStreamEvent(*iParent, event); |
738 } |
749 } |
739 break; |
750 break; |
740 } |
751 } |
741 default: |
752 default: |