[Semsdev] r1369 - branches/wb/core

sayer at mail.berlios.de sayer at mail.berlios.de
Thu May 7 22:36:27 CEST 2009


Author: sayer
Date: 2009-05-07 22:36:26 +0200 (Thu, 07 May 2009)
New Revision: 1369

Modified:
   branches/wb/core/AmAudio.cpp
   branches/wb/core/AmAudio.h
   branches/wb/core/AmRtpAudio.cpp
   branches/wb/core/AmRtpAudio.h
Log:
moved getFrameLength() / getFrameSize() to AmRtpAudio where they belong

Modified: branches/wb/core/AmAudio.cpp
===================================================================
--- branches/wb/core/AmAudio.cpp	2009-05-06 23:22:39 UTC (rev 1368)
+++ branches/wb/core/AmAudio.cpp	2009-05-07 20:36:26 UTC (rev 1369)
@@ -308,7 +308,7 @@
     return size;
 
   size = decode(size);
-
+  
   if (size < 0) {
     DBG("decode returned %i\n",size);
     return -1; 
@@ -316,7 +316,7 @@
 
   /* into internal format */
   size = downMix(size);
-    
+
   if(size>0)
     memcpy(buffer,(unsigned char*)samples,size);
 
@@ -434,7 +434,7 @@
     stereo2mono(samples.back_buffer(),(unsigned char*)samples,s);
     samples.swap();
   }
-
+  
 #ifdef USE_LIBSAMPLERATE 
   if (fmt->rate != SYSTEM_SAMPLERATE) {
     s = resample(src_state_in, (double)SYSTEM_SAMPLERATE / (double)fmt->rate, size);
@@ -515,22 +515,6 @@
 }
 #endif
 
-unsigned int AmAudio::getFrameSize()
-{
-  if (!fmt.get())
-    fmt.reset(new AmAudioSimpleFormat(CODEC_PCM16));
-
-  return fmt->frame_size;
-}
-
-unsigned int AmAudio::getFrameLength()
-{
-  if (!fmt.get())
-    fmt.reset(new AmAudioSimpleFormat(CODEC_PCM16));
-
-  return fmt->frame_length;
-}
-
 unsigned int AmAudio::calcBytesToRead(unsigned int nb_samples) const
 {
   return fmt->calcBytesToRead(nb_samples);

Modified: branches/wb/core/AmAudio.h
===================================================================
--- branches/wb/core/AmAudio.h	2009-05-06 23:22:39 UTC (rev 1368)
+++ branches/wb/core/AmAudio.h	2009-05-07 20:36:26 UTC (rev 1369)
@@ -317,12 +317,6 @@
    */
   virtual int put(unsigned int user_ts, unsigned char* buffer, unsigned int size);
   
-  /** get frame length in samples */
-  unsigned int getFrameSize();
-
-  /** get frame length in ms */
-  unsigned int getFrameLength();
-  
   void setRecordTime(unsigned int ms);
   int  incRecordTime(unsigned int samples);
 

Modified: branches/wb/core/AmRtpAudio.cpp
===================================================================
--- branches/wb/core/AmRtpAudio.cpp	2009-05-06 23:22:39 UTC (rev 1368)
+++ branches/wb/core/AmRtpAudio.cpp	2009-05-07 20:36:26 UTC (rev 1369)
@@ -30,6 +30,7 @@
 #include <assert.h>
 #include "AmSession.h"
 #include "AmPlayoutBuffer.h"
+#include "amci/codecs.h"
 
 AmRtpAudio::AmRtpAudio(AmSession* _s)
   : AmRtpStream(_s), AmAudio(0), 
@@ -87,6 +88,23 @@
   return send_int;
 }
 
+unsigned int AmRtpAudio::getFrameSize()
+{
+  if (!fmt.get())
+    fmt.reset(new AmAudioSimpleFormat(CODEC_PCM16));
+
+  return fmt->frame_size;
+}
+
+unsigned int AmRtpAudio::getFrameLength()
+{
+  if (!fmt.get())
+    fmt.reset(new AmAudioSimpleFormat(CODEC_PCM16));
+
+  return fmt->frame_length;
+}
+
+
 unsigned int AmRtpAudio::bytes2samples(unsigned int bytes) const
 {
   return AmAudio::bytes2samples(bytes);

Modified: branches/wb/core/AmRtpAudio.h
===================================================================
--- branches/wb/core/AmRtpAudio.h	2009-05-06 23:22:39 UTC (rev 1368)
+++ branches/wb/core/AmRtpAudio.h	2009-05-07 20:36:26 UTC (rev 1369)
@@ -127,6 +127,12 @@
   // Conceals packet loss into the out_buffer
   // @return length in bytes of the recivered segment
   unsigned int conceal_loss(unsigned int ts_diff, unsigned char *out_buffer);
+
+  /** get frame length in samples */
+  unsigned int getFrameSize();
+
+  /** get frame length in ms */
+  unsigned int getFrameLength();
 };
 
 #endif



More information about the Semsdev mailing list