1 | /* |
2 | * Copyright (C) 2017 Igalia S.L. All rights reserved. |
3 | * Copyright (C) 2017 Apple Inc. All rights reserved. |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted, provided that the following conditions |
7 | * are required to be met: |
8 | * |
9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
14 | * |
15 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS" AND ANY |
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
18 | * DISCLAIMED. IN NO EVENT SHALL APPLE INC. AND ITS CONTRIBUTORS BE LIABLE FOR |
19 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
22 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | */ |
26 | |
27 | #pragma once |
28 | |
29 | #if USE(LIBWEBRTC) && USE(GSTREAMER) |
30 | |
31 | #include "RealtimeOutgoingVideoSource.h" |
32 | |
33 | namespace WebCore { |
34 | |
35 | class RealtimeOutgoingVideoSourceLibWebRTC final : public RealtimeOutgoingVideoSource { |
36 | public: |
37 | static Ref<RealtimeOutgoingVideoSourceLibWebRTC> create(Ref<MediaStreamTrackPrivate>&&); |
38 | |
39 | private: |
40 | explicit RealtimeOutgoingVideoSourceLibWebRTC(Ref<MediaStreamTrackPrivate>&&); |
41 | |
42 | rtc::scoped_refptr<webrtc::VideoFrameBuffer> createBlackFrame(size_t, size_t) final; |
43 | |
44 | // MediaStreamTrackPrivate::Observer API |
45 | void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final; |
46 | }; |
47 | |
48 | } // namespace WebCore |
49 | |
50 | #endif // USE(LIBWEBRTC) |
51 | |
52 | |