|
Packit |
1244b8 |
/*
|
|
Packit |
1244b8 |
* Copyright (C) 2014 Intel Corporation. All rights reserved.
|
|
Packit |
1244b8 |
*
|
|
Packit |
1244b8 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
Packit |
1244b8 |
* you may not use this file except in compliance with the License.
|
|
Packit |
1244b8 |
* You may obtain a copy of the License at
|
|
Packit |
1244b8 |
*
|
|
Packit |
1244b8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit |
1244b8 |
*
|
|
Packit |
1244b8 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit |
1244b8 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit |
1244b8 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit |
1244b8 |
* See the License for the specific language governing permissions and
|
|
Packit |
1244b8 |
* limitations under the License.
|
|
Packit |
1244b8 |
*/
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#include <stdint.h>
|
|
Packit |
1244b8 |
#include <stddef.h>
|
|
Packit |
1244b8 |
#if defined(__ENABLE_X11__)
|
|
Packit |
1244b8 |
#include <X11/Xlib.h>
|
|
Packit |
1244b8 |
#endif
|
|
Packit |
1244b8 |
#include "VideoCommonDefs.h"
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#ifndef v4l2_wrapper_h
|
|
Packit |
1244b8 |
#define v4l2_wrapper_h
|
|
Packit |
1244b8 |
#ifndef V4L2_EVENT_RESOLUTION_CHANGE
|
|
Packit |
1244b8 |
#define V4L2_EVENT_RESOLUTION_CHANGE 5
|
|
Packit |
1244b8 |
#endif
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#ifdef __cplusplus
|
|
Packit |
1244b8 |
extern "C" {
|
|
Packit |
1244b8 |
#endif
|
|
Packit |
1244b8 |
int32_t YamiV4L2_Open(const char* name, int32_t flags);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_Close(int32_t fd);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_FrameMemoryType(int32_t fd, VideoDataMemoryType memory_type);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_SvcT(int32_t fd, bool enable);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_Ioctl(int32_t fd, int request, void* arg);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_Poll(int32_t fd, bool poll_device, bool* event_pending);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_SetDevicePollInterrupt(int32_t fd);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_ClearDevicePollInterrupt(int32_t fd);
|
|
Packit |
1244b8 |
void* YamiV4L2_Mmap(void* addr, size_t length,
|
|
Packit |
1244b8 |
int prot, int flags, int fd, unsigned int offset);
|
|
Packit |
1244b8 |
int32_t YamiV4L2_Munmap(void* addr, size_t length);
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#if defined(__ENABLE_WAYLAND__)
|
|
Packit |
1244b8 |
int32_t YamiV4L2_SetWaylandDisplay(int32_t fd, struct wl_display* wlDisplay);
|
|
Packit |
1244b8 |
#endif //__ENABLE_WAYLAND__
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#if defined(__ENABLE_X11__)
|
|
Packit |
1244b8 |
/// it should be called before driver initialization (immediate after _Open()).
|
|
Packit |
1244b8 |
int32_t YamiV4L2_SetXDisplay(int32_t fd, Display* x11Display);
|
|
Packit |
1244b8 |
#endif // defined(__ENABLE_X11__)
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#if defined(__ENABLE_EGL__)
|
|
Packit |
1244b8 |
int32_t YamiV4L2_UseEglImage(int fd, /*EGLDisplay*/ void* eglDisplay, /*EGLContext*/ void* eglContext, unsigned int buffer_index, void* egl_image);
|
|
Packit |
1244b8 |
#endif //__ENABLE_EGL__
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
int32_t YamiV4L2_SetDrmFd(int32_t fd, int drm_fd);
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#ifdef __cplusplus
|
|
Packit |
1244b8 |
} // extern "C"
|
|
Packit |
1244b8 |
#endif
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#endif
|
|
Packit |
1244b8 |
|