blob: 7ee6684a9eb31c0579bb085dc4ba8e197337c4b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SOURCE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SOURCE_H_
#include "base/threading/thread_checker.h"
#include "third_party/blink/renderer/core/streams/underlying_source_base.h"
#include "third_party/blink/renderer/modules/modules_export.h"
namespace webrtc {
class TransformableFrameInterface;
} // namespace webrtc
namespace blink {
class MODULES_EXPORT RTCEncodedAudioUnderlyingSource
: public UnderlyingSourceBase {
public:
explicit RTCEncodedAudioUnderlyingSource(
ScriptState*,
base::OnceClosure disconnect_callback,
bool is_receiver);
// UnderlyingSourceBase
ScriptPromise pull(ScriptState*) override;
ScriptPromise Cancel(ScriptState*, ScriptValue reason) override;
void OnFrameFromSource(std::unique_ptr<webrtc::TransformableFrameInterface>);
void Close();
void Trace(Visitor*) override;
private:
FRIEND_TEST_ALL_PREFIXES(RTCEncodedAudioUnderlyingSourceTest,
QueuedFramesAreDroppedWhenOverflow);
static const int kMinQueueDesiredSize;
const Member<ScriptState> script_state_;
base::OnceClosure disconnect_callback_;
// Indicates if this source is for a receiver. Receiver sources
// expose CSRCs.
const bool is_receiver_;
THREAD_CHECKER(thread_checker_);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SOURCE_H_
|