Bug 1221587: temporary Win32 build fixes for cubeb full-duplex patch rs=padenot
☠☠ backed out by a813dc549ac4 ☠ ☠
authorRandell Jesup <rjesup@wgate.com>
Thu, 21 Jan 2016 11:51:36 -0500
changeset 281071 d31752600dfddce31159900519b6e91d21588664
parent 281070 919961c56977926525bfbd388885b6783fa744e1
child 281072 ff326b0cc099a8377790c8d1c0a4be9c5735d504
push id29930
push usercbook@mozilla.com
push dateFri, 22 Jan 2016 11:05:50 +0000
treeherdermozilla-central@7104d650a97d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1221587
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1221587: temporary Win32 build fixes for cubeb full-duplex patch rs=padenot To be backed out/overwritten on next merge from upstream libcubeb
media/libcubeb/src/cubeb_resampler.cpp
media/libcubeb/src/cubeb_resampler.h
--- a/media/libcubeb/src/cubeb_resampler.cpp
+++ b/media/libcubeb/src/cubeb_resampler.cpp
@@ -64,34 +64,34 @@ to_speex_quality(cubeb_resampler_quality
   default:
     assert(false);
     return 0XFFFFFFFF;
   }
 }
 } // end of anonymous namespace
 
 struct cubeb_resampler {
-  virtual long fill(void * buffer, long frames_needed) = 0;
+  virtual long fill(void * input_buffer, void * buffer, long frames_needed) = 0;
   virtual ~cubeb_resampler() {}
 };
 
 class noop_resampler : public cubeb_resampler {
 public:
   noop_resampler(cubeb_stream * s,
                  cubeb_data_callback cb,
                  void * ptr)
     : stream(s)
     , data_callback(cb)
     , user_ptr(ptr)
   {
   }
 
-  virtual long fill(void * buffer, long frames_needed)
+  virtual long fill(void * input_buffer, void * buffer, long frames_needed)
   {
-    long got = data_callback(stream, user_ptr, buffer, frames_needed);
+    long got = data_callback(stream, user_ptr, input_buffer, buffer, frames_needed);
     assert(got <= frames_needed);
     return got;
   }
 
 private:
   cubeb_stream * const stream;
   const cubeb_data_callback data_callback;
   void * const user_ptr;
@@ -101,17 +101,17 @@ class cubeb_resampler_speex : public cub
 public:
   cubeb_resampler_speex(SpeexResamplerState * r, cubeb_stream * s,
                         cubeb_stream_params params, uint32_t out_rate,
                         cubeb_data_callback cb, long max_count,
                         void * ptr);
 
   virtual ~cubeb_resampler_speex();
 
-  virtual long fill(void * buffer, long frames_needed);
+  virtual long fill(void * input_buffer, void * buffer, long frames_needed);
 
 private:
   SpeexResamplerState * const speex_resampler;
   cubeb_stream * const stream;
   const cubeb_stream_params stream_params;
   const cubeb_data_callback data_callback;
   void * const user_ptr;
 
@@ -156,31 +156,31 @@ cubeb_resampler_speex::cubeb_resampler_s
 }
 
 cubeb_resampler_speex::~cubeb_resampler_speex()
 {
   speex_resampler_destroy(speex_resampler);
 }
 
 long
-cubeb_resampler_speex::fill(void * buffer, long frames_needed)
+cubeb_resampler_speex::fill(void * input_buffer, void * buffer, long frames_needed)
 {
   // Use more input frames than strictly necessary, so in the worst case,
   // we have leftover unresampled frames at the end, that we can use
   // during the next iteration.
   assert(frames_needed <= buffer_frame_count);
   long before_resampling = frame_count_at_rate(frames_needed, resampling_ratio);
   long frames_requested = before_resampling - leftover_frame_count;
 
   // Copy the previous leftover frames to the front of the buffer.
   size_t leftover_bytes = frames_to_bytes(stream_params, leftover_frame_count);
   memcpy(resampling_src_buffer.get(), leftover_frames_buffer.get(), leftover_bytes);
   uint8_t * buffer_start = resampling_src_buffer.get() + leftover_bytes;
 
-  long got = data_callback(stream, user_ptr, buffer_start, frames_requested);
+  long got = data_callback(stream, user_ptr, input_buffer, buffer_start, frames_requested);
   assert(got <= frames_requested);
 
   if (got < 0) {
     return CUBEB_ERROR;
   }
 
   uint32_t in_frames = leftover_frame_count + got;
   uint32_t out_frames = frames_needed;
@@ -234,18 +234,19 @@ cubeb_resampler_create(cubeb_stream * st
                                      callback, buffer_frame_count, user_ptr);
   }
 
   return new noop_resampler(stream, callback, user_ptr);
 }
 
 long
 cubeb_resampler_fill(cubeb_resampler * resampler,
-                     void * buffer, long frames_needed)
+                     void * input_buffer, void * buffer,
+		     long frames_needed)
 {
-  return resampler->fill(buffer, frames_needed);
+  return resampler->fill(input_buffer, buffer, frames_needed);
 }
 
 void
 cubeb_resampler_destroy(cubeb_resampler * resampler)
 {
   delete resampler;
 }
--- a/media/libcubeb/src/cubeb_resampler.h
+++ b/media/libcubeb/src/cubeb_resampler.h
@@ -48,17 +48,18 @@ cubeb_resampler * cubeb_resampler_create
  * happen if necessary.
  * @param resampler A cubeb_resampler instance.
  * @param buffer The buffer to be filled.
  * @param frames_needed Number of frames that should be produced.
  * @retval Number of frames that are actually produced.
  * @retval CUBEB_ERROR on error.
  */
 long cubeb_resampler_fill(cubeb_resampler * resampler,
-                          void * buffer, long frames_needed);
+                          void * input_buffer, void * buffer,
+			  long frames_needed);
 
 /**
  * Destroy a cubeb_resampler.
  * @param resampler A cubeb_resampler instance.
  */
 void cubeb_resampler_destroy(cubeb_resampler * resampler);
 
 #if defined(__cplusplus)