OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2013 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 #include "webrtc/video/encoded_frame_callback_adapter.h" | |
12 | |
13 #include "webrtc/base/checks.h" | |
14 #include "webrtc/modules/video_coding/encoded_frame.h" | |
15 | |
16 namespace webrtc { | |
17 namespace internal { | |
18 | |
19 EncodedFrameCallbackAdapter::EncodedFrameCallbackAdapter( | |
20 EncodedFrameObserver* observer) : observer_(observer) { | |
21 } | |
22 | |
23 EncodedFrameCallbackAdapter::~EncodedFrameCallbackAdapter() {} | |
24 | |
25 int32_t EncodedFrameCallbackAdapter::Encoded( | |
26 const EncodedImage& encodedImage, | |
27 const CodecSpecificInfo* codecSpecificInfo, | |
28 const RTPFragmentationHeader* fragmentation) { | |
29 if (!observer_) | |
30 return 0; | |
31 const EncodedFrame frame(encodedImage._buffer, encodedImage._length, | |
32 encodedImage._frameType); | |
33 | |
34 observer_->EncodedFrameCallback(frame); | |
35 return 0; | |
36 } | |
37 | |
38 } // namespace internal | |
39 } // namespace webrtc | |
OLD | NEW |