pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 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 | #ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_ |
| 12 | #define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_ |
| 13 | |
sprang@webrtc.org | fa7c4c4 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 14 | #include <stddef.h> |
| 15 | |
sprang@webrtc.org | 4a9843f | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 16 | #include "webrtc/common_types.h" |
| 17 | |
pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 18 | namespace webrtc { |
| 19 | |
| 20 | class I420VideoFrame; |
| 21 | |
sprang@webrtc.org | 4a9843f | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 22 | struct EncodedFrame { |
| 23 | public: |
| 24 | EncodedFrame() : data_(NULL), length_(0), frame_type_(kFrameEmpty) {} |
| 25 | EncodedFrame(const uint8_t* data, size_t length, FrameType frame_type) |
| 26 | : data_(data), length_(length), frame_type_(frame_type) {} |
| 27 | |
| 28 | const uint8_t* data_; |
| 29 | const size_t length_; |
| 30 | const FrameType frame_type_; |
| 31 | }; |
pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 32 | |
| 33 | class I420FrameCallback { |
| 34 | public: |
| 35 | // This function is called with a I420 frame allowing the user to modify the |
| 36 | // frame content. |
| 37 | virtual void FrameCallback(I420VideoFrame* video_frame) = 0; |
| 38 | |
| 39 | protected: |
| 40 | virtual ~I420FrameCallback() {} |
| 41 | }; |
| 42 | |
| 43 | class EncodedFrameObserver { |
| 44 | public: |
| 45 | virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) = 0; |
| 46 | |
| 47 | protected: |
| 48 | virtual ~EncodedFrameObserver() {} |
| 49 | }; |
sprang@webrtc.org | 4a9843f | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 50 | |
pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 51 | } // namespace webrtc |
| 52 | |
| 53 | #endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_ |