• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/modules/video_coding/main/source/encoded_frame.h"
14 
15 namespace webrtc {
16 namespace internal {
17 
EncodedFrameCallbackAdapter(EncodedFrameObserver * observer)18 EncodedFrameCallbackAdapter::EncodedFrameCallbackAdapter(
19     EncodedFrameObserver* observer) : observer_(observer) {
20 }
21 
~EncodedFrameCallbackAdapter()22 EncodedFrameCallbackAdapter::~EncodedFrameCallbackAdapter() {}
23 
Encoded(EncodedImage & encodedImage,const CodecSpecificInfo * codecSpecificInfo,const RTPFragmentationHeader * fragmentation)24 int32_t EncodedFrameCallbackAdapter::Encoded(
25     EncodedImage& encodedImage,
26     const CodecSpecificInfo* codecSpecificInfo,
27     const RTPFragmentationHeader* fragmentation) {
28   assert(observer_ != NULL);
29   FrameType frame_type =
30         VCMEncodedFrame::ConvertFrameType(encodedImage._frameType);
31   const EncodedFrame frame(encodedImage._buffer,
32                            encodedImage._length,
33                            frame_type);
34   observer_->EncodedFrameCallback(frame);
35   return 0;
36 }
37 
38 }  // namespace internal
39 }  // namespace webrtc
40