OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 void Unlock() { | 114 void Unlock() { |
115 ::LeaveCriticalSection(&buffer_lock_); | 115 ::LeaveCriticalSection(&buffer_lock_); |
116 } | 116 } |
117 | 117 |
118 // VideoRendererInterface implementation | 118 // VideoRendererInterface implementation |
119 virtual void SetSize(int width, int height); | 119 virtual void SetSize(int width, int height); |
120 virtual void RenderFrame(const cricket::VideoFrame* frame); | 120 virtual void RenderFrame(const cricket::VideoFrame* frame); |
121 | 121 |
122 const BITMAPINFO& bmi() const { return bmi_; } | 122 const BITMAPINFO& bmi() const { return bmi_; } |
123 const uint8* image() const { return image_.get(); } | 123 const uint8_t* image() const { return image_.get(); } |
124 | 124 |
125 protected: | 125 protected: |
126 enum { | 126 enum { |
127 SET_SIZE, | 127 SET_SIZE, |
128 RENDER_FRAME, | 128 RENDER_FRAME, |
129 }; | 129 }; |
130 | 130 |
131 HWND wnd_; | 131 HWND wnd_; |
132 BITMAPINFO bmi_; | 132 BITMAPINFO bmi_; |
133 rtc::scoped_ptr<uint8[]> image_; | 133 rtc::scoped_ptr<uint8_t[]> image_; |
134 CRITICAL_SECTION buffer_lock_; | 134 CRITICAL_SECTION buffer_lock_; |
135 rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track_; | 135 rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track_; |
136 }; | 136 }; |
137 | 137 |
138 // A little helper class to make sure we always to proper locking and | 138 // A little helper class to make sure we always to proper locking and |
139 // unlocking when working with VideoRenderer buffers. | 139 // unlocking when working with VideoRenderer buffers. |
140 template <typename T> | 140 template <typename T> |
141 class AutoLock { | 141 class AutoLock { |
142 public: | 142 public: |
143 explicit AutoLock(T* obj) : obj_(obj) { obj_->Lock(); } | 143 explicit AutoLock(T* obj) : obj_(obj) { obj_->Lock(); } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 MainWndCallback* callback_; | 191 MainWndCallback* callback_; |
192 static ATOM wnd_class_; | 192 static ATOM wnd_class_; |
193 std::string server_; | 193 std::string server_; |
194 std::string port_; | 194 std::string port_; |
195 bool auto_connect_; | 195 bool auto_connect_; |
196 bool auto_call_; | 196 bool auto_call_; |
197 }; | 197 }; |
198 #endif // WIN32 | 198 #endif // WIN32 |
199 | 199 |
200 #endif // PEERCONNECTION_SAMPLES_CLIENT_MAIN_WND_H_ | 200 #endif // PEERCONNECTION_SAMPLES_CLIENT_MAIN_WND_H_ |
OLD | NEW |