Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.h

Issue 2387113005: Drop _oldapi from ACM test file names (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_SEND_TEST_OLDAPI_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_SEND_TEST_OLDAPI_H_
13
14 #include <memory>
15 #include <vector>
16
17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
19 #include "webrtc/modules/audio_coding/neteq/tools/packet_source.h"
20 #include "webrtc/system_wrappers/include/clock.h"
21
22 namespace webrtc {
23 class AudioEncoder;
24
25 namespace test {
26 class InputAudioFile;
27 class Packet;
28
29 class AcmSendTestOldApi : public AudioPacketizationCallback,
30 public PacketSource {
31 public:
32 AcmSendTestOldApi(InputAudioFile* audio_source,
33 int source_rate_hz,
34 int test_duration_ms);
35 ~AcmSendTestOldApi() override;
36
37 // Registers the send codec. Returns true on success, false otherwise.
38 bool RegisterCodec(const char* payload_name,
39 int sampling_freq_hz,
40 int channels,
41 int payload_type,
42 int frame_size_samples);
43
44 // Registers an external send codec. Returns true on success, false otherwise.
45 bool RegisterExternalCodec(AudioEncoder* external_speech_encoder);
46
47 // Inherited from PacketSource.
48 std::unique_ptr<Packet> NextPacket() override;
49
50 // Inherited from AudioPacketizationCallback.
51 int32_t SendData(FrameType frame_type,
52 uint8_t payload_type,
53 uint32_t timestamp,
54 const uint8_t* payload_data,
55 size_t payload_len_bytes,
56 const RTPFragmentationHeader* fragmentation) override;
57
58 AudioCodingModule* acm() { return acm_.get(); }
59
60 private:
61 static const int kBlockSizeMs = 10;
62
63 // Creates a Packet object from the last packet produced by ACM (and received
64 // through the SendData method as a callback).
65 std::unique_ptr<Packet> CreatePacket();
66
67 SimulatedClock clock_;
68 std::unique_ptr<AudioCodingModule> acm_;
69 InputAudioFile* audio_source_;
70 int source_rate_hz_;
71 const size_t input_block_size_samples_;
72 AudioFrame input_frame_;
73 bool codec_registered_;
74 int test_duration_ms_;
75 // The following member variables are set whenever SendData() is called.
76 FrameType frame_type_;
77 int payload_type_;
78 uint32_t timestamp_;
79 uint16_t sequence_number_;
80 std::vector<uint8_t> last_payload_vec_;
81 bool data_to_send_;
82
83 RTC_DISALLOW_COPY_AND_ASSIGN(AcmSendTestOldApi);
84 };
85
86 } // namespace test
87 } // namespace webrtc
88 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_SEND_TEST_OLDAPI_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/acm2/acm_send_test.cc ('k') | webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698