blob: f5eca7ce449ae812fd2a517a7ab8fbf4679554cb [file] [log] [blame]
sprang@webrtc.org2e98d452013-11-26 11:41:59 +00001/*
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
15namespace webrtc {
16namespace internal {
17
18EncodedFrameCallbackAdapter::EncodedFrameCallbackAdapter(
19 EncodedFrameObserver* observer) : observer_(observer) {
20}
21
22EncodedFrameCallbackAdapter::~EncodedFrameCallbackAdapter() {}
23
24int32_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