OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2012 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_VOICE_ENGINE_FILE_PLAYER_IMPL_H_ | |
12 #define WEBRTC_VOICE_ENGINE_FILE_PLAYER_IMPL_H_ | |
13 | |
14 #include "webrtc/common_audio/resampler/include/resampler.h" | |
15 #include "webrtc/common_types.h" | |
16 #include "webrtc/engine_configurations.h" | |
17 #include "webrtc/modules/media_file/media_file.h" | |
18 #include "webrtc/modules/media_file/media_file_defines.h" | |
19 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
20 #include "webrtc/typedefs.h" | |
21 #include "webrtc/voice_engine/coder.h" | |
22 #include "webrtc/voice_engine/file_player.h" | |
23 | |
24 namespace webrtc { | |
25 class FilePlayerImpl : public FilePlayer | |
26 { | |
27 public: | |
28 FilePlayerImpl(uint32_t instanceID, FileFormats fileFormat); | |
29 ~FilePlayerImpl(); | |
30 | |
31 virtual int Get10msAudioFromFile( | |
32 int16_t* outBuffer, | |
33 size_t& lengthInSamples, | |
34 int frequencyInHz); | |
35 virtual int32_t RegisterModuleFileCallback(FileCallback* callback); | |
36 virtual int32_t StartPlayingFile( | |
37 const char* fileName, | |
38 bool loop, | |
39 uint32_t startPosition, | |
40 float volumeScaling, | |
41 uint32_t notification, | |
42 uint32_t stopPosition = 0, | |
43 const CodecInst* codecInst = NULL); | |
44 virtual int32_t StartPlayingFile( | |
45 InStream& sourceStream, | |
46 uint32_t startPosition, | |
47 float volumeScaling, | |
48 uint32_t notification, | |
49 uint32_t stopPosition = 0, | |
50 const CodecInst* codecInst = NULL); | |
51 virtual int32_t StopPlayingFile(); | |
52 virtual bool IsPlayingFile() const; | |
53 virtual int32_t GetPlayoutPosition(uint32_t& durationMs); | |
54 virtual int32_t AudioCodec(CodecInst& audioCodec) const; | |
55 virtual int32_t Frequency() const; | |
56 virtual int32_t SetAudioScaling(float scaleFactor); | |
57 | |
58 protected: | |
59 int32_t SetUpAudioDecoder(); | |
60 | |
61 uint32_t _instanceID; | |
62 const FileFormats _fileFormat; | |
63 MediaFile& _fileModule; | |
64 | |
65 uint32_t _decodedLengthInMS; | |
66 | |
67 private: | |
68 AudioCoder _audioDecoder; | |
69 | |
70 CodecInst _codec; | |
71 int32_t _numberOf10MsPerFrame; | |
72 int32_t _numberOf10MsInDecoder; | |
73 | |
74 Resampler _resampler; | |
75 float _scaling; | |
76 }; | |
77 } // namespace webrtc | |
78 | |
79 #endif // WEBRTC_VOICE_ENGINE_FILE_PLAYER_IMPL_H_ | |
OLD | NEW |