Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_FRAME_CALLBACK_H_ | 11 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_FRAME_CALLBACK_H_ |
| 12 #define WEBRTC_COMMON_VIDEO_INCLUDE_FRAME_CALLBACK_H_ | 12 #define WEBRTC_COMMON_VIDEO_INCLUDE_FRAME_CALLBACK_H_ |
| 13 | 13 |
| 14 #include <stddef.h> | 14 #include <stddef.h> |
| 15 #include <stdint.h> | 15 #include <stdint.h> |
| 16 | 16 |
| 17 #include "webrtc/common_types.h" | 17 #include "webrtc/common_types.h" |
| 18 | 18 |
| 19 namespace webrtc { | 19 namespace webrtc { |
| 20 | 20 |
| 21 class VideoFrame; | 21 class VideoFrame; |
| 22 | 22 |
| 23 struct EncodedFrame { | 23 struct EncodedFrame { |
| 24 public: | 24 public: |
| 25 EncodedFrame() : data_(NULL), length_(0), frame_type_(kEmptyFrame) {} | 25 EncodedFrame() : data_(NULL), length_(0), frame_type_(kEmptyFrame), |
|
sprang_webrtc
2017/02/01 14:50:19
nit: nullptr
ilnik
2017/02/01 15:12:50
Done.
| |
| 26 EncodedFrame(const uint8_t* data, size_t length, FrameType frame_type) | 26 encoded_width_(0), encoded_height_(0), timestamp_(0) {} |
| 27 : data_(data), length_(length), frame_type_(frame_type) {} | 27 EncodedFrame(const uint8_t* data, size_t length, FrameType frame_type, |
| 28 uint32_t encoded_width, uint32_t encoded_height, | |
| 29 uint32_t timestamp) | |
| 30 : data_(data), length_(length), frame_type_(frame_type), | |
| 31 encoded_width_(encoded_width), encoded_height_(encoded_height), | |
| 32 timestamp_(timestamp) { } | |
| 28 | 33 |
| 29 const uint8_t* data_; | 34 const uint8_t* data_; |
| 30 const size_t length_; | 35 const size_t length_; |
| 31 const FrameType frame_type_; | 36 const FrameType frame_type_; |
| 37 const uint32_t encoded_width_; | |
| 38 const uint32_t encoded_height_; | |
| 39 const int32_t timestamp_; | |
|
sprang_webrtc
2017/02/01 14:50:19
Hm, constructor parameter is unsigned but member i
ilnik
2017/02/01 15:12:50
Done.
| |
| 32 }; | 40 }; |
| 33 | 41 |
| 34 class I420FrameCallback { | 42 class I420FrameCallback { |
| 35 public: | 43 public: |
| 36 // This function is called with a I420 frame allowing the user to modify the | 44 // This function is called with a I420 frame allowing the user to modify the |
| 37 // frame content. | 45 // frame content. |
| 38 virtual void FrameCallback(VideoFrame* video_frame) = 0; | 46 virtual void FrameCallback(VideoFrame* video_frame) = 0; |
| 39 | 47 |
| 40 protected: | 48 protected: |
| 41 virtual ~I420FrameCallback() {} | 49 virtual ~I420FrameCallback() {} |
| 42 }; | 50 }; |
| 43 | 51 |
| 44 class EncodedFrameObserver { | 52 class EncodedFrameObserver { |
| 45 public: | 53 public: |
| 46 virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) = 0; | 54 virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) = 0; |
| 47 virtual void OnEncodeTiming(int64_t capture_ntp_ms, int encode_duration_ms) {} | 55 virtual void OnEncodeTiming(int64_t capture_ntp_ms, int encode_duration_ms) {} |
| 48 | 56 |
| 49 protected: | 57 protected: |
| 50 virtual ~EncodedFrameObserver() {} | 58 virtual ~EncodedFrameObserver() {} |
| 51 }; | 59 }; |
| 52 | 60 |
| 53 } // namespace webrtc | 61 } // namespace webrtc |
| 54 | 62 |
| 55 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_FRAME_CALLBACK_H_ | 63 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_FRAME_CALLBACK_H_ |
| OLD | NEW |