2013-06-04 18:51:23 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_DESKTOP_CAPTURE_SCOPED_PIXEL_BUFFER_OBJECT_H_
|
|
|
|
|
#define MODULES_DESKTOP_CAPTURE_SCOPED_PIXEL_BUFFER_OBJECT_H_
|
2013-06-04 18:51:23 +00:00
|
|
|
|
|
|
|
|
#include <OpenGL/CGLMacro.h>
|
|
|
|
|
#include <OpenGL/OpenGL.h>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/constructormagic.h"
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "typedefs.h" // NOLINT(build/include)
|
2013-06-04 18:51:23 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
class ScopedPixelBufferObject {
|
|
|
|
|
public:
|
|
|
|
|
ScopedPixelBufferObject();
|
|
|
|
|
~ScopedPixelBufferObject();
|
|
|
|
|
|
|
|
|
|
bool Init(CGLContextObj cgl_context, int size_in_bytes);
|
|
|
|
|
void Release();
|
|
|
|
|
|
|
|
|
|
GLuint get() const { return pixel_buffer_object_; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
CGLContextObj cgl_context_;
|
|
|
|
|
GLuint pixel_buffer_object_;
|
|
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(ScopedPixelBufferObject);
|
2013-06-04 18:51:23 +00:00
|
|
|
};
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2013-06-04 18:51:23 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_DESKTOP_CAPTURE_SCOPED_PIXEL_BUFFER_OBJECT_H_
|