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