| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_FRAME_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_FRAME_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_FRAME_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_FRAME_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
| 12 #include "third_party/webrtc/common_video/include/video_frame_buffer.h" | 12 #include "third_party/webrtc/api/video/video_frame_buffer.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 // Thin adapter from media::VideoFrame to webrtc::VideoFrameBuffer. This | 15 // Thin adapter from media::VideoFrame to webrtc::VideoFrameBuffer. This |
| 16 // implementation is read-only and will return null if trying to get a | 16 // implementation is read-only and will return null if trying to get a |
| 17 // non-const pointer to the pixel data. This object will be accessed from | 17 // non-const pointer to the pixel data. This object will be accessed from |
| 18 // different threads, but that's safe since it's read-only. | 18 // different threads, but that's safe since it's read-only. |
| 19 class WebRtcVideoFrameAdapter : public webrtc::VideoFrameBuffer { | 19 class WebRtcVideoFrameAdapter : public webrtc::VideoFrameBuffer { |
| 20 public: | 20 public: |
| 21 using CopyTextureFrameCallback = | 21 using CopyTextureFrameCallback = |
| 22 base::Callback<void(const scoped_refptr<media::VideoFrame>&, | 22 base::Callback<void(const scoped_refptr<media::VideoFrame>&, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 47 protected: | 47 protected: |
| 48 ~WebRtcVideoFrameAdapter() override; | 48 ~WebRtcVideoFrameAdapter() override; |
| 49 | 49 |
| 50 scoped_refptr<media::VideoFrame> frame_; | 50 scoped_refptr<media::VideoFrame> frame_; |
| 51 const CopyTextureFrameCallback copy_texture_callback_; | 51 const CopyTextureFrameCallback copy_texture_callback_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace content | 54 } // namespace content |
| 55 | 55 |
| 56 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_FRAME_ADAPTER_H_ | 56 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_FRAME_ADAPTER_H_ |
| OLD | NEW |