qtms/src/qtmsfactoryimpl.cpp
changeset 44 d141fc1ad77b
parent 32 edd273b3192a
child 50 762d760dcfdf
equal deleted inserted replaced
43:7b58e65d61ee 44:d141fc1ad77b
    48 #include "qtmspcmimpl.h"
    48 #include "qtmspcmimpl.h"
    49 #include "qtmsamrimpl.h"
    49 #include "qtmsamrimpl.h"
    50 #include "qtmsg711impl.h"
    50 #include "qtmsg711impl.h"
    51 #include "qtmsg729impl.h"
    51 #include "qtmsg729impl.h"
    52 #include "qtmsilbcimpl.h"
    52 #include "qtmsilbcimpl.h"
    53 #include "qtmsmembuffer.h"
    53 #include "qtmsbufferimpl.h"
    54 
    54 
    55 using namespace QTMS;
    55 using namespace QTMS;
    56 using namespace TMS;
    56 using namespace TMS;
    57 
    57 
    58 QTMSFactoryImpl::QTMSFactoryImpl()
    58 QTMSFactoryImpl::QTMSFactoryImpl()
   124     TRACE_PRN_FN_ENT;
   124     TRACE_PRN_FN_ENT;
   125     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
   125     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
   126     TMS::FormatVector tmsfmtlist;
   126     TMS::FormatVector tmsfmtlist;
   127     if (iFactory)
   127     if (iFactory)
   128         {
   128         {
   129         ret = iFactory->GetSupportedFormats(strmtype,tmsfmtlist);
   129         ret = iFactory->GetSupportedFormats((TMSStreamType) strmtype,
       
   130                 tmsfmtlist);
   130         }
   131         }
   131 
   132 
   132     std::vector<TMSFormat*>::iterator itCodecs = tmsfmtlist.begin();
   133     std::vector<TMSFormat*>::iterator itCodecs = tmsfmtlist.begin();
   133     TMSFormatType fmttype;
   134     TMSFormatType fmttype;
   134     for (; itCodecs < tmsfmtlist.end(); itCodecs++)
   135     for (; itCodecs < tmsfmtlist.end(); itCodecs++)
   314     TRACE_PRN_FN_EXT;
   315     TRACE_PRN_FN_EXT;
   315     return ret;
   316     return ret;
   316     }
   317     }
   317 
   318 
   318 gint QTMSFactoryImpl::CreateBuffer(QTMSBufferType buffertype, guint size,
   319 gint QTMSFactoryImpl::CreateBuffer(QTMSBufferType buffertype, guint size,
   319         QTMSBuffer*& qtmsbuffer)
   320         QTMSBuffer*& buffer)
   320     {
   321     {
   321     TRACE_PRN_FN_ENT;
   322     TRACE_PRN_FN_ENT;
   322     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
   323     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
   323     TMSBuffer* tmsbuffer(NULL);
   324     TMSBuffer* tmsbuffer(NULL);
   324     if (iFactory)
   325     if (iFactory)
   325         {
   326         {
   326         ret = iFactory->CreateBuffer(buffertype, size, tmsbuffer);
   327         ret = iFactory->CreateBuffer((TMSBufferType) buffertype, size,
       
   328                 tmsbuffer);
   327         if (ret == TMS_RESULT_SUCCESS)
   329         if (ret == TMS_RESULT_SUCCESS)
   328             {
   330             {
   329             switch (buffertype)
   331             switch (buffertype)
   330                 {
   332                 {
   331                 case QTMS_BUFFER_MEMORY:
   333                 case QTMS_BUFFER_MEMORY:
   332                     ret = QTMSMemBuffer::Create(size, qtmsbuffer, tmsbuffer);
   334                     ret = QTMSBufferImpl::Create(buffertype, buffer, tmsbuffer);
   333                     break;
   335                     break;
   334                 default:
   336                 default:
   335                     ret = QTMS_RESULT_BUFFER_TYPE_NOT_SUPPORTED;
   337                     ret = QTMS_RESULT_BUFFER_TYPE_NOT_SUPPORTED;
   336                     break;
   338                     break;
   337                 }
   339                 }
   344 
   346 
   345 gint QTMSFactoryImpl::DeleteBuffer(QTMSBuffer*& qtmsbuffer)
   347 gint QTMSFactoryImpl::DeleteBuffer(QTMSBuffer*& qtmsbuffer)
   346     {
   348     {
   347     TRACE_PRN_FN_ENT;
   349     TRACE_PRN_FN_ENT;
   348     gint ret(QTMS_RESULT_SUCCESS);
   350     gint ret(QTMS_RESULT_SUCCESS);
   349     delete (static_cast<QTMSMemBuffer*> (qtmsbuffer));
   351     delete qtmsbuffer;
   350     qtmsbuffer = NULL;
   352     qtmsbuffer = NULL;
   351     TRACE_PRN_FN_EXT;
   353     TRACE_PRN_FN_EXT;
   352     return ret;
   354     return ret;
   353     }
   355     }
   354 
   356 
   359     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
   361     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
   360 
   362 
   361     TMS::TMSSource* tmssource(NULL);
   363     TMS::TMSSource* tmssource(NULL);
   362     if (iFactory)
   364     if (iFactory)
   363         {
   365         {
   364         ret = iFactory->CreateSource(srctype, tmssource);
   366         ret = iFactory->CreateSource((TMSSourceType) srctype, tmssource);
   365 
   367 
   366         if (ret == TMS_RESULT_SUCCESS)
   368         if (ret == TMS_RESULT_SUCCESS)
   367             {
   369             {
   368             switch (srctype)
   370             switch (srctype)
   369                 {
   371                 {
   428 
   430 
   429     TMS::TMSSink* tmssink(NULL);
   431     TMS::TMSSink* tmssink(NULL);
   430 
   432 
   431     if (iFactory)
   433     if (iFactory)
   432         {
   434         {
   433         ret = iFactory->CreateSink(sinktype, tmssink);
   435         ret = iFactory->CreateSink((TMSSinkType) sinktype, tmssink);
   434 
   436 
   435         if (ret == TMS_RESULT_SUCCESS)
   437         if (ret == TMS_RESULT_SUCCESS)
   436             {
   438             {
   437             switch (sinktype)
   439             switch (sinktype)
   438                 {
   440                 {
   527 
   529 
   528     TMS::TMSDTMF* tmsdtmf = NULL;
   530     TMS::TMSDTMF* tmsdtmf = NULL;
   529 
   531 
   530     if (iFactory)
   532     if (iFactory)
   531         {
   533         {
   532         ret = iFactory->CreateDTMF(streamtype, tmsdtmf);
   534         ret = iFactory->CreateDTMF((TMSStreamType) streamtype, tmsdtmf);
   533 
   535 
   534         if (ret == TMS_RESULT_SUCCESS)
   536         if (ret == TMS_RESULT_SUCCESS)
   535             {
   537             {
   536             ret = QTMSDTMFImpl::Create(qdtmf, tmsdtmf);
   538             ret = QTMSDTMFImpl::Create(qdtmf, tmsdtmf);
   537             }
   539             }