| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 struct CapturedFrame; | 40 struct CapturedFrame; |
| 41 | 41 |
| 42 class WebRtcVideoFrame : public VideoFrame { | 42 class WebRtcVideoFrame : public VideoFrame { |
| 43 public: | 43 public: |
| 44 WebRtcVideoFrame(); | 44 WebRtcVideoFrame(); |
| 45 WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, | 45 WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
| 46 int64_t time_stamp_ns, | 46 int64_t time_stamp_ns, |
| 47 webrtc::VideoRotation rotation); | 47 webrtc::VideoRotation rotation); |
| 48 | 48 |
| 49 // TODO(guoweis): Remove this when chrome code base is updated. | |
| 50 WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, | |
| 51 int64_t elapsed_time_ns, | |
| 52 int64_t time_stamp_ns); | |
| 53 | |
| 54 ~WebRtcVideoFrame(); | 49 ~WebRtcVideoFrame(); |
| 55 | 50 |
| 56 // Creates a frame from a raw sample with FourCC "format" and size "w" x "h". | 51 // Creates a frame from a raw sample with FourCC "format" and size "w" x "h". |
| 57 // "h" can be negative indicating a vertically flipped image. | 52 // "h" can be negative indicating a vertically flipped image. |
| 58 // "dh" is destination height if cropping is desired and is always positive. | 53 // "dh" is destination height if cropping is desired and is always positive. |
| 59 // Returns "true" if successful. | 54 // Returns "true" if successful. |
| 60 bool Init(uint32_t format, | 55 bool Init(uint32_t format, |
| 61 int w, | 56 int w, |
| 62 int h, | 57 int h, |
| 63 int dw, | 58 int dw, |
| 64 int dh, | 59 int dh, |
| 65 uint8_t* sample, | 60 uint8_t* sample, |
| 66 size_t sample_size, | 61 size_t sample_size, |
| 67 size_t pixel_width, | 62 size_t pixel_width, |
| 68 size_t pixel_height, | 63 size_t pixel_height, |
| 69 int64_t time_stamp_ns, | 64 int64_t time_stamp_ns, |
| 70 webrtc::VideoRotation rotation); | 65 webrtc::VideoRotation rotation); |
| 71 | 66 |
| 72 bool Init(const CapturedFrame* frame, int dw, int dh, bool apply_rotation); | 67 bool Init(const CapturedFrame* frame, int dw, int dh, bool apply_rotation); |
| 73 | 68 |
| 74 void InitToEmptyBuffer(int w, int h, size_t pixel_width, size_t pixel_height, | 69 void InitToEmptyBuffer(int w, int h, size_t pixel_width, size_t pixel_height, |
| 75 int64_t time_stamp_ns); | 70 int64_t time_stamp_ns); |
| 76 | 71 |
| 77 // TODO(magjed): Remove once Chromium is updated. | |
| 78 bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height, | |
| 79 int64_t elapsed_time_ns, int64_t time_stamp_ns); | |
| 80 | |
| 81 bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height, | 72 bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height, |
| 82 int64_t time_stamp_ns) override; | 73 int64_t time_stamp_ns) override; |
| 83 | 74 |
| 84 // From base class VideoFrame. | 75 // From base class VideoFrame. |
| 85 bool Reset(uint32_t format, | 76 bool Reset(uint32_t format, |
| 86 int w, | 77 int w, |
| 87 int h, | 78 int h, |
| 88 int dw, | 79 int dw, |
| 89 int dh, | 80 int dh, |
| 90 uint8_t* sample, | 81 uint8_t* sample, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 webrtc::VideoRotation rotation_; | 140 webrtc::VideoRotation rotation_; |
| 150 | 141 |
| 151 // This is mutable as the calculation is expensive but once calculated, it | 142 // This is mutable as the calculation is expensive but once calculated, it |
| 152 // remains const. | 143 // remains const. |
| 153 mutable rtc::scoped_ptr<VideoFrame> rotated_frame_; | 144 mutable rtc::scoped_ptr<VideoFrame> rotated_frame_; |
| 154 }; | 145 }; |
| 155 | 146 |
| 156 } // namespace cricket | 147 } // namespace cricket |
| 157 | 148 |
| 158 #endif // TALK_MEDIA_WEBRTCVIDEOFRAME_H_ | 149 #endif // TALK_MEDIA_WEBRTCVIDEOFRAME_H_ |
| OLD | NEW |