diff --git a/src/common_audio/vad/include/webrtc_vad.h b/src/common_audio/vad/include/webrtc_vad.h index 07e5cdda4..860c7364d 100644 --- a/src/common_audio/vad/include/webrtc_vad.h +++ b/src/common_audio/vad/include/webrtc_vad.h @@ -26,23 +26,6 @@ typedef struct WebRtcVadInst VadInst; extern "C" { #endif -// TODO(bjornv): Investigate if we need the Assign calls below at all. - -// Gets the size needed for storing the instance for the VAD. -// -// returns : The size in bytes needed to allocate memory for the VAD instance. -size_t WebRtcVad_AssignSize(); - -// Assigns memory for the instances at a given address. It is assumed that the -// memory for the VAD instance is allocated at |memory| in accordance with -// WebRtcVad_AssignSize(). -// -// - memory [i] : Address to where the memory is assigned. -// - handle [o] : Pointer to the instance that should be created. -// -// returns : 0 - (OK), -1 (NULL pointer in) -int WebRtcVad_Assign(void* memory, VadInst** handle); - // Creates an instance to the VAD structure. // // - handle [o] : Pointer to the VAD instance that should be created. diff --git a/src/common_audio/vad/vad_unittest.cc b/src/common_audio/vad/vad_unittest.cc index cf82f8014..ffd24277e 100644 --- a/src/common_audio/vad/vad_unittest.cc +++ b/src/common_audio/vad/vad_unittest.cc @@ -65,23 +65,10 @@ TEST_F(VadTest, ApiTest) { // NULL instance tests EXPECT_EQ(-1, WebRtcVad_Create(NULL)); EXPECT_EQ(-1, WebRtcVad_Init(NULL)); - EXPECT_EQ(-1, WebRtcVad_Assign(NULL, NULL)); EXPECT_EQ(-1, WebRtcVad_Free(NULL)); EXPECT_EQ(-1, WebRtcVad_set_mode(NULL, kModes[0])); EXPECT_EQ(-1, WebRtcVad_Process(NULL, kRates[0], speech, kFrameLengths[0])); - // WebRtcVad_AssignSize() test. - size_t handle_size_bytes = WebRtcVad_AssignSize(); - EXPECT_EQ(576u, handle_size_bytes); - - // WebRtcVad_Assign() tests. - void* tmp_handle = malloc(handle_size_bytes); - EXPECT_EQ(-1, WebRtcVad_Assign(NULL, &handle)); - EXPECT_EQ(-1, WebRtcVad_Assign(tmp_handle, NULL)); - EXPECT_EQ(0, WebRtcVad_Assign(tmp_handle, &handle)); - EXPECT_EQ(handle, tmp_handle); - free(tmp_handle); - // WebRtcVad_Create() ASSERT_EQ(0, WebRtcVad_Create(&handle)); diff --git a/src/common_audio/vad/webrtc_vad.c b/src/common_audio/vad/webrtc_vad.c index 40ada95e1..087341892 100644 --- a/src/common_audio/vad/webrtc_vad.c +++ b/src/common_audio/vad/webrtc_vad.c @@ -16,19 +16,6 @@ static const int kInitCheck = 42; -size_t WebRtcVad_AssignSize() { - return sizeof(VadInstT); -} - -int WebRtcVad_Assign(void* memory, VadInst** handle) { - if (handle == NULL || memory == NULL) { - return -1; - } - - *handle = (VadInst*) memory; - return 0; -} - int WebRtcVad_Create(VadInst** handle) { VadInstT* self = NULL;