mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 22:23:56 +08:00
loggerd: switch to v4l encoder try 2 (#24380)
* start v4l encoder * v4l encoder starts * start and stop * fill in proper controls * it dequeued a buffer * getting bytes * it made a video * it does make files * getting close * ahh, so that's how dequeue works * qcam works (no remuxing) * remuxing works * we just need to make shutdown and rollover graceful * graceful destruction * switch to polling * should work now * fix pc build * refactors, stop properly * touchups, remove a copy * add v4l encoder to release * inlcude file * move writing to it's own thread * fix minor memory leak * block instead of dropping frames * add counter, fix tests maybe * better debugging and test print * print file path in assert * format string in test * no more oversized qlogs * match qcam * touchups, remove omx encoder * remove omx include files * checked ioctl, better debugging, open by name * unused import * move linux includes to third_party/linux/include * simple encoderd * full packet * encoderd should be complete * lagging print * updates * name dq thread * subset idx * video file writing works * debug * potential bugfix * rotation works * iframe * keep writing support * ci should pass * loggerd, not encoderd * remote encoder code * support remote encoder * cereal to master, add encoderd * header no longer required * put that back there * realtime * lower decoder latency * don't use queue for VisionIpcBufExtra, disable realtime again * assert all written * hmm simpler * only push to to_write if we are writing * assert timestamp is right * use at and remove assert * revert to queue Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -184,7 +184,6 @@ env = Environment(
|
||||
"#third_party/acados/include/hpipm/include",
|
||||
"#third_party/catch2/include",
|
||||
"#third_party/libyuv/include",
|
||||
"#third_party/openmax/include",
|
||||
"#third_party/json11",
|
||||
"#third_party/curl/include",
|
||||
"#third_party/libgralloc/include",
|
||||
|
||||
2
cereal
2
cereal
Submodule cereal updated: a057aed167...aea23111ee
@@ -299,19 +299,21 @@ selfdrive/proclogd/proclog.h
|
||||
|
||||
selfdrive/loggerd/SConscript
|
||||
selfdrive/loggerd/encoder.h
|
||||
selfdrive/loggerd/omx_encoder.cc
|
||||
selfdrive/loggerd/omx_encoder.h
|
||||
selfdrive/loggerd/v4l_encoder.cc
|
||||
selfdrive/loggerd/v4l_encoder.h
|
||||
selfdrive/loggerd/video_writer.cc
|
||||
selfdrive/loggerd/video_writer.h
|
||||
selfdrive/loggerd/remote_encoder.cc
|
||||
selfdrive/loggerd/remote_encoder.h
|
||||
selfdrive/loggerd/logger.cc
|
||||
selfdrive/loggerd/logger.h
|
||||
selfdrive/loggerd/loggerd.cc
|
||||
selfdrive/loggerd/loggerd.h
|
||||
selfdrive/loggerd/encoderd.cc
|
||||
selfdrive/loggerd/main.cc
|
||||
selfdrive/loggerd/bootlog.cc
|
||||
selfdrive/loggerd/raw_logger.cc
|
||||
selfdrive/loggerd/raw_logger.h
|
||||
selfdrive/loggerd/include/msm_media_info.h
|
||||
|
||||
selfdrive/loggerd/__init__.py
|
||||
selfdrive/loggerd/config.py
|
||||
@@ -444,7 +446,6 @@ third_party/SConscript
|
||||
|
||||
third_party/linux/**
|
||||
third_party/opencl/**
|
||||
third_party/openmax/**
|
||||
|
||||
third_party/json11/json11.cpp
|
||||
third_party/json11/json11.hpp
|
||||
|
||||
1
selfdrive/loggerd/.gitignore
vendored
1
selfdrive/loggerd/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
loggerd
|
||||
encoderd
|
||||
tests/test_logger
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
Import('env', 'arch', 'cereal', 'messaging', 'common', 'visionipc', 'gpucommon')
|
||||
|
||||
Import('env', 'arch', 'cereal', 'messaging', 'common', 'visionipc')
|
||||
|
||||
libs = [common, cereal, messaging, visionipc,
|
||||
'zmq', 'capnp', 'kj', 'z',
|
||||
'avformat', 'avcodec', 'swscale', 'avutil',
|
||||
'yuv', 'bz2', 'OpenCL', 'pthread']
|
||||
|
||||
src = ['logger.cc', 'loggerd.cc', 'video_writer.cc']
|
||||
src = ['logger.cc', 'loggerd.cc', 'video_writer.cc', 'remote_encoder.cc']
|
||||
if arch == "larch64":
|
||||
src += ['omx_encoder.cc']
|
||||
libs += ['OmxCore', 'gsl', 'CB'] + gpucommon
|
||||
src += ['v4l_encoder.cc']
|
||||
else:
|
||||
src += ['raw_logger.cc']
|
||||
|
||||
@@ -22,6 +20,8 @@ logger_lib = env.Library('logger', src)
|
||||
libs.insert(0, logger_lib)
|
||||
|
||||
env.Program('loggerd', ['main.cc'], LIBS=libs)
|
||||
if arch == "larch64":
|
||||
env.Program('encoderd', ['encoderd.cc'], LIBS=libs)
|
||||
env.Program('bootlog.cc', LIBS=libs)
|
||||
|
||||
if GetOption('test'):
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include "selfdrive/loggerd/loggerd.h"
|
||||
#include "cereal/visionipc/visionipc.h"
|
||||
|
||||
class VideoEncoder {
|
||||
public:
|
||||
virtual ~VideoEncoder() {}
|
||||
virtual int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, uint64_t ts) = 0;
|
||||
int in_width, int in_height, VisionIpcBufExtra *extra) = 0;
|
||||
virtual void encoder_open(const char* path) = 0;
|
||||
virtual void encoder_close() = 0;
|
||||
};
|
||||
|
||||
145
selfdrive/loggerd/encoderd.cc
Normal file
145
selfdrive/loggerd/encoderd.cc
Normal file
@@ -0,0 +1,145 @@
|
||||
#include "selfdrive/loggerd/loggerd.h"
|
||||
|
||||
ExitHandler do_exit;
|
||||
|
||||
struct EncoderdState {
|
||||
int max_waiting = 0;
|
||||
|
||||
// Sync logic for startup
|
||||
std::atomic<int> encoders_ready = 0;
|
||||
std::atomic<uint32_t> start_frame_id = 0;
|
||||
bool camera_ready[WideRoadCam + 1] = {};
|
||||
bool camera_synced[WideRoadCam + 1] = {};
|
||||
};
|
||||
|
||||
// Handle initial encoder syncing by waiting for all encoders to reach the same frame id
|
||||
bool sync_encoders(EncoderdState *s, CameraType cam_type, uint32_t frame_id) {
|
||||
if (s->camera_synced[cam_type]) return true;
|
||||
|
||||
if (s->max_waiting > 1 && s->encoders_ready != s->max_waiting) {
|
||||
// add a small margin to the start frame id in case one of the encoders already dropped the next frame
|
||||
update_max_atomic(s->start_frame_id, frame_id + 2);
|
||||
if (std::exchange(s->camera_ready[cam_type], true) == false) {
|
||||
++s->encoders_ready;
|
||||
LOGD("camera %d encoder ready", cam_type);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
if (s->max_waiting == 1) update_max_atomic(s->start_frame_id, frame_id);
|
||||
bool synced = frame_id >= s->start_frame_id;
|
||||
s->camera_synced[cam_type] = synced;
|
||||
if (!synced) LOGD("camera %d waiting for frame %d, cur %d", cam_type, (int)s->start_frame_id, frame_id);
|
||||
return synced;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void encoder_thread(EncoderdState *s, const LogCameraInfo &cam_info) {
|
||||
util::set_thread_name(cam_info.filename);
|
||||
|
||||
std::vector<Encoder *> encoders;
|
||||
VisionIpcClient vipc_client = VisionIpcClient("camerad", cam_info.stream_type, false);
|
||||
|
||||
int cur_seg = 0;
|
||||
while (!do_exit) {
|
||||
if (!vipc_client.connect(false)) {
|
||||
util::sleep_for(5);
|
||||
continue;
|
||||
}
|
||||
|
||||
// init encoders
|
||||
if (encoders.empty()) {
|
||||
VisionBuf buf_info = vipc_client.buffers[0];
|
||||
LOGD("encoder init %dx%d", buf_info.width, buf_info.height);
|
||||
|
||||
// main encoder
|
||||
encoders.push_back(new Encoder(cam_info.filename, cam_info.type, buf_info.width, buf_info.height,
|
||||
cam_info.fps, cam_info.bitrate, cam_info.is_h265,
|
||||
buf_info.width, buf_info.height, false));
|
||||
// qcamera encoder
|
||||
if (cam_info.has_qcamera) {
|
||||
encoders.push_back(new Encoder(qcam_info.filename, cam_info.type, buf_info.width, buf_info.height,
|
||||
qcam_info.fps, qcam_info.bitrate, qcam_info.is_h265,
|
||||
qcam_info.frame_width, qcam_info.frame_height, false));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < encoders.size(); ++i) {
|
||||
encoders[i]->encoder_open(NULL);
|
||||
}
|
||||
|
||||
bool lagging = false;
|
||||
while (!do_exit) {
|
||||
VisionIpcBufExtra extra;
|
||||
VisionBuf* buf = vipc_client.recv(&extra);
|
||||
if (buf == nullptr) continue;
|
||||
|
||||
// detect loop around and drop the frames
|
||||
if (buf->get_frame_id() != extra.frame_id) {
|
||||
if (!lagging) {
|
||||
LOGE("encoder %s lag buffer id: %d extra id: %d", cam_info.filename, buf->get_frame_id(), extra.frame_id);
|
||||
lagging = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
lagging = false;
|
||||
|
||||
if (cam_info.trigger_rotate) {
|
||||
if (!sync_encoders(s, cam_info.type, extra.frame_id)) {
|
||||
continue;
|
||||
}
|
||||
if (do_exit) break;
|
||||
}
|
||||
|
||||
// encode a frame
|
||||
for (int i = 0; i < encoders.size(); ++i) {
|
||||
int out_id = encoders[i]->encode_frame(buf->y, buf->u, buf->v,
|
||||
buf->width, buf->height, &extra);
|
||||
|
||||
if (out_id == -1) {
|
||||
LOGE("Failed to encode frame. frame_id: %d", extra.frame_id);
|
||||
}
|
||||
}
|
||||
|
||||
const int frames_per_seg = SEGMENT_LENGTH * MAIN_FPS;
|
||||
if (cur_seg >= 0 && extra.frame_id >= ((cur_seg + 1) * frames_per_seg) + s->start_frame_id) {
|
||||
for (auto &e : encoders) {
|
||||
e->encoder_close();
|
||||
e->encoder_open(NULL);
|
||||
}
|
||||
++cur_seg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG("encoder destroy");
|
||||
for(auto &e : encoders) {
|
||||
e->encoder_close();
|
||||
delete e;
|
||||
}
|
||||
}
|
||||
|
||||
void encoderd_thread() {
|
||||
EncoderdState s;
|
||||
|
||||
std::vector<std::thread> encoder_threads;
|
||||
for (const auto &cam : cameras_logged) {
|
||||
if (cam.enable) {
|
||||
encoder_threads.push_back(std::thread(encoder_thread, &s, cam));
|
||||
if (cam.trigger_rotate) s.max_waiting++;
|
||||
}
|
||||
}
|
||||
for (auto &t : encoder_threads) t.join();
|
||||
}
|
||||
|
||||
int main() {
|
||||
if (Hardware::TICI()) {
|
||||
int ret;
|
||||
ret = util::set_realtime_priority(52);
|
||||
assert(ret == 0);
|
||||
ret = util::set_core_affinity({7});
|
||||
assert(ret == 0);
|
||||
}
|
||||
encoderd_thread();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "selfdrive/loggerd/loggerd.h"
|
||||
#include "selfdrive/loggerd/remote_encoder.h"
|
||||
bool USE_REMOTE_ENCODER = false;
|
||||
|
||||
ExitHandler do_exit;
|
||||
|
||||
@@ -107,7 +109,7 @@ void encoder_thread(LoggerdState *s, const LogCameraInfo &cam_info) {
|
||||
// encode a frame
|
||||
for (int i = 0; i < encoders.size(); ++i) {
|
||||
int out_id = encoders[i]->encode_frame(buf->y, buf->u, buf->v,
|
||||
buf->width, buf->height, extra.timestamp_eof);
|
||||
buf->width, buf->height, &extra);
|
||||
|
||||
if (out_id == -1) {
|
||||
LOGE("Failed to encode frame. frame_id: %d encode_id: %d", extra.frame_id, encode_idx);
|
||||
@@ -188,15 +190,18 @@ void loggerd_thread() {
|
||||
typedef struct QlogState {
|
||||
std::string name;
|
||||
int counter, freq;
|
||||
bool encoder;
|
||||
} QlogState;
|
||||
std::unordered_map<SubSocket*, QlogState> qlog_states;
|
||||
std::unordered_map<SubSocket*, struct RemoteEncoder> remote_encoders;
|
||||
|
||||
std::unique_ptr<Context> ctx(Context::create());
|
||||
std::unique_ptr<Poller> poller(Poller::create());
|
||||
|
||||
// subscribe to all socks
|
||||
for (const auto& it : services) {
|
||||
if (!it.should_log) continue;
|
||||
const bool encoder = USE_REMOTE_ENCODER & (strcmp(it.name+strlen(it.name)-strlen("EncodeData"), "EncodeData") == 0);
|
||||
if (!it.should_log && !encoder) continue;
|
||||
LOGD("logging %s (on port %d)", it.name, it.port);
|
||||
|
||||
SubSocket * sock = SubSocket::create(ctx.get(), it.name);
|
||||
@@ -206,6 +211,7 @@ void loggerd_thread() {
|
||||
.name = it.name,
|
||||
.counter = 0,
|
||||
.freq = it.decimation,
|
||||
.encoder = encoder,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -238,9 +244,14 @@ void loggerd_thread() {
|
||||
Message *msg = nullptr;
|
||||
while (!do_exit && (msg = sock->receive(true))) {
|
||||
const bool in_qlog = qs.freq != -1 && (qs.counter++ % qs.freq == 0);
|
||||
logger_log(&s.logger, (uint8_t *)msg->getData(), msg->getSize(), in_qlog);
|
||||
bytes_count += msg->getSize();
|
||||
delete msg;
|
||||
|
||||
if (qs.encoder) {
|
||||
bytes_count += handle_encoder_msg(&s, msg, qs.name, remote_encoders[sock]);
|
||||
} else {
|
||||
logger_log(&s.logger, (uint8_t *)msg->getData(), msg->getSize(), in_qlog);
|
||||
bytes_count += msg->getSize();
|
||||
delete msg;
|
||||
}
|
||||
|
||||
rotate_if_needed(&s);
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include "selfdrive/loggerd/encoder.h"
|
||||
#include "selfdrive/loggerd/logger.h"
|
||||
#ifdef QCOM2
|
||||
#include "selfdrive/loggerd/omx_encoder.h"
|
||||
#define Encoder OmxEncoder
|
||||
#include "selfdrive/loggerd/v4l_encoder.h"
|
||||
#define Encoder V4LEncoder
|
||||
#else
|
||||
#include "selfdrive/loggerd/raw_logger.h"
|
||||
#define Encoder RawLogger
|
||||
@@ -67,6 +67,8 @@ const LogCameraInfo cameras_logged[] = {
|
||||
.trigger_rotate = true,
|
||||
.enable = true,
|
||||
.record = true,
|
||||
.frame_width = 1928,
|
||||
.frame_height = 1208,
|
||||
},
|
||||
{
|
||||
.type = DriverCam,
|
||||
@@ -79,6 +81,8 @@ const LogCameraInfo cameras_logged[] = {
|
||||
.trigger_rotate = true,
|
||||
.enable = true,
|
||||
.record = Params().getBool("RecordFront"),
|
||||
.frame_width = 1928,
|
||||
.frame_height = 1208,
|
||||
},
|
||||
{
|
||||
.type = WideRoadCam,
|
||||
@@ -91,6 +95,8 @@ const LogCameraInfo cameras_logged[] = {
|
||||
.trigger_rotate = true,
|
||||
.enable = Hardware::TICI(),
|
||||
.record = Hardware::TICI(),
|
||||
.frame_width = 1928,
|
||||
.frame_height = 1208,
|
||||
},
|
||||
};
|
||||
const LogCameraInfo qcam_info = {
|
||||
@@ -98,6 +104,8 @@ const LogCameraInfo qcam_info = {
|
||||
.fps = MAIN_FPS,
|
||||
.bitrate = 256000,
|
||||
.is_h265 = false,
|
||||
.enable = true,
|
||||
.record = true,
|
||||
.frame_width = Hardware::TICI() ? 526 : 480,
|
||||
.frame_height = Hardware::TICI() ? 330 : 360 // keep pixel count the same?
|
||||
};
|
||||
|
||||
@@ -1,547 +0,0 @@
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
#include "selfdrive/loggerd/omx_encoder.h"
|
||||
#include "cereal/messaging/messaging.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
|
||||
#include <OMX_Component.h>
|
||||
#include <OMX_IndexExt.h>
|
||||
#include <OMX_QCOMExtns.h>
|
||||
#include <OMX_VideoExt.h>
|
||||
#include "libyuv.h"
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/loggerd/include/msm_media_info.h"
|
||||
|
||||
// Check the OMX error code and assert if an error occurred.
|
||||
#define OMX_CHECK(_expr) \
|
||||
do { \
|
||||
assert(OMX_ErrorNone == (_expr)); \
|
||||
} while (0)
|
||||
|
||||
extern ExitHandler do_exit;
|
||||
|
||||
// ***** OMX callback functions *****
|
||||
|
||||
void OmxEncoder::wait_for_state(OMX_STATETYPE state_) {
|
||||
std::unique_lock lk(this->state_lock);
|
||||
while (this->state != state_) {
|
||||
this->state_cv.wait(lk);
|
||||
}
|
||||
}
|
||||
|
||||
static OMX_CALLBACKTYPE omx_callbacks = {
|
||||
.EventHandler = OmxEncoder::event_handler,
|
||||
.EmptyBufferDone = OmxEncoder::empty_buffer_done,
|
||||
.FillBufferDone = OmxEncoder::fill_buffer_done,
|
||||
};
|
||||
|
||||
OMX_ERRORTYPE OmxEncoder::event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, OMX_EVENTTYPE event,
|
||||
OMX_U32 data1, OMX_U32 data2, OMX_PTR event_data) {
|
||||
OmxEncoder *e = (OmxEncoder*)app_data;
|
||||
if (event == OMX_EventCmdComplete) {
|
||||
assert(data1 == OMX_CommandStateSet);
|
||||
LOG("set state event 0x%x", data2);
|
||||
{
|
||||
std::unique_lock lk(e->state_lock);
|
||||
e->state = (OMX_STATETYPE)data2;
|
||||
}
|
||||
e->state_cv.notify_all();
|
||||
} else if (event == OMX_EventError) {
|
||||
LOGE("OMX error 0x%08x", data1);
|
||||
} else {
|
||||
LOGE("OMX unhandled event %d", event);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return OMX_ErrorNone;
|
||||
}
|
||||
|
||||
OMX_ERRORTYPE OmxEncoder::empty_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data,
|
||||
OMX_BUFFERHEADERTYPE *buffer) {
|
||||
OmxEncoder *e = (OmxEncoder*)app_data;
|
||||
e->free_in.push(buffer);
|
||||
return OMX_ErrorNone;
|
||||
}
|
||||
|
||||
OMX_ERRORTYPE OmxEncoder::fill_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data,
|
||||
OMX_BUFFERHEADERTYPE *buffer) {
|
||||
OmxEncoder *e = (OmxEncoder*)app_data;
|
||||
e->done_out.push(buffer);
|
||||
return OMX_ErrorNone;
|
||||
}
|
||||
|
||||
#define PORT_INDEX_IN 0
|
||||
#define PORT_INDEX_OUT 1
|
||||
|
||||
static const char* omx_color_fomat_name(uint32_t format) __attribute__((unused));
|
||||
static const char* omx_color_fomat_name(uint32_t format) {
|
||||
switch (format) {
|
||||
case OMX_COLOR_FormatUnused: return "OMX_COLOR_FormatUnused";
|
||||
case OMX_COLOR_FormatMonochrome: return "OMX_COLOR_FormatMonochrome";
|
||||
case OMX_COLOR_Format8bitRGB332: return "OMX_COLOR_Format8bitRGB332";
|
||||
case OMX_COLOR_Format12bitRGB444: return "OMX_COLOR_Format12bitRGB444";
|
||||
case OMX_COLOR_Format16bitARGB4444: return "OMX_COLOR_Format16bitARGB4444";
|
||||
case OMX_COLOR_Format16bitARGB1555: return "OMX_COLOR_Format16bitARGB1555";
|
||||
case OMX_COLOR_Format16bitRGB565: return "OMX_COLOR_Format16bitRGB565";
|
||||
case OMX_COLOR_Format16bitBGR565: return "OMX_COLOR_Format16bitBGR565";
|
||||
case OMX_COLOR_Format18bitRGB666: return "OMX_COLOR_Format18bitRGB666";
|
||||
case OMX_COLOR_Format18bitARGB1665: return "OMX_COLOR_Format18bitARGB1665";
|
||||
case OMX_COLOR_Format19bitARGB1666: return "OMX_COLOR_Format19bitARGB1666";
|
||||
case OMX_COLOR_Format24bitRGB888: return "OMX_COLOR_Format24bitRGB888";
|
||||
case OMX_COLOR_Format24bitBGR888: return "OMX_COLOR_Format24bitBGR888";
|
||||
case OMX_COLOR_Format24bitARGB1887: return "OMX_COLOR_Format24bitARGB1887";
|
||||
case OMX_COLOR_Format25bitARGB1888: return "OMX_COLOR_Format25bitARGB1888";
|
||||
case OMX_COLOR_Format32bitBGRA8888: return "OMX_COLOR_Format32bitBGRA8888";
|
||||
case OMX_COLOR_Format32bitARGB8888: return "OMX_COLOR_Format32bitARGB8888";
|
||||
case OMX_COLOR_FormatYUV411Planar: return "OMX_COLOR_FormatYUV411Planar";
|
||||
case OMX_COLOR_FormatYUV411PackedPlanar: return "OMX_COLOR_FormatYUV411PackedPlanar";
|
||||
case OMX_COLOR_FormatYUV420Planar: return "OMX_COLOR_FormatYUV420Planar";
|
||||
case OMX_COLOR_FormatYUV420PackedPlanar: return "OMX_COLOR_FormatYUV420PackedPlanar";
|
||||
case OMX_COLOR_FormatYUV420SemiPlanar: return "OMX_COLOR_FormatYUV420SemiPlanar";
|
||||
case OMX_COLOR_FormatYUV422Planar: return "OMX_COLOR_FormatYUV422Planar";
|
||||
case OMX_COLOR_FormatYUV422PackedPlanar: return "OMX_COLOR_FormatYUV422PackedPlanar";
|
||||
case OMX_COLOR_FormatYUV422SemiPlanar: return "OMX_COLOR_FormatYUV422SemiPlanar";
|
||||
case OMX_COLOR_FormatYCbYCr: return "OMX_COLOR_FormatYCbYCr";
|
||||
case OMX_COLOR_FormatYCrYCb: return "OMX_COLOR_FormatYCrYCb";
|
||||
case OMX_COLOR_FormatCbYCrY: return "OMX_COLOR_FormatCbYCrY";
|
||||
case OMX_COLOR_FormatCrYCbY: return "OMX_COLOR_FormatCrYCbY";
|
||||
case OMX_COLOR_FormatYUV444Interleaved: return "OMX_COLOR_FormatYUV444Interleaved";
|
||||
case OMX_COLOR_FormatRawBayer8bit: return "OMX_COLOR_FormatRawBayer8bit";
|
||||
case OMX_COLOR_FormatRawBayer10bit: return "OMX_COLOR_FormatRawBayer10bit";
|
||||
case OMX_COLOR_FormatRawBayer8bitcompressed: return "OMX_COLOR_FormatRawBayer8bitcompressed";
|
||||
case OMX_COLOR_FormatL2: return "OMX_COLOR_FormatL2";
|
||||
case OMX_COLOR_FormatL4: return "OMX_COLOR_FormatL4";
|
||||
case OMX_COLOR_FormatL8: return "OMX_COLOR_FormatL8";
|
||||
case OMX_COLOR_FormatL16: return "OMX_COLOR_FormatL16";
|
||||
case OMX_COLOR_FormatL24: return "OMX_COLOR_FormatL24";
|
||||
case OMX_COLOR_FormatL32: return "OMX_COLOR_FormatL32";
|
||||
case OMX_COLOR_FormatYUV420PackedSemiPlanar: return "OMX_COLOR_FormatYUV420PackedSemiPlanar";
|
||||
case OMX_COLOR_FormatYUV422PackedSemiPlanar: return "OMX_COLOR_FormatYUV422PackedSemiPlanar";
|
||||
case OMX_COLOR_Format18BitBGR666: return "OMX_COLOR_Format18BitBGR666";
|
||||
case OMX_COLOR_Format24BitARGB6666: return "OMX_COLOR_Format24BitARGB6666";
|
||||
case OMX_COLOR_Format24BitABGR6666: return "OMX_COLOR_Format24BitABGR6666";
|
||||
|
||||
case OMX_COLOR_FormatAndroidOpaque: return "OMX_COLOR_FormatAndroidOpaque";
|
||||
case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar: return "OMX_TI_COLOR_FormatYUV420PackedSemiPlanar";
|
||||
case OMX_QCOM_COLOR_FormatYVU420SemiPlanar: return "OMX_QCOM_COLOR_FormatYVU420SemiPlanar";
|
||||
case OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka: return "OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka";
|
||||
case OMX_SEC_COLOR_FormatNV12Tiled: return "OMX_SEC_COLOR_FormatNV12Tiled";
|
||||
case OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m: return "OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m";
|
||||
|
||||
// case QOMX_COLOR_FormatYVU420SemiPlanar: return "QOMX_COLOR_FormatYVU420SemiPlanar";
|
||||
case QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka: return "QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka";
|
||||
case QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka: return "QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka";
|
||||
// case QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka: return "QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka";
|
||||
// case QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m: return "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m";
|
||||
case QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView: return "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView";
|
||||
case QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed: return "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed";
|
||||
case QOMX_COLOR_Format32bitRGBA8888: return "QOMX_COLOR_Format32bitRGBA8888";
|
||||
case QOMX_COLOR_Format32bitRGBA8888Compressed: return "QOMX_COLOR_Format32bitRGBA8888Compressed";
|
||||
|
||||
default:
|
||||
return "unkn";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ***** encoder functions *****
|
||||
OmxEncoder::OmxEncoder(const char* filename, CameraType type, int in_width, int in_height, int fps, int bitrate, bool h265, int out_width, int out_height, bool write)
|
||||
: in_width_(in_width), in_height_(in_height), width(out_width), height(out_height) {
|
||||
this->filename = filename;
|
||||
this->type = type;
|
||||
this->write = write;
|
||||
this->fps = fps;
|
||||
this->remuxing = !h265;
|
||||
|
||||
this->downscale = in_width != out_width || in_height != out_height;
|
||||
if (this->downscale) {
|
||||
this->y_ptr2 = (uint8_t *)malloc(this->width*this->height);
|
||||
this->u_ptr2 = (uint8_t *)malloc(this->width*this->height/4);
|
||||
this->v_ptr2 = (uint8_t *)malloc(this->width*this->height/4);
|
||||
}
|
||||
|
||||
auto component = (OMX_STRING)(h265 ? "OMX.qcom.video.encoder.hevc" : "OMX.qcom.video.encoder.avc");
|
||||
int err = OMX_GetHandle(&this->handle, component, this, &omx_callbacks);
|
||||
if (err != OMX_ErrorNone) {
|
||||
LOGE("error getting codec: %x", err);
|
||||
}
|
||||
assert(err == OMX_ErrorNone);
|
||||
// printf("handle: %p\n", this->handle);
|
||||
|
||||
// setup input port
|
||||
|
||||
OMX_PARAM_PORTDEFINITIONTYPE in_port = {0};
|
||||
in_port.nSize = sizeof(in_port);
|
||||
in_port.nPortIndex = (OMX_U32) PORT_INDEX_IN;
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &in_port));
|
||||
|
||||
in_port.format.video.nFrameWidth = this->width;
|
||||
in_port.format.video.nFrameHeight = this->height;
|
||||
in_port.format.video.nStride = VENUS_Y_STRIDE(COLOR_FMT_NV12, this->width);
|
||||
in_port.format.video.nSliceHeight = this->height;
|
||||
// in_port.nBufferSize = (this->width * this->height * 3) / 2;
|
||||
in_port.nBufferSize = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, this->width, this->height);
|
||||
in_port.format.video.xFramerate = (this->fps * 65536);
|
||||
in_port.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
|
||||
// in_port.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
|
||||
in_port.format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
|
||||
|
||||
OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &in_port));
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &in_port));
|
||||
this->in_buf_headers.resize(in_port.nBufferCountActual);
|
||||
|
||||
// setup output port
|
||||
|
||||
OMX_PARAM_PORTDEFINITIONTYPE out_port = {0};
|
||||
out_port.nSize = sizeof(out_port);
|
||||
out_port.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR)&out_port));
|
||||
out_port.format.video.nFrameWidth = this->width;
|
||||
out_port.format.video.nFrameHeight = this->height;
|
||||
out_port.format.video.xFramerate = 0;
|
||||
out_port.format.video.nBitrate = bitrate;
|
||||
if (h265) {
|
||||
out_port.format.video.eCompressionFormat = OMX_VIDEO_CodingHEVC;
|
||||
} else {
|
||||
out_port.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;
|
||||
}
|
||||
out_port.format.video.eColorFormat = OMX_COLOR_FormatUnused;
|
||||
|
||||
OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &out_port));
|
||||
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamPortDefinition, (OMX_PTR) &out_port));
|
||||
this->out_buf_headers.resize(out_port.nBufferCountActual);
|
||||
|
||||
OMX_VIDEO_PARAM_BITRATETYPE bitrate_type = {0};
|
||||
bitrate_type.nSize = sizeof(bitrate_type);
|
||||
bitrate_type.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamVideoBitrate, (OMX_PTR) &bitrate_type));
|
||||
bitrate_type.eControlRate = OMX_Video_ControlRateVariable;
|
||||
bitrate_type.nTargetBitrate = bitrate;
|
||||
|
||||
OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamVideoBitrate, (OMX_PTR) &bitrate_type));
|
||||
|
||||
if (h265) {
|
||||
// setup HEVC
|
||||
OMX_VIDEO_PARAM_PROFILELEVELTYPE hevc_type = {0};
|
||||
OMX_INDEXTYPE index_type = OMX_IndexParamVideoProfileLevelCurrent;
|
||||
hevc_type.nSize = sizeof(hevc_type);
|
||||
hevc_type.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, index_type, (OMX_PTR) &hevc_type));
|
||||
|
||||
hevc_type.eProfile = OMX_VIDEO_HEVCProfileMain;
|
||||
hevc_type.eLevel = OMX_VIDEO_HEVCHighTierLevel5;
|
||||
|
||||
OMX_CHECK(OMX_SetParameter(this->handle, index_type, (OMX_PTR) &hevc_type));
|
||||
} else {
|
||||
// setup h264
|
||||
OMX_VIDEO_PARAM_AVCTYPE avc = { 0 };
|
||||
avc.nSize = sizeof(avc);
|
||||
avc.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
|
||||
OMX_CHECK(OMX_GetParameter(this->handle, OMX_IndexParamVideoAvc, &avc));
|
||||
|
||||
avc.nBFrames = 0;
|
||||
avc.nPFrames = 15;
|
||||
|
||||
avc.eProfile = OMX_VIDEO_AVCProfileHigh;
|
||||
avc.eLevel = OMX_VIDEO_AVCLevel31;
|
||||
|
||||
avc.nAllowedPictureTypes |= OMX_VIDEO_PictureTypeB;
|
||||
avc.eLoopFilterMode = OMX_VIDEO_AVCLoopFilterEnable;
|
||||
|
||||
avc.nRefFrames = 1;
|
||||
avc.bUseHadamard = OMX_TRUE;
|
||||
avc.bEntropyCodingCABAC = OMX_TRUE;
|
||||
avc.bWeightedPPrediction = OMX_TRUE;
|
||||
avc.bconstIpred = OMX_TRUE;
|
||||
|
||||
OMX_CHECK(OMX_SetParameter(this->handle, OMX_IndexParamVideoAvc, &avc));
|
||||
}
|
||||
|
||||
|
||||
// for (int i = 0; ; i++) {
|
||||
// OMX_VIDEO_PARAM_PORTFORMATTYPE video_port_format = {0};
|
||||
// video_port_format.nSize = sizeof(video_port_format);
|
||||
// video_port_format.nIndex = i;
|
||||
// video_port_format.nPortIndex = PORT_INDEX_IN;
|
||||
// if (OMX_GetParameter(this->handle, OMX_IndexParamVideoPortFormat, &video_port_format) != OMX_ErrorNone)
|
||||
// break;
|
||||
// printf("in %d: compression 0x%x format 0x%x %s\n", i,
|
||||
// video_port_format.eCompressionFormat, video_port_format.eColorFormat,
|
||||
// omx_color_fomat_name(video_port_format.eColorFormat));
|
||||
// }
|
||||
|
||||
// for (int i=0; i<32; i++) {
|
||||
// OMX_VIDEO_PARAM_PROFILELEVELTYPE params = {0};
|
||||
// params.nSize = sizeof(params);
|
||||
// params.nPortIndex = PORT_INDEX_OUT;
|
||||
// params.nProfileIndex = i;
|
||||
// if (OMX_GetParameter(this->handle, OMX_IndexParamVideoProfileLevelQuerySupported, ¶ms) != OMX_ErrorNone)
|
||||
// break;
|
||||
// printf("profile %d level 0x%x\n", params.eProfile, params.eLevel);
|
||||
// }
|
||||
|
||||
OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateIdle, NULL));
|
||||
|
||||
for (auto &buf : this->in_buf_headers) {
|
||||
OMX_CHECK(OMX_AllocateBuffer(this->handle, &buf, PORT_INDEX_IN, this,
|
||||
in_port.nBufferSize));
|
||||
}
|
||||
|
||||
for (auto &buf : this->out_buf_headers) {
|
||||
OMX_CHECK(OMX_AllocateBuffer(this->handle, &buf, PORT_INDEX_OUT, this,
|
||||
out_port.nBufferSize));
|
||||
}
|
||||
|
||||
wait_for_state(OMX_StateIdle);
|
||||
|
||||
OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateExecuting, NULL));
|
||||
|
||||
wait_for_state(OMX_StateExecuting);
|
||||
|
||||
// give omx all the output buffers
|
||||
for (auto &buf : this->out_buf_headers) {
|
||||
// printf("fill %p\n", this->out_buf_headers[i]);
|
||||
OMX_CHECK(OMX_FillThisBuffer(this->handle, buf));
|
||||
}
|
||||
|
||||
// fill the input free queue
|
||||
for (auto &buf : this->in_buf_headers) {
|
||||
this->free_in.push(buf);
|
||||
}
|
||||
|
||||
LOGE("omx initialized - in: %d - out %d", this->in_buf_headers.size(), this->out_buf_headers.size());
|
||||
|
||||
service_name = this->type == DriverCam ? "driverEncodeData" :
|
||||
(this->type == WideRoadCam ? "wideRoadEncodeData" :
|
||||
(this->remuxing ? "qRoadEncodeData" : "roadEncodeData"));
|
||||
pm.reset(new PubMaster({service_name}));
|
||||
}
|
||||
|
||||
void OmxEncoder::callback_handler(OmxEncoder *e) {
|
||||
// OMX documentation specifies to not empty the buffer from the callback function
|
||||
// so we use this intermediate handler to copy the buffer for further writing
|
||||
// and give it back to OMX. We could also send the data over msgq from here.
|
||||
bool exit = false;
|
||||
|
||||
while (!exit) {
|
||||
OMX_BUFFERHEADERTYPE *buffer = e->done_out.pop();
|
||||
OmxBuffer *new_buffer = (OmxBuffer*)malloc(sizeof(OmxBuffer) + buffer->nFilledLen);
|
||||
assert(new_buffer);
|
||||
|
||||
new_buffer->header = *buffer;
|
||||
memcpy(new_buffer->data, buffer->pBuffer + buffer->nOffset, buffer->nFilledLen);
|
||||
|
||||
e->to_write.push(new_buffer);
|
||||
|
||||
#ifdef QCOM2
|
||||
if (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
|
||||
buffer->nTimeStamp = 0;
|
||||
}
|
||||
|
||||
if (buffer->nFlags & OMX_BUFFERFLAG_EOS) {
|
||||
buffer->nTimeStamp = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (buffer->nFlags & OMX_BUFFERFLAG_EOS) {
|
||||
exit = true;
|
||||
}
|
||||
|
||||
// give omx back the buffer
|
||||
// TOOD: fails when shutting down
|
||||
OMX_CHECK(OMX_FillThisBuffer(e->handle, buffer));
|
||||
}
|
||||
}
|
||||
|
||||
void OmxEncoder::write_and_broadcast_handler(OmxEncoder *e){
|
||||
bool exit = false;
|
||||
|
||||
e->segment_num++;
|
||||
uint32_t idx = 0;
|
||||
while (!exit) {
|
||||
OmxBuffer *out_buf = e->to_write.pop();
|
||||
|
||||
MessageBuilder msg;
|
||||
auto edata = (e->type == DriverCam) ? msg.initEvent(true).initDriverEncodeData() :
|
||||
((e->type == WideRoadCam) ? msg.initEvent(true).initWideRoadEncodeData() :
|
||||
(e->remuxing ? msg.initEvent(true).initQRoadEncodeData() : msg.initEvent(true).initRoadEncodeData()));
|
||||
edata.setData(kj::heapArray<capnp::byte>(out_buf->data, out_buf->header.nFilledLen));
|
||||
edata.setTimestampEof(out_buf->header.nTimeStamp);
|
||||
edata.setIdx(idx++);
|
||||
edata.setSegmentNum(e->segment_num);
|
||||
edata.setFlags(out_buf->header.nFlags);
|
||||
e->pm->send(e->service_name, msg);
|
||||
|
||||
OmxEncoder::handle_out_buf(e, out_buf);
|
||||
if (out_buf->header.nFlags & OMX_BUFFERFLAG_EOS) {
|
||||
exit = true;
|
||||
}
|
||||
|
||||
free(out_buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OmxEncoder::handle_out_buf(OmxEncoder *e, OmxBuffer *out_buf) {
|
||||
if (!(out_buf->header.nFlags & OMX_BUFFERFLAG_EOS) && e->writer) {
|
||||
e->writer->write(out_buf->data,
|
||||
out_buf->header.nFilledLen,
|
||||
out_buf->header.nTimeStamp,
|
||||
out_buf->header.nFlags & OMX_BUFFERFLAG_CODECCONFIG,
|
||||
out_buf->header.nFlags & OMX_BUFFERFLAG_SYNCFRAME);
|
||||
}
|
||||
}
|
||||
|
||||
int OmxEncoder::encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, uint64_t ts) {
|
||||
assert(in_width == this->in_width_);
|
||||
assert(in_height == this->in_height_);
|
||||
int err;
|
||||
if (!this->is_open) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// this sometimes freezes... put it outside the encoder lock so we can still trigger rotates...
|
||||
// THIS IS A REALLY BAD IDEA, but apparently the race has to happen 30 times to trigger this
|
||||
//pthread_mutex_unlock(&this->lock);
|
||||
OMX_BUFFERHEADERTYPE* in_buf = nullptr;
|
||||
while (!this->free_in.try_pop(in_buf, 20)) {
|
||||
if (do_exit) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//pthread_mutex_lock(&this->lock);
|
||||
|
||||
int ret = this->counter;
|
||||
|
||||
uint8_t *in_buf_ptr = in_buf->pBuffer;
|
||||
// printf("in_buf ptr %p\n", in_buf_ptr);
|
||||
|
||||
uint8_t *in_y_ptr = in_buf_ptr;
|
||||
int in_y_stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, this->width);
|
||||
int in_uv_stride = VENUS_UV_STRIDE(COLOR_FMT_NV12, this->width);
|
||||
// uint8_t *in_uv_ptr = in_buf_ptr + (this->width * this->height);
|
||||
uint8_t *in_uv_ptr = in_buf_ptr + (in_y_stride * VENUS_Y_SCANLINES(COLOR_FMT_NV12, this->height));
|
||||
|
||||
if (this->downscale) {
|
||||
I420Scale(y_ptr, in_width,
|
||||
u_ptr, in_width/2,
|
||||
v_ptr, in_width/2,
|
||||
in_width, in_height,
|
||||
this->y_ptr2, this->width,
|
||||
this->u_ptr2, this->width/2,
|
||||
this->v_ptr2, this->width/2,
|
||||
this->width, this->height,
|
||||
libyuv::kFilterNone);
|
||||
y_ptr = this->y_ptr2;
|
||||
u_ptr = this->u_ptr2;
|
||||
v_ptr = this->v_ptr2;
|
||||
}
|
||||
err = libyuv::I420ToNV12(y_ptr, this->width,
|
||||
u_ptr, this->width/2,
|
||||
v_ptr, this->width/2,
|
||||
in_y_ptr, in_y_stride,
|
||||
in_uv_ptr, in_uv_stride,
|
||||
this->width, this->height);
|
||||
assert(err == 0);
|
||||
|
||||
// in_buf->nFilledLen = (this->width*this->height) + (this->width*this->height/2);
|
||||
in_buf->nFilledLen = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, this->width, this->height);
|
||||
in_buf->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
|
||||
in_buf->nOffset = 0;
|
||||
in_buf->nTimeStamp = ts/1000LL; // OMX_TICKS, in microseconds
|
||||
this->last_t = in_buf->nTimeStamp;
|
||||
|
||||
OMX_CHECK(OMX_EmptyThisBuffer(this->handle, in_buf));
|
||||
|
||||
this->dirty = true;
|
||||
|
||||
this->counter++;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void OmxEncoder::encoder_open(const char* path) {
|
||||
if (this->write) {
|
||||
writer.reset(new VideoWriter(path, this->filename, this->remuxing, this->width, this->height, this->fps, !this->remuxing, false));
|
||||
}
|
||||
|
||||
// start writer threads
|
||||
callback_handler_thread = std::thread(OmxEncoder::callback_handler, this);
|
||||
write_handler_thread = std::thread(OmxEncoder::write_and_broadcast_handler, this);
|
||||
|
||||
this->is_open = true;
|
||||
this->counter = 0;
|
||||
}
|
||||
|
||||
void OmxEncoder::encoder_close() {
|
||||
if (this->is_open) {
|
||||
if (this->dirty) {
|
||||
// drain output only if there could be frames in the encoder
|
||||
|
||||
OMX_BUFFERHEADERTYPE* in_buf = this->free_in.pop();
|
||||
in_buf->nFilledLen = 0;
|
||||
in_buf->nOffset = 0;
|
||||
in_buf->nFlags = OMX_BUFFERFLAG_EOS;
|
||||
in_buf->nTimeStamp = this->last_t + 1000000LL/this->fps;
|
||||
|
||||
OMX_CHECK(OMX_EmptyThisBuffer(this->handle, in_buf));
|
||||
|
||||
this->dirty = false;
|
||||
}
|
||||
|
||||
callback_handler_thread.join();
|
||||
write_handler_thread.join();
|
||||
|
||||
writer.reset();
|
||||
}
|
||||
this->is_open = false;
|
||||
}
|
||||
|
||||
OmxEncoder::~OmxEncoder() {
|
||||
assert(!this->is_open);
|
||||
|
||||
OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateIdle, NULL));
|
||||
|
||||
wait_for_state(OMX_StateIdle);
|
||||
|
||||
OMX_CHECK(OMX_SendCommand(this->handle, OMX_CommandStateSet, OMX_StateLoaded, NULL));
|
||||
|
||||
for (auto &buf : this->in_buf_headers) {
|
||||
OMX_CHECK(OMX_FreeBuffer(this->handle, PORT_INDEX_IN, buf));
|
||||
}
|
||||
|
||||
for (auto &buf : this->out_buf_headers) {
|
||||
OMX_CHECK(OMX_FreeBuffer(this->handle, PORT_INDEX_OUT, buf));
|
||||
}
|
||||
|
||||
wait_for_state(OMX_StateLoaded);
|
||||
|
||||
OMX_CHECK(OMX_FreeHandle(this->handle));
|
||||
|
||||
OMX_BUFFERHEADERTYPE *buf;
|
||||
while (this->free_in.try_pop(buf));
|
||||
while (this->done_out.try_pop(buf));
|
||||
|
||||
OmxBuffer *write_buf;
|
||||
while (this->to_write.try_pop(write_buf)) {
|
||||
free(write_buf);
|
||||
};
|
||||
|
||||
if (this->downscale) {
|
||||
free(this->y_ptr2);
|
||||
free(this->u_ptr2);
|
||||
free(this->v_ptr2);
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
|
||||
#include <OMX_Component.h>
|
||||
|
||||
#include "selfdrive/common/queue.h"
|
||||
#include "selfdrive/loggerd/encoder.h"
|
||||
#include "selfdrive/loggerd/video_writer.h"
|
||||
|
||||
struct OmxBuffer {
|
||||
OMX_BUFFERHEADERTYPE header;
|
||||
OMX_U8 data[];
|
||||
};
|
||||
|
||||
|
||||
// OmxEncoder, lossey codec using hardware hevc
|
||||
class OmxEncoder : public VideoEncoder {
|
||||
public:
|
||||
OmxEncoder(const char* filename, CameraType type, int width, int height, int fps, int bitrate, bool h265, int out_width, int out_height, bool write = true);
|
||||
~OmxEncoder();
|
||||
int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, uint64_t ts);
|
||||
void encoder_open(const char* path);
|
||||
void encoder_close();
|
||||
|
||||
// OMX callbacks
|
||||
static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, OMX_EVENTTYPE event,
|
||||
OMX_U32 data1, OMX_U32 data2, OMX_PTR event_data);
|
||||
static OMX_ERRORTYPE empty_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data,
|
||||
OMX_BUFFERHEADERTYPE *buffer);
|
||||
static OMX_ERRORTYPE fill_buffer_done(OMX_HANDLETYPE component, OMX_PTR app_data,
|
||||
OMX_BUFFERHEADERTYPE *buffer);
|
||||
|
||||
private:
|
||||
void wait_for_state(OMX_STATETYPE state);
|
||||
static void callback_handler(OmxEncoder *e);
|
||||
static void write_and_broadcast_handler(OmxEncoder *e);
|
||||
static void handle_out_buf(OmxEncoder *e, OmxBuffer *out_buf);
|
||||
|
||||
int in_width_, in_height_;
|
||||
int width, height, fps;
|
||||
bool is_open = false;
|
||||
bool dirty = false;
|
||||
bool write = false;
|
||||
int counter = 0;
|
||||
std::thread callback_handler_thread;
|
||||
std::thread write_handler_thread;
|
||||
int segment_num = -1;
|
||||
std::unique_ptr<PubMaster> pm;
|
||||
const char *service_name;
|
||||
|
||||
const char* filename;
|
||||
CameraType type;
|
||||
|
||||
std::mutex state_lock;
|
||||
std::condition_variable state_cv;
|
||||
OMX_STATETYPE state = OMX_StateLoaded;
|
||||
|
||||
OMX_HANDLETYPE handle;
|
||||
|
||||
std::vector<OMX_BUFFERHEADERTYPE *> in_buf_headers;
|
||||
std::vector<OMX_BUFFERHEADERTYPE *> out_buf_headers;
|
||||
|
||||
uint64_t last_t;
|
||||
|
||||
SafeQueue<OMX_BUFFERHEADERTYPE *> free_in;
|
||||
SafeQueue<OMX_BUFFERHEADERTYPE *> done_out;
|
||||
SafeQueue<OmxBuffer *> to_write;
|
||||
|
||||
bool remuxing;
|
||||
std::unique_ptr<VideoWriter> writer;
|
||||
|
||||
bool downscale;
|
||||
uint8_t *y_ptr2, *u_ptr2, *v_ptr2;
|
||||
};
|
||||
@@ -59,7 +59,7 @@ void RawLogger::encoder_close() {
|
||||
}
|
||||
|
||||
int RawLogger::encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, uint64_t ts) {
|
||||
int in_width, int in_height, VisionIpcBufExtra *extra) {
|
||||
assert(in_width == this->in_width_);
|
||||
assert(in_height == this->in_height_);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include "selfdrive/loggerd/encoder.h"
|
||||
#include "selfdrive/loggerd/loggerd.h"
|
||||
#include "selfdrive/loggerd/video_writer.h"
|
||||
|
||||
class RawLogger : public VideoEncoder {
|
||||
@@ -20,7 +21,7 @@ class RawLogger : public VideoEncoder {
|
||||
int bitrate, bool h265, int out_width, int out_height, bool write = true);
|
||||
~RawLogger();
|
||||
int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, uint64_t ts);
|
||||
int in_width, int in_height, VisionIpcBufExtra *extra);
|
||||
void encoder_open(const char* path);
|
||||
void encoder_close();
|
||||
|
||||
|
||||
84
selfdrive/loggerd/remote_encoder.cc
Normal file
84
selfdrive/loggerd/remote_encoder.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
#include "selfdrive/loggerd/loggerd.h"
|
||||
#include "selfdrive/loggerd/remote_encoder.h"
|
||||
|
||||
int handle_encoder_msg(LoggerdState *s, Message *msg, std::string &name, struct RemoteEncoder &re) {
|
||||
const LogCameraInfo &cam_info = (name == "driverEncodeData") ? cameras_logged[1] :
|
||||
((name == "wideRoadEncodeData") ? cameras_logged[2] :
|
||||
((name == "qRoadEncodeData") ? qcam_info : cameras_logged[0]));
|
||||
if (!cam_info.record) return 0; // TODO: handle this by not subscribing
|
||||
|
||||
int bytes_count = 0;
|
||||
|
||||
// TODO: AlignedBuffer is making a copy and allocing
|
||||
//AlignedBuffer aligned_buf;
|
||||
//capnp::FlatArrayMessageReader cmsg(aligned_buf.align(msg->getData(), msg->getSize()));
|
||||
capnp::FlatArrayMessageReader cmsg(kj::ArrayPtr<capnp::word>((capnp::word *)msg->getData(), msg->getSize()));
|
||||
auto event = cmsg.getRoot<cereal::Event>();
|
||||
auto edata = (name == "driverEncodeData") ? event.getDriverEncodeData() :
|
||||
((name == "wideRoadEncodeData") ? event.getWideRoadEncodeData() :
|
||||
((name == "qRoadEncodeData") ? event.getQRoadEncodeData() : event.getRoadEncodeData()));
|
||||
auto idx = edata.getIdx();
|
||||
auto flags = idx.getFlags();
|
||||
|
||||
// rotation happened, process the queue (happens before the current message)
|
||||
if (re.logger_segment != s->rotate_segment) {
|
||||
re.logger_segment = s->rotate_segment;
|
||||
for (auto &qmsg: re.q) {
|
||||
bytes_count += handle_encoder_msg(s, qmsg, name, re);
|
||||
}
|
||||
re.q.clear();
|
||||
}
|
||||
|
||||
if (!re.writer) {
|
||||
// only create on iframe
|
||||
if (flags & V4L2_BUF_FLAG_KEYFRAME) {
|
||||
if (re.dropped_frames) {
|
||||
// this should only happen for the first segment, maybe
|
||||
LOGD("%s: dropped %d non iframe packets before init", name.c_str(), re.dropped_frames);
|
||||
re.dropped_frames = 0;
|
||||
}
|
||||
re.writer.reset(new VideoWriter(s->segment_path,
|
||||
cam_info.filename, !cam_info.is_h265,
|
||||
cam_info.frame_width, cam_info.frame_height,
|
||||
cam_info.fps, cam_info.is_h265, false));
|
||||
// write the header
|
||||
auto header = edata.getHeader();
|
||||
re.writer->write((uint8_t *)header.begin(), header.size(), idx.getTimestampEof()/1000, true, false);
|
||||
re.segment = idx.getSegmentNum();
|
||||
} else {
|
||||
++re.dropped_frames;
|
||||
return bytes_count;
|
||||
}
|
||||
}
|
||||
|
||||
if (re.segment != idx.getSegmentNum()) {
|
||||
if (re.writer) {
|
||||
// encoder is on the next segment, this segment is over so we close the videowriter
|
||||
re.writer.reset();
|
||||
++s->ready_to_rotate;
|
||||
LOGD("rotate %d -> %d ready %d/%d", re.segment, idx.getSegmentNum(), s->ready_to_rotate.load(), s->max_waiting);
|
||||
}
|
||||
// queue up all the new segment messages, they go in after the rotate
|
||||
re.q.push_back(msg);
|
||||
} else {
|
||||
auto data = edata.getData();
|
||||
re.writer->write((uint8_t *)data.begin(), data.size(), idx.getTimestampEof()/1000, false, flags & V4L2_BUF_FLAG_KEYFRAME);
|
||||
|
||||
// put it in log stream as the idx packet
|
||||
MessageBuilder bmsg;
|
||||
auto evt = bmsg.initEvent(event.getValid());
|
||||
evt.setLogMonoTime(event.getLogMonoTime());
|
||||
if (name == "driverEncodeData") { evt.setDriverEncodeIdx(idx); }
|
||||
if (name == "wideRoadEncodeData") { evt.setWideRoadEncodeIdx(idx); }
|
||||
if (name == "qRoadEncodeData") { evt.setQRoadEncodeIdx(idx); }
|
||||
if (name == "roadEncodeData") { evt.setRoadEncodeIdx(idx); }
|
||||
auto new_msg = bmsg.toBytes();
|
||||
logger_log(&s->logger, (uint8_t *)new_msg.begin(), new_msg.size(), true); // always in qlog?
|
||||
delete msg;
|
||||
bytes_count += new_msg.size();
|
||||
}
|
||||
|
||||
return bytes_count;
|
||||
}
|
||||
|
||||
|
||||
12
selfdrive/loggerd/remote_encoder.h
Normal file
12
selfdrive/loggerd/remote_encoder.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "selfdrive/loggerd/video_writer.h"
|
||||
#define V4L2_BUF_FLAG_KEYFRAME 0x00000008
|
||||
|
||||
struct RemoteEncoder {
|
||||
std::unique_ptr<VideoWriter> writer;
|
||||
int segment = -1;
|
||||
std::vector<Message *> q;
|
||||
int logger_segment = -1;
|
||||
int dropped_frames = 0;
|
||||
};
|
||||
|
||||
int handle_encoder_msg(LoggerdState *s, Message *msg, std::string &name, struct RemoteEncoder &re);
|
||||
@@ -107,7 +107,8 @@ class TestEncoder(unittest.TestCase):
|
||||
|
||||
# sanity check file size
|
||||
file_size = os.path.getsize(file_path)
|
||||
self.assertTrue(math.isclose(file_size, size, rel_tol=FILE_SIZE_TOLERANCE))
|
||||
self.assertTrue(math.isclose(file_size, size, rel_tol=FILE_SIZE_TOLERANCE),
|
||||
f"{file_path} size {file_size} isn't close to target size {size}")
|
||||
|
||||
# Check encodeIdx
|
||||
if encode_idx_name is not None:
|
||||
|
||||
401
selfdrive/loggerd/v4l_encoder.cc
Normal file
401
selfdrive/loggerd/v4l_encoder.cc
Normal file
@@ -0,0 +1,401 @@
|
||||
#include <cassert>
|
||||
#include <sys/ioctl.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include "selfdrive/loggerd/v4l_encoder.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
|
||||
#include "libyuv.h"
|
||||
#include "msm_media_info.h"
|
||||
|
||||
// has to be in this order
|
||||
#include "v4l2-controls.h"
|
||||
#include <linux/videodev2.h>
|
||||
#define V4L2_QCOM_BUF_FLAG_CODECCONFIG 0x00020000
|
||||
#define V4L2_QCOM_BUF_FLAG_EOS 0x02000000
|
||||
|
||||
// echo 0x7fffffff > /sys/kernel/debug/msm_vidc/debug_level
|
||||
const int env_debug_encoder = (getenv("DEBUG_ENCODER") != NULL) ? atoi(getenv("DEBUG_ENCODER")) : 0;
|
||||
|
||||
#define checked_ioctl(x,y,z) { int _ret = HANDLE_EINTR(ioctl(x,y,z)); if (_ret!=0) { LOGE("checked_ioctl failed %d %lx %p", x, y, z); } assert(_ret==0); }
|
||||
|
||||
static void dequeue_buffer(int fd, v4l2_buf_type buf_type, unsigned int *index=NULL, unsigned int *bytesused=NULL, unsigned int *flags=NULL, struct timeval *timestamp=NULL) {
|
||||
v4l2_plane plane = {0};
|
||||
v4l2_buffer v4l_buf = {
|
||||
.type = buf_type,
|
||||
.memory = V4L2_MEMORY_USERPTR,
|
||||
.m = { .planes = &plane, },
|
||||
.length = 1,
|
||||
};
|
||||
checked_ioctl(fd, VIDIOC_DQBUF, &v4l_buf);
|
||||
|
||||
if (index) *index = v4l_buf.index;
|
||||
if (bytesused) *bytesused = v4l_buf.m.planes[0].bytesused;
|
||||
if (flags) *flags = v4l_buf.flags;
|
||||
if (timestamp) *timestamp = v4l_buf.timestamp;
|
||||
assert(v4l_buf.m.planes[0].data_offset == 0);
|
||||
}
|
||||
|
||||
static void queue_buffer(int fd, v4l2_buf_type buf_type, unsigned int index, VisionBuf *buf, struct timeval timestamp={0}) {
|
||||
v4l2_plane plane = {
|
||||
.length = (unsigned int)buf->len,
|
||||
.m = { .userptr = (unsigned long)buf->addr, },
|
||||
.reserved = {(unsigned int)buf->fd}
|
||||
};
|
||||
|
||||
v4l2_buffer v4l_buf = {
|
||||
.type = buf_type,
|
||||
.index = index,
|
||||
.memory = V4L2_MEMORY_USERPTR,
|
||||
.m = { .planes = &plane, },
|
||||
.length = 1,
|
||||
.bytesused = 0,
|
||||
.flags = V4L2_BUF_FLAG_TIMESTAMP_COPY,
|
||||
.timestamp = timestamp
|
||||
};
|
||||
|
||||
checked_ioctl(fd, VIDIOC_QBUF, &v4l_buf);
|
||||
}
|
||||
|
||||
static void request_buffers(int fd, v4l2_buf_type buf_type, unsigned int count) {
|
||||
struct v4l2_requestbuffers reqbuf = {
|
||||
.type = buf_type,
|
||||
.memory = V4L2_MEMORY_USERPTR,
|
||||
.count = count
|
||||
};
|
||||
checked_ioctl(fd, VIDIOC_REQBUFS, &reqbuf);
|
||||
}
|
||||
|
||||
// TODO: writing should be moved to loggerd
|
||||
void V4LEncoder::write_handler(V4LEncoder *e, const char *path) {
|
||||
VideoWriter writer(path, e->filename, !e->h265, e->width, e->height, e->fps, e->h265, false);
|
||||
|
||||
bool first = true;
|
||||
kj::Array<capnp::word>* out_buf;
|
||||
while ((out_buf = e->to_write.pop())) {
|
||||
capnp::FlatArrayMessageReader cmsg(*out_buf);
|
||||
cereal::Event::Reader event = cmsg.getRoot<cereal::Event>();
|
||||
|
||||
auto edata = (e->type == DriverCam) ? event.getDriverEncodeData() :
|
||||
((e->type == WideRoadCam) ? event.getWideRoadEncodeData() :
|
||||
(e->h265 ? event.getRoadEncodeData() : event.getQRoadEncodeData()));
|
||||
auto idx = edata.getIdx();
|
||||
auto flags = idx.getFlags();
|
||||
|
||||
if (first) {
|
||||
assert(flags & V4L2_BUF_FLAG_KEYFRAME);
|
||||
auto header = edata.getHeader();
|
||||
writer.write((uint8_t *)header.begin(), header.size(), idx.getTimestampEof()/1000, true, false);
|
||||
first = false;
|
||||
}
|
||||
|
||||
// dangerous cast from const, but should be fine
|
||||
auto data = edata.getData();
|
||||
if (data.size() > 0) {
|
||||
writer.write((uint8_t *)data.begin(), data.size(), idx.getTimestampEof()/1000, false, flags & V4L2_BUF_FLAG_KEYFRAME);
|
||||
}
|
||||
|
||||
// free the data
|
||||
delete out_buf;
|
||||
}
|
||||
|
||||
// VideoWriter is freed on out of scope
|
||||
}
|
||||
|
||||
void V4LEncoder::dequeue_handler(V4LEncoder *e) {
|
||||
std::string dequeue_thread_name = "dq-"+std::string(e->filename);
|
||||
util::set_thread_name(dequeue_thread_name.c_str());
|
||||
|
||||
e->segment_num++;
|
||||
uint32_t idx = -1;
|
||||
bool exit = false;
|
||||
|
||||
// POLLIN is capture, POLLOUT is frame
|
||||
struct pollfd pfd;
|
||||
pfd.events = POLLIN | POLLOUT;
|
||||
pfd.fd = e->fd;
|
||||
|
||||
// save the header
|
||||
kj::Array<capnp::byte> header;
|
||||
|
||||
while (!exit) {
|
||||
int rc = poll(&pfd, 1, 1000);
|
||||
if (!rc) { LOGE("encoder dequeue poll timeout"); continue; }
|
||||
|
||||
if (env_debug_encoder >= 2) {
|
||||
printf("%20s poll %x at %.2f ms\n", e->filename, pfd.revents, millis_since_boot());
|
||||
}
|
||||
|
||||
int frame_id = -1;
|
||||
if (pfd.revents & POLLIN) {
|
||||
unsigned int bytesused, flags, index;
|
||||
struct timeval timestamp;
|
||||
dequeue_buffer(e->fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, &index, &bytesused, &flags, ×tamp);
|
||||
e->buf_out[index].sync(VISIONBUF_SYNC_FROM_DEVICE);
|
||||
uint8_t *buf = (uint8_t*)e->buf_out[index].addr;
|
||||
int64_t ts = timestamp.tv_sec * 1000000 + timestamp.tv_usec;
|
||||
|
||||
// eof packet, we exit
|
||||
if (flags & V4L2_QCOM_BUF_FLAG_EOS) {
|
||||
if (e->write) e->to_write.push(NULL);
|
||||
exit = true;
|
||||
} else if (flags & V4L2_QCOM_BUF_FLAG_CODECCONFIG) {
|
||||
// save header
|
||||
header = kj::heapArray<capnp::byte>(buf, bytesused);
|
||||
} else {
|
||||
VisionIpcBufExtra extra = e->extras.pop();
|
||||
assert(extra.timestamp_eof/1000 == ts); // stay in sync
|
||||
|
||||
frame_id = extra.frame_id;
|
||||
++idx;
|
||||
|
||||
// broadcast packet
|
||||
MessageBuilder msg;
|
||||
auto event = msg.initEvent(true);
|
||||
auto edat = (e->type == DriverCam) ? event.initDriverEncodeData() :
|
||||
((e->type == WideRoadCam) ? event.initWideRoadEncodeData() :
|
||||
(e->h265 ? event.initRoadEncodeData() : event.initQRoadEncodeData()));
|
||||
auto edata = edat.initIdx();
|
||||
edata.setFrameId(extra.frame_id);
|
||||
edata.setTimestampSof(extra.timestamp_sof);
|
||||
edata.setTimestampEof(extra.timestamp_eof);
|
||||
edata.setType(e->h265 ? cereal::EncodeIndex::Type::FULL_H_E_V_C : cereal::EncodeIndex::Type::QCAMERA_H264);
|
||||
edata.setEncodeId(idx);
|
||||
edata.setSegmentNum(e->segment_num);
|
||||
edata.setSegmentId(idx);
|
||||
edata.setFlags(flags);
|
||||
edata.setLen(bytesused);
|
||||
edat.setData(kj::arrayPtr<capnp::byte>(buf, bytesused));
|
||||
if (flags & V4L2_BUF_FLAG_KEYFRAME) edat.setHeader(header);
|
||||
|
||||
auto words = new kj::Array<capnp::word>(capnp::messageToFlatArray(msg));
|
||||
auto bytes = words->asBytes();
|
||||
e->pm->send(e->service_name, bytes.begin(), bytes.size());
|
||||
if (e->write) {
|
||||
e->to_write.push(words);
|
||||
} else {
|
||||
delete words;
|
||||
}
|
||||
}
|
||||
|
||||
if (env_debug_encoder) {
|
||||
printf("%20s got(%d) %6d bytes flags %8x idx %4d id %8d ts %ld lat %.2f ms (%lu frames free)\n",
|
||||
e->filename, index, bytesused, flags, idx, frame_id, ts, millis_since_boot()-(ts/1000.), e->free_buf_in.size());
|
||||
}
|
||||
|
||||
// requeue the buffer
|
||||
queue_buffer(e->fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, index, &e->buf_out[index]);
|
||||
}
|
||||
|
||||
if (pfd.revents & POLLOUT) {
|
||||
unsigned int index;
|
||||
dequeue_buffer(e->fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, &index);
|
||||
e->free_buf_in.push(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
V4LEncoder::V4LEncoder(
|
||||
const char* filename, CameraType type, int in_width, int in_height,
|
||||
int fps, int bitrate, bool h265, int out_width, int out_height, bool write)
|
||||
: type(type), in_width_(in_width), in_height_(in_height),
|
||||
filename(filename), h265(h265),
|
||||
width(out_width), height(out_height), fps(fps), write(write) {
|
||||
fd = open("/dev/v4l/by-path/platform-aa00000.qcom_vidc-video-index1", O_RDWR|O_NONBLOCK);
|
||||
assert(fd >= 0);
|
||||
|
||||
struct v4l2_capability cap;
|
||||
checked_ioctl(fd, VIDIOC_QUERYCAP, &cap);
|
||||
LOGD("opened encoder device %s %s = %d", cap.driver, cap.card, fd);
|
||||
assert(strcmp((const char *)cap.driver, "msm_vidc_driver") == 0);
|
||||
assert(strcmp((const char *)cap.card, "msm_vidc_venc") == 0);
|
||||
|
||||
struct v4l2_format fmt_out = {
|
||||
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
|
||||
.fmt = {
|
||||
.pix_mp = {
|
||||
// downscales are free with v4l
|
||||
.width = (unsigned int)out_width,
|
||||
.height = (unsigned int)out_height,
|
||||
.pixelformat = h265 ? V4L2_PIX_FMT_HEVC : V4L2_PIX_FMT_H264,
|
||||
.field = V4L2_FIELD_ANY,
|
||||
.colorspace = V4L2_COLORSPACE_DEFAULT,
|
||||
}
|
||||
}
|
||||
};
|
||||
checked_ioctl(fd, VIDIOC_S_FMT, &fmt_out);
|
||||
|
||||
v4l2_streamparm streamparm = {
|
||||
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
|
||||
.parm = {
|
||||
.output = {
|
||||
// TODO: more stuff here? we don't know
|
||||
.timeperframe = {
|
||||
.numerator = 1,
|
||||
.denominator = 20
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
checked_ioctl(fd, VIDIOC_S_PARM, &streamparm);
|
||||
|
||||
struct v4l2_format fmt_in = {
|
||||
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
|
||||
.fmt = {
|
||||
.pix_mp = {
|
||||
.width = (unsigned int)in_width,
|
||||
.height = (unsigned int)in_height,
|
||||
.pixelformat = V4L2_PIX_FMT_NV12,
|
||||
.field = V4L2_FIELD_ANY,
|
||||
.colorspace = V4L2_COLORSPACE_470_SYSTEM_BG,
|
||||
}
|
||||
}
|
||||
};
|
||||
checked_ioctl(fd, VIDIOC_S_FMT, &fmt_in);
|
||||
|
||||
LOGD("in buffer size %d, out buffer size %d",
|
||||
fmt_in.fmt.pix_mp.plane_fmt[0].sizeimage,
|
||||
fmt_out.fmt.pix_mp.plane_fmt[0].sizeimage);
|
||||
|
||||
// shared ctrls
|
||||
{
|
||||
struct v4l2_control ctrls[] = {
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_HEADER_MODE, .value = V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_BITRATE, .value = bitrate},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL, .value = V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_CFR},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_PRIORITY, .value = V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_IDR_PERIOD, .value = 1},
|
||||
};
|
||||
for (auto ctrl : ctrls) {
|
||||
checked_ioctl(fd, VIDIOC_S_CTRL, &ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
if (h265) {
|
||||
struct v4l2_control ctrls[] = {
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE, .value = V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL, .value = V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES, .value = 29},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES, .value = 0},
|
||||
};
|
||||
for (auto ctrl : ctrls) {
|
||||
checked_ioctl(fd, VIDIOC_S_CTRL, &ctrl);
|
||||
}
|
||||
} else {
|
||||
struct v4l2_control ctrls[] = {
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_H264_PROFILE, .value = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_H264_LEVEL, .value = V4L2_MPEG_VIDEO_H264_LEVEL_UNKNOWN},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES, .value = 15},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES, .value = 0},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE, .value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC},
|
||||
{ .id = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL, .value = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE, .value = 0},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA, .value = 0},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA, .value = 0},
|
||||
{ .id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE, .value = 0},
|
||||
};
|
||||
for (auto ctrl : ctrls) {
|
||||
checked_ioctl(fd, VIDIOC_S_CTRL, &ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
// allocate buffers
|
||||
request_buffers(fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, BUF_OUT_COUNT);
|
||||
request_buffers(fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, BUF_IN_COUNT);
|
||||
|
||||
// start encoder
|
||||
v4l2_buf_type buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
checked_ioctl(fd, VIDIOC_STREAMON, &buf_type);
|
||||
buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
||||
checked_ioctl(fd, VIDIOC_STREAMON, &buf_type);
|
||||
|
||||
// queue up output buffers
|
||||
for (unsigned int i = 0; i < BUF_OUT_COUNT; i++) {
|
||||
buf_out[i].allocate(fmt_out.fmt.pix_mp.plane_fmt[0].sizeimage);
|
||||
queue_buffer(fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, i, &buf_out[i]);
|
||||
}
|
||||
// queue up input buffers
|
||||
for (unsigned int i = 0; i < BUF_IN_COUNT; i++) {
|
||||
buf_in[i].allocate(fmt_in.fmt.pix_mp.plane_fmt[0].sizeimage);
|
||||
free_buf_in.push(i);
|
||||
}
|
||||
|
||||
// publish
|
||||
service_name = this->type == DriverCam ? "driverEncodeData" :
|
||||
(this->type == WideRoadCam ? "wideRoadEncodeData" :
|
||||
(this->h265 ? "roadEncodeData" : "qRoadEncodeData"));
|
||||
pm.reset(new PubMaster({service_name}));
|
||||
}
|
||||
|
||||
|
||||
void V4LEncoder::encoder_open(const char* path) {
|
||||
dequeue_handler_thread = std::thread(V4LEncoder::dequeue_handler, this);
|
||||
if (this->write) write_handler_thread = std::thread(V4LEncoder::write_handler, this, path);
|
||||
this->is_open = true;
|
||||
this->counter = 0;
|
||||
}
|
||||
|
||||
int V4LEncoder::encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, VisionIpcBufExtra *extra) {
|
||||
assert(in_width == in_width_);
|
||||
assert(in_height == in_height_);
|
||||
assert(is_open);
|
||||
|
||||
// reserve buffer
|
||||
int buffer_in = free_buf_in.pop();
|
||||
|
||||
uint8_t *in_y_ptr = (uint8_t*)buf_in[buffer_in].addr;
|
||||
int in_y_stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, in_width);
|
||||
int in_uv_stride = VENUS_UV_STRIDE(COLOR_FMT_NV12, in_width);
|
||||
uint8_t *in_uv_ptr = in_y_ptr + (in_y_stride * VENUS_Y_SCANLINES(COLOR_FMT_NV12, in_height));
|
||||
|
||||
// GRRR COPY
|
||||
int err = libyuv::I420ToNV12(y_ptr, in_width,
|
||||
u_ptr, in_width/2,
|
||||
v_ptr, in_width/2,
|
||||
in_y_ptr, in_y_stride,
|
||||
in_uv_ptr, in_uv_stride,
|
||||
in_width, in_height);
|
||||
assert(err == 0);
|
||||
|
||||
struct timeval timestamp {
|
||||
.tv_sec = (long)(extra->timestamp_eof/1000000000),
|
||||
.tv_usec = (long)((extra->timestamp_eof/1000) % 1000000),
|
||||
};
|
||||
|
||||
// push buffer
|
||||
extras.push(*extra);
|
||||
buf_in[buffer_in].sync(VISIONBUF_SYNC_TO_DEVICE);
|
||||
queue_buffer(fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, buffer_in, &buf_in[buffer_in], timestamp);
|
||||
|
||||
return this->counter++;
|
||||
}
|
||||
|
||||
void V4LEncoder::encoder_close() {
|
||||
if (this->is_open) {
|
||||
// pop all the frames before closing, then put the buffers back
|
||||
for (int i = 0; i < BUF_IN_COUNT; i++) free_buf_in.pop();
|
||||
for (int i = 0; i < BUF_IN_COUNT; i++) free_buf_in.push(i);
|
||||
// no frames, stop the encoder
|
||||
struct v4l2_encoder_cmd encoder_cmd = { .cmd = V4L2_ENC_CMD_STOP };
|
||||
checked_ioctl(fd, VIDIOC_ENCODER_CMD, &encoder_cmd);
|
||||
// join waits for V4L2_QCOM_BUF_FLAG_EOS
|
||||
dequeue_handler_thread.join();
|
||||
assert(extras.empty());
|
||||
if (this->write) write_handler_thread.join();
|
||||
assert(to_write.empty());
|
||||
}
|
||||
this->is_open = false;
|
||||
}
|
||||
|
||||
V4LEncoder::~V4LEncoder() {
|
||||
encoder_close();
|
||||
v4l2_buf_type buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
||||
checked_ioctl(fd, VIDIOC_STREAMOFF, &buf_type);
|
||||
request_buffers(fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, 0);
|
||||
buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
checked_ioctl(fd, VIDIOC_STREAMOFF, &buf_type);
|
||||
request_buffers(fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, 0);
|
||||
close(fd);
|
||||
}
|
||||
48
selfdrive/loggerd/v4l_encoder.h
Normal file
48
selfdrive/loggerd/v4l_encoder.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "selfdrive/common/queue.h"
|
||||
#include "selfdrive/loggerd/encoder.h"
|
||||
#include "selfdrive/loggerd/loggerd.h"
|
||||
#include "selfdrive/loggerd/video_writer.h"
|
||||
|
||||
#define BUF_IN_COUNT 7
|
||||
#define BUF_OUT_COUNT 6
|
||||
|
||||
class V4LEncoder : public VideoEncoder {
|
||||
public:
|
||||
V4LEncoder(const char* filename, CameraType type, int width, int height, int fps, int bitrate, bool h265, int out_width, int out_height, bool write = true);
|
||||
~V4LEncoder();
|
||||
int encode_frame(const uint8_t *y_ptr, const uint8_t *u_ptr, const uint8_t *v_ptr,
|
||||
int in_width, int in_height, VisionIpcBufExtra *extra);
|
||||
void encoder_open(const char* path);
|
||||
void encoder_close();
|
||||
private:
|
||||
int fd;
|
||||
|
||||
const char* filename;
|
||||
CameraType type;
|
||||
unsigned int in_width_, in_height_;
|
||||
bool h265;
|
||||
bool is_open = false;
|
||||
int segment_num = -1;
|
||||
int counter = 0;
|
||||
|
||||
std::unique_ptr<PubMaster> pm;
|
||||
const char *service_name;
|
||||
|
||||
static void dequeue_handler(V4LEncoder *e);
|
||||
std::thread dequeue_handler_thread;
|
||||
|
||||
VisionBuf buf_in[BUF_IN_COUNT];
|
||||
VisionBuf buf_out[BUF_OUT_COUNT];
|
||||
SafeQueue<unsigned int> free_buf_in;
|
||||
|
||||
SafeQueue<VisionIpcBufExtra> extras;
|
||||
|
||||
// writing support
|
||||
int width, height, fps;
|
||||
bool write;
|
||||
static void write_handler(V4LEncoder *e, const char *path);
|
||||
std::thread write_handler_thread;
|
||||
SafeQueue<kj::Array<capnp::word>* > to_write;
|
||||
};
|
||||
@@ -48,7 +48,6 @@ VideoWriter::VideoWriter(const char *path, const char *filename, bool remuxing,
|
||||
int err = avio_open(&this->ofmt_ctx->pb, this->vid_path.c_str(), AVIO_FLAG_WRITE);
|
||||
assert(err >= 0);
|
||||
|
||||
this->wrote_codec_config = false;
|
||||
} else {
|
||||
this->of = util::safe_fopen(this->vid_path.c_str(), "wb");
|
||||
assert(this->of);
|
||||
|
||||
@@ -20,6 +20,4 @@ private:
|
||||
AVFormatContext *ofmt_ctx;
|
||||
AVStream *out_stream;
|
||||
bool remuxing, raw;
|
||||
|
||||
bool wrote_codec_config;
|
||||
};
|
||||
1696
third_party/linux/include/v4l2-controls.h
vendored
Normal file
1696
third_party/linux/include/v4l2-controls.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1312
third_party/openmax/include/OMX_Audio.h
vendored
1312
third_party/openmax/include/OMX_Audio.h
vendored
File diff suppressed because it is too large
Load Diff
579
third_party/openmax/include/OMX_Component.h
vendored
579
third_party/openmax/include/OMX_Component.h
vendored
@@ -1,579 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** OMX_Component.h - OpenMax IL version 1.1.2
|
||||
* The OMX_Component header file contains the definitions used to define
|
||||
* the public interface of a component. This header file is intended to
|
||||
* be used by both the application and the component.
|
||||
*/
|
||||
|
||||
#ifndef OMX_Component_h
|
||||
#define OMX_Component_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
|
||||
/* Each OMX header must include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
|
||||
#include <OMX_Audio.h>
|
||||
#include <OMX_Video.h>
|
||||
#include <OMX_Image.h>
|
||||
#include <OMX_Other.h>
|
||||
|
||||
/** @ingroup comp */
|
||||
typedef enum OMX_PORTDOMAINTYPE {
|
||||
OMX_PortDomainAudio,
|
||||
OMX_PortDomainVideo,
|
||||
OMX_PortDomainImage,
|
||||
OMX_PortDomainOther,
|
||||
OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_PortDomainMax = 0x7ffffff
|
||||
} OMX_PORTDOMAINTYPE;
|
||||
|
||||
/** @ingroup comp */
|
||||
typedef struct OMX_PARAM_PORTDEFINITIONTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< Port number the structure applies to */
|
||||
OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */
|
||||
OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */
|
||||
OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */
|
||||
OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */
|
||||
OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by
|
||||
OMX_CommandPortEnable/OMX_CommandPortDisable.
|
||||
When disabled a port is unpopulated. A disabled port
|
||||
is not populated with buffers on a transition to IDLE. */
|
||||
OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by
|
||||
nBufferCountActual. A disabled port is always unpopulated.
|
||||
An enabled port is populated on a transition to OMX_StateIdle
|
||||
and unpopulated on a transition to loaded. */
|
||||
OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */
|
||||
union {
|
||||
OMX_AUDIO_PORTDEFINITIONTYPE audio;
|
||||
OMX_VIDEO_PORTDEFINITIONTYPE video;
|
||||
OMX_IMAGE_PORTDEFINITIONTYPE image;
|
||||
OMX_OTHER_PORTDEFINITIONTYPE other;
|
||||
} format;
|
||||
OMX_BOOL bBuffersContiguous;
|
||||
OMX_U32 nBufferAlignment;
|
||||
} OMX_PARAM_PORTDEFINITIONTYPE;
|
||||
|
||||
/** @ingroup comp */
|
||||
typedef struct OMX_PARAM_U32TYPE {
|
||||
OMX_U32 nSize; /**< Size of this structure, in Bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< port that this structure applies to */
|
||||
OMX_U32 nU32; /**< U32 value */
|
||||
} OMX_PARAM_U32TYPE;
|
||||
|
||||
/** @ingroup rpm */
|
||||
typedef enum OMX_SUSPENSIONPOLICYTYPE {
|
||||
OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */
|
||||
OMX_SuspensionEnabled, /**< Suspension allowed */
|
||||
OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_SuspensionPolicyMax = 0x7fffffff
|
||||
} OMX_SUSPENSIONPOLICYTYPE;
|
||||
|
||||
/** @ingroup rpm */
|
||||
typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_SUSPENSIONPOLICYTYPE ePolicy;
|
||||
} OMX_PARAM_SUSPENSIONPOLICYTYPE;
|
||||
|
||||
/** @ingroup rpm */
|
||||
typedef enum OMX_SUSPENSIONTYPE {
|
||||
OMX_NotSuspended, /**< component is not suspended */
|
||||
OMX_Suspended, /**< component is suspended */
|
||||
OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_SuspendMax = 0x7FFFFFFF
|
||||
} OMX_SUSPENSIONTYPE;
|
||||
|
||||
/** @ingroup rpm */
|
||||
typedef struct OMX_PARAM_SUSPENSIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_SUSPENSIONTYPE eType;
|
||||
} OMX_PARAM_SUSPENSIONTYPE ;
|
||||
|
||||
typedef struct OMX_CONFIG_BOOLEANTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_BOOL bEnabled;
|
||||
} OMX_CONFIG_BOOLEANTYPE;
|
||||
|
||||
/* Parameter specifying the content uri to use. */
|
||||
/** @ingroup cp */
|
||||
typedef struct OMX_PARAM_CONTENTURITYPE
|
||||
{
|
||||
OMX_U32 nSize; /**< size of the structure in bytes, including
|
||||
actual URI name */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U8 contentURI[1]; /**< The URI name */
|
||||
} OMX_PARAM_CONTENTURITYPE;
|
||||
|
||||
/* Parameter specifying the pipe to use. */
|
||||
/** @ingroup cp */
|
||||
typedef struct OMX_PARAM_CONTENTPIPETYPE
|
||||
{
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_HANDLETYPE hPipe; /**< The pipe handle*/
|
||||
} OMX_PARAM_CONTENTPIPETYPE;
|
||||
|
||||
/** @ingroup rpm */
|
||||
typedef struct OMX_RESOURCECONCEALMENTTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment
|
||||
methods (like degrading algorithm quality to
|
||||
lower resource consumption or functional bypass)
|
||||
on a component as a resolution to resource conflicts. */
|
||||
} OMX_RESOURCECONCEALMENTTYPE;
|
||||
|
||||
|
||||
/** @ingroup metadata */
|
||||
typedef enum OMX_METADATACHARSETTYPE {
|
||||
OMX_MetadataCharsetUnknown = 0,
|
||||
OMX_MetadataCharsetASCII,
|
||||
OMX_MetadataCharsetBinary,
|
||||
OMX_MetadataCharsetCodePage1252,
|
||||
OMX_MetadataCharsetUTF8,
|
||||
OMX_MetadataCharsetJavaConformantUTF8,
|
||||
OMX_MetadataCharsetUTF7,
|
||||
OMX_MetadataCharsetImapUTF7,
|
||||
OMX_MetadataCharsetUTF16LE,
|
||||
OMX_MetadataCharsetUTF16BE,
|
||||
OMX_MetadataCharsetGB12345,
|
||||
OMX_MetadataCharsetHZGB2312,
|
||||
OMX_MetadataCharsetGB2312,
|
||||
OMX_MetadataCharsetGB18030,
|
||||
OMX_MetadataCharsetGBK,
|
||||
OMX_MetadataCharsetBig5,
|
||||
OMX_MetadataCharsetISO88591,
|
||||
OMX_MetadataCharsetISO88592,
|
||||
OMX_MetadataCharsetISO88593,
|
||||
OMX_MetadataCharsetISO88594,
|
||||
OMX_MetadataCharsetISO88595,
|
||||
OMX_MetadataCharsetISO88596,
|
||||
OMX_MetadataCharsetISO88597,
|
||||
OMX_MetadataCharsetISO88598,
|
||||
OMX_MetadataCharsetISO88599,
|
||||
OMX_MetadataCharsetISO885910,
|
||||
OMX_MetadataCharsetISO885913,
|
||||
OMX_MetadataCharsetISO885914,
|
||||
OMX_MetadataCharsetISO885915,
|
||||
OMX_MetadataCharsetShiftJIS,
|
||||
OMX_MetadataCharsetISO2022JP,
|
||||
OMX_MetadataCharsetISO2022JP1,
|
||||
OMX_MetadataCharsetISOEUCJP,
|
||||
OMX_MetadataCharsetSMS7Bit,
|
||||
OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_MetadataCharsetTypeMax= 0x7FFFFFFF
|
||||
} OMX_METADATACHARSETTYPE;
|
||||
|
||||
/** @ingroup metadata */
|
||||
typedef enum OMX_METADATASCOPETYPE
|
||||
{
|
||||
OMX_MetadataScopeAllLevels,
|
||||
OMX_MetadataScopeTopLevel,
|
||||
OMX_MetadataScopePortLevel,
|
||||
OMX_MetadataScopeNodeLevel,
|
||||
OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_MetadataScopeTypeMax = 0x7fffffff
|
||||
} OMX_METADATASCOPETYPE;
|
||||
|
||||
/** @ingroup metadata */
|
||||
typedef enum OMX_METADATASEARCHMODETYPE
|
||||
{
|
||||
OMX_MetadataSearchValueSizeByIndex,
|
||||
OMX_MetadataSearchItemByIndex,
|
||||
OMX_MetadataSearchNextItemByKey,
|
||||
OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_MetadataSearchTypeMax = 0x7fffffff
|
||||
} OMX_METADATASEARCHMODETYPE;
|
||||
/** @ingroup metadata */
|
||||
typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE
|
||||
{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_METADATASCOPETYPE eScopeMode;
|
||||
OMX_U32 nScopeSpecifier;
|
||||
OMX_U32 nMetadataItemCount;
|
||||
} OMX_CONFIG_METADATAITEMCOUNTTYPE;
|
||||
|
||||
/** @ingroup metadata */
|
||||
typedef struct OMX_CONFIG_METADATAITEMTYPE
|
||||
{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_METADATASCOPETYPE eScopeMode;
|
||||
OMX_U32 nScopeSpecifier;
|
||||
OMX_U32 nMetadataItemIndex;
|
||||
OMX_METADATASEARCHMODETYPE eSearchMode;
|
||||
OMX_METADATACHARSETTYPE eKeyCharset;
|
||||
OMX_U8 nKeySizeUsed;
|
||||
OMX_U8 nKey[128];
|
||||
OMX_METADATACHARSETTYPE eValueCharset;
|
||||
OMX_STRING sLanguageCountry;
|
||||
OMX_U32 nValueMaxSize;
|
||||
OMX_U32 nValueSizeUsed;
|
||||
OMX_U8 nValue[1];
|
||||
} OMX_CONFIG_METADATAITEMTYPE;
|
||||
|
||||
/* @ingroup metadata */
|
||||
typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE
|
||||
{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_BOOL bAllKeys;
|
||||
OMX_U32 nParentNodeID;
|
||||
OMX_U32 nNumNodes;
|
||||
} OMX_CONFIG_CONTAINERNODECOUNTTYPE;
|
||||
|
||||
/** @ingroup metadata */
|
||||
typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE
|
||||
{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_BOOL bAllKeys;
|
||||
OMX_U32 nParentNodeID;
|
||||
OMX_U32 nNodeIndex;
|
||||
OMX_U32 nNodeID;
|
||||
OMX_STRING cNodeName;
|
||||
OMX_BOOL bIsLeafType;
|
||||
} OMX_CONFIG_CONTAINERNODEIDTYPE;
|
||||
|
||||
/** @ingroup metadata */
|
||||
typedef struct OMX_PARAM_METADATAFILTERTYPE
|
||||
{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and
|
||||
* the three key fields below are ignored */
|
||||
OMX_METADATACHARSETTYPE eKeyCharset;
|
||||
OMX_U32 nKeySizeUsed;
|
||||
OMX_U8 nKey [128];
|
||||
OMX_U32 nLanguageCountrySizeUsed;
|
||||
OMX_U8 nLanguageCountry[128];
|
||||
OMX_BOOL bEnabled; /* if true then key is part of filter (e.g.
|
||||
* retained for query later). If false then
|
||||
* key is not part of filter */
|
||||
} OMX_PARAM_METADATAFILTERTYPE;
|
||||
|
||||
/** The OMX_HANDLETYPE structure defines the component handle. The component
|
||||
* handle is used to access all of the component's public methods and also
|
||||
* contains pointers to the component's private data area. The component
|
||||
* handle is initialized by the OMX core (with help from the component)
|
||||
* during the process of loading the component. After the component is
|
||||
* successfully loaded, the application can safely access any of the
|
||||
* component's public functions (although some may return an error because
|
||||
* the state is inappropriate for the access).
|
||||
*
|
||||
* @ingroup comp
|
||||
*/
|
||||
typedef struct OMX_COMPONENTTYPE
|
||||
{
|
||||
/** The size of this structure, in bytes. It is the responsibility
|
||||
of the allocator of this structure to fill in this value. Since
|
||||
this structure is allocated by the GetHandle function, this
|
||||
function will fill in this value. */
|
||||
OMX_U32 nSize;
|
||||
|
||||
/** nVersion is the version of the OMX specification that the structure
|
||||
is built against. It is the responsibility of the creator of this
|
||||
structure to initialize this value and every user of this structure
|
||||
should verify that it knows how to use the exact version of
|
||||
this structure found herein. */
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
|
||||
/** pComponentPrivate is a pointer to the component private data area.
|
||||
This member is allocated and initialized by the component when the
|
||||
component is first loaded. The application should not access this
|
||||
data area. */
|
||||
OMX_PTR pComponentPrivate;
|
||||
|
||||
/** pApplicationPrivate is a pointer that is a parameter to the
|
||||
OMX_GetHandle method, and contains an application private value
|
||||
provided by the IL client. This application private data is
|
||||
returned to the IL Client by OMX in all callbacks */
|
||||
OMX_PTR pApplicationPrivate;
|
||||
|
||||
/** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL
|
||||
specification for details on the GetComponentVersion method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*GetComponentVersion)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_OUT OMX_STRING pComponentName,
|
||||
OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
|
||||
OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
|
||||
OMX_OUT OMX_UUIDTYPE* pComponentUUID);
|
||||
|
||||
/** refer to OMX_SendCommand in OMX_core.h or the OMX IL
|
||||
specification for details on the SendCommand method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*SendCommand)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_COMMANDTYPE Cmd,
|
||||
OMX_IN OMX_U32 nParam1,
|
||||
OMX_IN OMX_PTR pCmdData);
|
||||
|
||||
/** refer to OMX_GetParameter in OMX_core.h or the OMX IL
|
||||
specification for details on the GetParameter method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*GetParameter)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_INDEXTYPE nParamIndex,
|
||||
OMX_INOUT OMX_PTR pComponentParameterStructure);
|
||||
|
||||
|
||||
/** refer to OMX_SetParameter in OMX_core.h or the OMX IL
|
||||
specification for details on the SetParameter method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*SetParameter)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_INDEXTYPE nIndex,
|
||||
OMX_IN OMX_PTR pComponentParameterStructure);
|
||||
|
||||
|
||||
/** refer to OMX_GetConfig in OMX_core.h or the OMX IL
|
||||
specification for details on the GetConfig method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*GetConfig)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_INDEXTYPE nIndex,
|
||||
OMX_INOUT OMX_PTR pComponentConfigStructure);
|
||||
|
||||
|
||||
/** refer to OMX_SetConfig in OMX_core.h or the OMX IL
|
||||
specification for details on the SetConfig method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*SetConfig)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_INDEXTYPE nIndex,
|
||||
OMX_IN OMX_PTR pComponentConfigStructure);
|
||||
|
||||
|
||||
/** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL
|
||||
specification for details on the GetExtensionIndex method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*GetExtensionIndex)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_STRING cParameterName,
|
||||
OMX_OUT OMX_INDEXTYPE* pIndexType);
|
||||
|
||||
|
||||
/** refer to OMX_GetState in OMX_core.h or the OMX IL
|
||||
specification for details on the GetState method.
|
||||
*/
|
||||
OMX_ERRORTYPE (*GetState)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_OUT OMX_STATETYPE* pState);
|
||||
|
||||
|
||||
/** The ComponentTunnelRequest method will interact with another OMX
|
||||
component to determine if tunneling is possible and to setup the
|
||||
tunneling. The return codes for this method can be used to
|
||||
determine if tunneling is not possible, or if tunneling is not
|
||||
supported.
|
||||
|
||||
Base profile components (i.e. non-interop) do not support this
|
||||
method and should return OMX_ErrorNotImplemented
|
||||
|
||||
The interop profile component MUST support tunneling to another
|
||||
interop profile component with a compatible port parameters.
|
||||
A component may also support proprietary communication.
|
||||
|
||||
If proprietary communication is supported the negotiation of
|
||||
proprietary communication is done outside of OMX in a vendor
|
||||
specific way. It is only required that the proper result be
|
||||
returned and the details of how the setup is done is left
|
||||
to the component implementation.
|
||||
|
||||
When this method is invoked when nPort in an output port, the
|
||||
component will:
|
||||
1. Populate the pTunnelSetup structure with the output port's
|
||||
requirements and constraints for the tunnel.
|
||||
|
||||
When this method is invoked when nPort in an input port, the
|
||||
component will:
|
||||
1. Query the necessary parameters from the output port to
|
||||
determine if the ports are compatible for tunneling
|
||||
2. If the ports are compatible, the component should store
|
||||
the tunnel step provided by the output port
|
||||
3. Determine which port (either input or output) is the buffer
|
||||
supplier, and call OMX_SetParameter on the output port to
|
||||
indicate this selection.
|
||||
|
||||
The component will return from this call within 5 msec.
|
||||
|
||||
@param [in] hComp
|
||||
Handle of the component to be accessed. This is the component
|
||||
handle returned by the call to the OMX_GetHandle method.
|
||||
@param [in] nPort
|
||||
nPort is used to select the port on the component to be used
|
||||
for tunneling.
|
||||
@param [in] hTunneledComp
|
||||
Handle of the component to tunnel with. This is the component
|
||||
handle returned by the call to the OMX_GetHandle method. When
|
||||
this parameter is 0x0 the component should setup the port for
|
||||
communication with the application / IL Client.
|
||||
@param [in] nPortOutput
|
||||
nPortOutput is used indicate the port the component should
|
||||
tunnel with.
|
||||
@param [in] pTunnelSetup
|
||||
Pointer to the tunnel setup structure. When nPort is an output port
|
||||
the component should populate the fields of this structure. When
|
||||
When nPort is an input port the component should review the setup
|
||||
provided by the component with the output port.
|
||||
@return OMX_ERRORTYPE
|
||||
If the command successfully executes, the return code will be
|
||||
OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
|
||||
@ingroup tun
|
||||
*/
|
||||
|
||||
OMX_ERRORTYPE (*ComponentTunnelRequest)(
|
||||
OMX_IN OMX_HANDLETYPE hComp,
|
||||
OMX_IN OMX_U32 nPort,
|
||||
OMX_IN OMX_HANDLETYPE hTunneledComp,
|
||||
OMX_IN OMX_U32 nTunneledPort,
|
||||
OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup);
|
||||
|
||||
/** refer to OMX_UseBuffer in OMX_core.h or the OMX IL
|
||||
specification for details on the UseBuffer method.
|
||||
@ingroup buf
|
||||
*/
|
||||
OMX_ERRORTYPE (*UseBuffer)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
|
||||
OMX_IN OMX_U32 nPortIndex,
|
||||
OMX_IN OMX_PTR pAppPrivate,
|
||||
OMX_IN OMX_U32 nSizeBytes,
|
||||
OMX_IN OMX_U8* pBuffer);
|
||||
|
||||
/** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL
|
||||
specification for details on the AllocateBuffer method.
|
||||
@ingroup buf
|
||||
*/
|
||||
OMX_ERRORTYPE (*AllocateBuffer)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer,
|
||||
OMX_IN OMX_U32 nPortIndex,
|
||||
OMX_IN OMX_PTR pAppPrivate,
|
||||
OMX_IN OMX_U32 nSizeBytes);
|
||||
|
||||
/** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL
|
||||
specification for details on the FreeBuffer method.
|
||||
@ingroup buf
|
||||
*/
|
||||
OMX_ERRORTYPE (*FreeBuffer)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_U32 nPortIndex,
|
||||
OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
|
||||
/** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL
|
||||
specification for details on the EmptyThisBuffer method.
|
||||
@ingroup buf
|
||||
*/
|
||||
OMX_ERRORTYPE (*EmptyThisBuffer)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
|
||||
/** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL
|
||||
specification for details on the FillThisBuffer method.
|
||||
@ingroup buf
|
||||
*/
|
||||
OMX_ERRORTYPE (*FillThisBuffer)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
|
||||
/** The SetCallbacks method is used by the core to specify the callback
|
||||
structure from the application to the component. This is a blocking
|
||||
call. The component will return from this call within 5 msec.
|
||||
@param [in] hComponent
|
||||
Handle of the component to be accessed. This is the component
|
||||
handle returned by the call to the GetHandle function.
|
||||
@param [in] pCallbacks
|
||||
pointer to an OMX_CALLBACKTYPE structure used to provide the
|
||||
callback information to the component
|
||||
@param [in] pAppData
|
||||
pointer to an application defined value. It is anticipated that
|
||||
the application will pass a pointer to a data structure or a "this
|
||||
pointer" in this area to allow the callback (in the application)
|
||||
to determine the context of the call
|
||||
@return OMX_ERRORTYPE
|
||||
If the command successfully executes, the return code will be
|
||||
OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
|
||||
*/
|
||||
OMX_ERRORTYPE (*SetCallbacks)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_IN OMX_CALLBACKTYPE* pCallbacks,
|
||||
OMX_IN OMX_PTR pAppData);
|
||||
|
||||
/** ComponentDeInit method is used to deinitialize the component
|
||||
providing a means to free any resources allocated at component
|
||||
initialization. NOTE: After this call the component handle is
|
||||
not valid for further use.
|
||||
@param [in] hComponent
|
||||
Handle of the component to be accessed. This is the component
|
||||
handle returned by the call to the GetHandle function.
|
||||
@return OMX_ERRORTYPE
|
||||
If the command successfully executes, the return code will be
|
||||
OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
|
||||
*/
|
||||
OMX_ERRORTYPE (*ComponentDeInit)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent);
|
||||
|
||||
/** @ingroup buf */
|
||||
OMX_ERRORTYPE (*UseEGLImage)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
|
||||
OMX_IN OMX_U32 nPortIndex,
|
||||
OMX_IN OMX_PTR pAppPrivate,
|
||||
OMX_IN void* eglImage);
|
||||
|
||||
OMX_ERRORTYPE (*ComponentRoleEnum)(
|
||||
OMX_IN OMX_HANDLETYPE hComponent,
|
||||
OMX_OUT OMX_U8 *cRole,
|
||||
OMX_IN OMX_U32 nIndex);
|
||||
|
||||
} OMX_COMPONENTTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
||||
195
third_party/openmax/include/OMX_ContentPipe.h
vendored
195
third_party/openmax/include/OMX_ContentPipe.h
vendored
@@ -1,195 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** OMX_ContentPipe.h - OpenMax IL version 1.1.2
|
||||
* The OMX_ContentPipe header file contains the definitions used to define
|
||||
* the public interface for content piples. This header file is intended to
|
||||
* be used by the component.
|
||||
*/
|
||||
|
||||
#ifndef OMX_CONTENTPIPE_H
|
||||
#define OMX_CONTENTPIPE_H
|
||||
|
||||
#ifndef KD_EACCES
|
||||
/* OpenKODE error codes. CPResult values may be zero (indicating success
|
||||
or one of the following values) */
|
||||
#define KD_EACCES (1)
|
||||
#define KD_EADDRINUSE (2)
|
||||
#define KD_EAGAIN (5)
|
||||
#define KD_EBADF (7)
|
||||
#define KD_EBUSY (8)
|
||||
#define KD_ECONNREFUSED (9)
|
||||
#define KD_ECONNRESET (10)
|
||||
#define KD_EDEADLK (11)
|
||||
#define KD_EDESTADDRREQ (12)
|
||||
#define KD_ERANGE (35)
|
||||
#define KD_EEXIST (13)
|
||||
#define KD_EFBIG (14)
|
||||
#define KD_EHOSTUNREACH (15)
|
||||
#define KD_EINVAL (17)
|
||||
#define KD_EIO (18)
|
||||
#define KD_EISCONN (20)
|
||||
#define KD_EISDIR (21)
|
||||
#define KD_EMFILE (22)
|
||||
#define KD_ENAMETOOLONG (23)
|
||||
#define KD_ENOENT (24)
|
||||
#define KD_ENOMEM (25)
|
||||
#define KD_ENOSPC (26)
|
||||
#define KD_ENOSYS (27)
|
||||
#define KD_ENOTCONN (28)
|
||||
#define KD_EPERM (33)
|
||||
#define KD_ETIMEDOUT (36)
|
||||
#define KD_EILSEQ (19)
|
||||
#endif
|
||||
|
||||
/** Map types from OMX standard types only here so interface is as generic as possible. */
|
||||
typedef OMX_U32 CPresult;
|
||||
typedef char * CPstring;
|
||||
typedef void * CPhandle;
|
||||
typedef OMX_U32 CPuint;
|
||||
typedef OMX_S32 CPint;
|
||||
typedef char CPbyte;
|
||||
typedef OMX_BOOL CPbool;
|
||||
|
||||
/** enumeration of origin types used in the CP_PIPETYPE's Seek function
|
||||
* @ingroup cp
|
||||
*/
|
||||
typedef enum CP_ORIGINTYPE {
|
||||
CP_OriginBegin,
|
||||
CP_OriginCur,
|
||||
CP_OriginEnd,
|
||||
CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
CP_OriginMax = 0X7FFFFFFF
|
||||
} CP_ORIGINTYPE;
|
||||
|
||||
/** enumeration of contact access types used in the CP_PIPETYPE's Open function
|
||||
* @ingroup cp
|
||||
*/
|
||||
typedef enum CP_ACCESSTYPE {
|
||||
CP_AccessRead,
|
||||
CP_AccessWrite,
|
||||
CP_AccessReadWrite ,
|
||||
CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
CP_AccessMax = 0X7FFFFFFF
|
||||
} CP_ACCESSTYPE;
|
||||
|
||||
/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
|
||||
* @ingroup cp
|
||||
*/
|
||||
typedef enum CP_CHECKBYTESRESULTTYPE
|
||||
{
|
||||
CP_CheckBytesOk, /**< There are at least the request number
|
||||
of bytes available */
|
||||
CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
|
||||
and presently lacks sufficient bytes.
|
||||
Client will be called when they are
|
||||
sufficient bytes are available. */
|
||||
CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
|
||||
but those available are less than those
|
||||
requested */
|
||||
CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream
|
||||
and no more bytes are available. */
|
||||
CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */
|
||||
CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
CP_CheckBytesMax = 0X7FFFFFFF
|
||||
} CP_CHECKBYTESRESULTTYPE;
|
||||
|
||||
/** enumeration of content pipe events sent to the client callback.
|
||||
* @ingroup cp
|
||||
*/
|
||||
typedef enum CP_EVENTTYPE{
|
||||
CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/
|
||||
CP_Overflow, /** enumeration of content pipe events sent to the client callback*/
|
||||
CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/
|
||||
CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
CP_EventMax = 0X7FFFFFFF
|
||||
} CP_EVENTTYPE;
|
||||
|
||||
/** content pipe definition
|
||||
* @ingroup cp
|
||||
*/
|
||||
typedef struct CP_PIPETYPE
|
||||
{
|
||||
/** Open a content stream for reading or writing. */
|
||||
CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
|
||||
|
||||
/** Close a content stream. */
|
||||
CPresult (*Close)( CPhandle hContent );
|
||||
|
||||
/** Create a content source and open it for writing. */
|
||||
CPresult (*Create)( CPhandle *hContent, CPstring szURI );
|
||||
|
||||
/** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
|
||||
CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
|
||||
|
||||
/** Seek to certain position in the content relative to the specified origin. */
|
||||
CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
|
||||
|
||||
/** Retrieve the current position relative to the start of the content. */
|
||||
CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
|
||||
|
||||
/** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
|
||||
Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
|
||||
CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
|
||||
|
||||
/** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
|
||||
Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
|
||||
returns the size of the block actually read. Content pointer advances the by the returned size.
|
||||
Note: pipe provides pointer. This function is appropriate for large reads. The client must call
|
||||
ReleaseReadBuffer when done with buffer.
|
||||
|
||||
In some cases the requested block may not reside in contiguous memory within the
|
||||
pipe implementation. For instance if the pipe leverages a circular buffer then the requested
|
||||
block may straddle the boundary of the circular buffer. By default a pipe implementation
|
||||
performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
|
||||
If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
|
||||
boundary. Here the client may retrieve the data in segments over successive calls. */
|
||||
CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
|
||||
|
||||
/** Release a buffer obtained by ReadBuffer back to the pipe. */
|
||||
CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
|
||||
|
||||
/** Write data of the specified size to the content (advance content pointer by size of data).
|
||||
Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
|
||||
CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
|
||||
|
||||
/** Retrieve a buffer allocated by the pipe used to write data to the content.
|
||||
Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
|
||||
for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
|
||||
CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
|
||||
|
||||
/** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
|
||||
the contents of the buffer to content and advance content pointer by the size of the buffer */
|
||||
CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
|
||||
|
||||
/** Register a per-handle client callback with the content pipe. */
|
||||
CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
|
||||
|
||||
} CP_PIPETYPE;
|
||||
|
||||
#endif
|
||||
|
||||
1440
third_party/openmax/include/OMX_Core.h
vendored
1440
third_party/openmax/include/OMX_Core.h
vendored
File diff suppressed because it is too large
Load Diff
66
third_party/openmax/include/OMX_CoreExt.h
vendored
66
third_party/openmax/include/OMX_CoreExt.h
vendored
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2009 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** OMX_CoreExt.h - OpenMax IL version 1.1.2
|
||||
* The OMX_CoreExt header file contains extensions to the definitions used
|
||||
* by both the application and the component to access common items.
|
||||
*/
|
||||
|
||||
#ifndef OMX_CoreExt_h
|
||||
#define OMX_CoreExt_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Each OMX header shall include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
#include <OMX_Core.h>
|
||||
|
||||
|
||||
/** Event type extensions. */
|
||||
typedef enum OMX_EVENTEXTTYPE
|
||||
{
|
||||
OMX_EventIndexSettingChanged = OMX_EventKhronosExtensions, /**< component signals the IL client of a change
|
||||
in a param, config, or extension */
|
||||
OMX_EventExtMax = 0x7FFFFFFF
|
||||
} OMX_EVENTEXTTYPE;
|
||||
|
||||
|
||||
/** Enable or disable a callback event. */
|
||||
typedef struct OMX_CONFIG_CALLBACKREQUESTTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< port that this structure applies to */
|
||||
OMX_INDEXTYPE nIndex; /**< the index the callback is requested for */
|
||||
OMX_BOOL bEnable; /**< enable (OMX_TRUE) or disable (OMX_FALSE) the callback */
|
||||
} OMX_CONFIG_CALLBACKREQUESTTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* OMX_CoreExt_h */
|
||||
/* File EOF */
|
||||
933
third_party/openmax/include/OMX_IVCommon.h
vendored
933
third_party/openmax/include/OMX_IVCommon.h
vendored
@@ -1,933 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file OMX_IVCommon.h - OpenMax IL version 1.1.2
|
||||
* The structures needed by Video and Image components to exchange
|
||||
* parameters and configuration data with the components.
|
||||
*/
|
||||
#ifndef OMX_IVCommon_h
|
||||
#define OMX_IVCommon_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* Each OMX header must include all required header files to allow the header
|
||||
* to compile without errors. The includes below are required for this header
|
||||
* file to compile successfully
|
||||
*/
|
||||
|
||||
#include <OMX_Core.h>
|
||||
|
||||
/** @defgroup iv OpenMAX IL Imaging and Video Domain
|
||||
* Common structures for OpenMAX IL Imaging and Video domains
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration defining possible uncompressed image/video formats.
|
||||
*
|
||||
* ENUMS:
|
||||
* Unused : Placeholder value when format is N/A
|
||||
* Monochrome : black and white
|
||||
* 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0
|
||||
* 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0
|
||||
* 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0
|
||||
* 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0
|
||||
* 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0
|
||||
* 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0
|
||||
* 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0
|
||||
* 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0
|
||||
* 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0
|
||||
* 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0
|
||||
* 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0
|
||||
* 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0
|
||||
* 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0
|
||||
* 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0
|
||||
* 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0
|
||||
* YUV411Planar : U,Y are subsampled by a factor of 4 horizontally
|
||||
* YUV411PackedPlanar : packed per payload in planar slices
|
||||
* YUV420Planar : Three arrays Y,U,V.
|
||||
* YUV420PackedPlanar : packed per payload in planar slices
|
||||
* YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V
|
||||
* YUV422Planar : Three arrays Y,U,V.
|
||||
* YUV422PackedPlanar : packed per payload in planar slices
|
||||
* YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V
|
||||
* YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr)
|
||||
* YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb)
|
||||
* CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY)
|
||||
* CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY)
|
||||
* YUV444Interleaved : Each pixel contains equal parts YUV
|
||||
* RawBayer8bit : SMIA camera output format
|
||||
* RawBayer10bit : SMIA camera output format
|
||||
* RawBayer8bitcompressed : SMIA camera output format
|
||||
*/
|
||||
typedef enum OMX_COLOR_FORMATTYPE {
|
||||
OMX_COLOR_FormatUnused,
|
||||
OMX_COLOR_FormatMonochrome,
|
||||
OMX_COLOR_Format8bitRGB332,
|
||||
OMX_COLOR_Format12bitRGB444,
|
||||
OMX_COLOR_Format16bitARGB4444,
|
||||
OMX_COLOR_Format16bitARGB1555,
|
||||
OMX_COLOR_Format16bitRGB565,
|
||||
OMX_COLOR_Format16bitBGR565,
|
||||
OMX_COLOR_Format18bitRGB666,
|
||||
OMX_COLOR_Format18bitARGB1665,
|
||||
OMX_COLOR_Format19bitARGB1666,
|
||||
OMX_COLOR_Format24bitRGB888,
|
||||
OMX_COLOR_Format24bitBGR888,
|
||||
OMX_COLOR_Format24bitARGB1887,
|
||||
OMX_COLOR_Format25bitARGB1888,
|
||||
OMX_COLOR_Format32bitBGRA8888,
|
||||
OMX_COLOR_Format32bitARGB8888,
|
||||
OMX_COLOR_FormatYUV411Planar,
|
||||
OMX_COLOR_FormatYUV411PackedPlanar,
|
||||
OMX_COLOR_FormatYUV420Planar,
|
||||
OMX_COLOR_FormatYUV420PackedPlanar,
|
||||
OMX_COLOR_FormatYUV420SemiPlanar,
|
||||
OMX_COLOR_FormatYUV422Planar,
|
||||
OMX_COLOR_FormatYUV422PackedPlanar,
|
||||
OMX_COLOR_FormatYUV422SemiPlanar,
|
||||
OMX_COLOR_FormatYCbYCr,
|
||||
OMX_COLOR_FormatYCrYCb,
|
||||
OMX_COLOR_FormatCbYCrY,
|
||||
OMX_COLOR_FormatCrYCbY,
|
||||
OMX_COLOR_FormatYUV444Interleaved,
|
||||
OMX_COLOR_FormatRawBayer8bit,
|
||||
OMX_COLOR_FormatRawBayer10bit,
|
||||
OMX_COLOR_FormatRawBayer8bitcompressed,
|
||||
OMX_COLOR_FormatL2,
|
||||
OMX_COLOR_FormatL4,
|
||||
OMX_COLOR_FormatL8,
|
||||
OMX_COLOR_FormatL16,
|
||||
OMX_COLOR_FormatL24,
|
||||
OMX_COLOR_FormatL32,
|
||||
OMX_COLOR_FormatYUV420PackedSemiPlanar,
|
||||
OMX_COLOR_FormatYUV422PackedSemiPlanar,
|
||||
OMX_COLOR_Format18BitBGR666,
|
||||
OMX_COLOR_Format24BitARGB6666,
|
||||
OMX_COLOR_Format24BitABGR6666,
|
||||
OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
/**<Reserved android opaque colorformat. Tells the encoder that
|
||||
* the actual colorformat will be relayed by the
|
||||
* Gralloc Buffers.
|
||||
* FIXME: In the process of reserving some enum values for
|
||||
* Android-specific OMX IL colorformats. Change this enum to
|
||||
* an acceptable range once that is done.
|
||||
* */
|
||||
OMX_COLOR_FormatAndroidOpaque = 0x7F000789,
|
||||
OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100,
|
||||
OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
|
||||
OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
|
||||
OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002,
|
||||
OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m = 0x7FA30C04,
|
||||
OMX_COLOR_FormatMax = 0x7FFFFFFF
|
||||
} OMX_COLOR_FORMATTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines the matrix for conversion from RGB to YUV or vice versa.
|
||||
* iColorMatrix should be initialized with the fixed point values
|
||||
* used in converting between formats.
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
|
||||
OMX_U32 nPortIndex; /**< Port that this struct applies to */
|
||||
OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */
|
||||
OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */
|
||||
}OMX_CONFIG_COLORCONVERSIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure defining percent to scale each frame dimension. For example:
|
||||
* To make the width 50% larger, use fWidth = 1.5 and to make the width
|
||||
* 1/2 the original size, use fWidth = 0.5
|
||||
*/
|
||||
typedef struct OMX_CONFIG_SCALEFACTORTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
|
||||
OMX_U32 nPortIndex; /**< Port that this struct applies to */
|
||||
OMX_S32 xWidth; /**< Fixed point value stored as Q16 */
|
||||
OMX_S32 xHeight; /**< Fixed point value stored as Q16 */
|
||||
}OMX_CONFIG_SCALEFACTORTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration of possible image filter types
|
||||
*/
|
||||
typedef enum OMX_IMAGEFILTERTYPE {
|
||||
OMX_ImageFilterNone,
|
||||
OMX_ImageFilterNoise,
|
||||
OMX_ImageFilterEmboss,
|
||||
OMX_ImageFilterNegative,
|
||||
OMX_ImageFilterSketch,
|
||||
OMX_ImageFilterOilPaint,
|
||||
OMX_ImageFilterHatch,
|
||||
OMX_ImageFilterGpen,
|
||||
OMX_ImageFilterAntialias,
|
||||
OMX_ImageFilterDeRing,
|
||||
OMX_ImageFilterSolarize,
|
||||
OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_ImageFilterMax = 0x7FFFFFFF
|
||||
} OMX_IMAGEFILTERTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Image filter configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eImageFilter : Image filter type enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_IMAGEFILTERTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_IMAGEFILTERTYPE eImageFilter;
|
||||
} OMX_CONFIG_IMAGEFILTERTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Customized U and V for color enhancement
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bColorEnhancement : Enable/disable color enhancement
|
||||
* nCustomizedU : Practical values: 16-240, range: 0-255, value set for
|
||||
* U component
|
||||
* nCustomizedV : Practical values: 16-240, range: 0-255, value set for
|
||||
* V component
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bColorEnhancement;
|
||||
OMX_U8 nCustomizedU;
|
||||
OMX_U8 nCustomizedV;
|
||||
} OMX_CONFIG_COLORENHANCEMENTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define color key and color key mask
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nARGBColor : 32bit Alpha, Red, Green, Blue Color
|
||||
* nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORKEYTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nARGBColor;
|
||||
OMX_U32 nARGBMask;
|
||||
} OMX_CONFIG_COLORKEYTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* List of color blend types for pre/post processing
|
||||
*
|
||||
* ENUMS:
|
||||
* None : No color blending present
|
||||
* AlphaConstant : Function is (alpha_constant * src) +
|
||||
* (1 - alpha_constant) * dst)
|
||||
* AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)
|
||||
* Alternate : Function is alternating pixels from src and dst
|
||||
* And : Function is (src & dst)
|
||||
* Or : Function is (src | dst)
|
||||
* Invert : Function is ~src
|
||||
*/
|
||||
typedef enum OMX_COLORBLENDTYPE {
|
||||
OMX_ColorBlendNone,
|
||||
OMX_ColorBlendAlphaConstant,
|
||||
OMX_ColorBlendAlphaPerPixel,
|
||||
OMX_ColorBlendAlternate,
|
||||
OMX_ColorBlendAnd,
|
||||
OMX_ColorBlendOr,
|
||||
OMX_ColorBlendInvert,
|
||||
OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_ColorBlendMax = 0x7FFFFFFF
|
||||
} OMX_COLORBLENDTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Color blend configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nRGBAlphaConstant : Constant global alpha values when global alpha is used
|
||||
* eColorBlend : Color blend type enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORBLENDTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nRGBAlphaConstant;
|
||||
OMX_COLORBLENDTYPE eColorBlend;
|
||||
} OMX_CONFIG_COLORBLENDTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Hold frame dimension
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nWidth : Frame width in pixels
|
||||
* nHeight : Frame height in pixels
|
||||
*/
|
||||
typedef struct OMX_FRAMESIZETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nWidth;
|
||||
OMX_U32 nHeight;
|
||||
} OMX_FRAMESIZETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Rotation configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nRotation : +/- integer rotation value
|
||||
*/
|
||||
typedef struct OMX_CONFIG_ROTATIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nRotation;
|
||||
} OMX_CONFIG_ROTATIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Possible mirroring directions for pre/post processing
|
||||
*
|
||||
* ENUMS:
|
||||
* None : No mirroring
|
||||
* Vertical : Vertical mirroring, flip on X axis
|
||||
* Horizontal : Horizontal mirroring, flip on Y axis
|
||||
* Both : Both vertical and horizontal mirroring
|
||||
*/
|
||||
typedef enum OMX_MIRRORTYPE {
|
||||
OMX_MirrorNone = 0,
|
||||
OMX_MirrorVertical,
|
||||
OMX_MirrorHorizontal,
|
||||
OMX_MirrorBoth,
|
||||
OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_MirrorMax = 0x7FFFFFFF
|
||||
} OMX_MIRRORTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Mirroring configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eMirror : Mirror type enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_MIRRORTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_MIRRORTYPE eMirror;
|
||||
} OMX_CONFIG_MIRRORTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Position information only
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nX : X coordinate for the point
|
||||
* nY : Y coordinate for the point
|
||||
*/
|
||||
typedef struct OMX_CONFIG_POINTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nX;
|
||||
OMX_S32 nY;
|
||||
} OMX_CONFIG_POINTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Frame size plus position
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nLeft : X Coordinate of the top left corner of the rectangle
|
||||
* nTop : Y Coordinate of the top left corner of the rectangle
|
||||
* nWidth : Width of the rectangle
|
||||
* nHeight : Height of the rectangle
|
||||
*/
|
||||
typedef struct OMX_CONFIG_RECTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nLeft;
|
||||
OMX_S32 nTop;
|
||||
OMX_U32 nWidth;
|
||||
OMX_U32 nHeight;
|
||||
} OMX_CONFIG_RECTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Deblocking state; it is required to be set up before starting the codec
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bDeblocking : Enable/disable deblocking mode
|
||||
*/
|
||||
typedef struct OMX_PARAM_DEBLOCKINGTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bDeblocking;
|
||||
} OMX_PARAM_DEBLOCKINGTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Stabilization state
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bStab : Enable/disable frame stabilization state
|
||||
*/
|
||||
typedef struct OMX_CONFIG_FRAMESTABTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bStab;
|
||||
} OMX_CONFIG_FRAMESTABTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* White Balance control type
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* SunLight : Referenced in JSR-234
|
||||
* Flash : Optimal for device's integrated flash
|
||||
*/
|
||||
typedef enum OMX_WHITEBALCONTROLTYPE {
|
||||
OMX_WhiteBalControlOff = 0,
|
||||
OMX_WhiteBalControlAuto,
|
||||
OMX_WhiteBalControlSunLight,
|
||||
OMX_WhiteBalControlCloudy,
|
||||
OMX_WhiteBalControlShade,
|
||||
OMX_WhiteBalControlTungsten,
|
||||
OMX_WhiteBalControlFluorescent,
|
||||
OMX_WhiteBalControlIncandescent,
|
||||
OMX_WhiteBalControlFlash,
|
||||
OMX_WhiteBalControlHorizon,
|
||||
OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_WhiteBalControlMax = 0x7FFFFFFF
|
||||
} OMX_WHITEBALCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* White Balance control configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eWhiteBalControl : White balance enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_WHITEBALCONTROLTYPE eWhiteBalControl;
|
||||
} OMX_CONFIG_WHITEBALCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Exposure control type
|
||||
*/
|
||||
typedef enum OMX_EXPOSURECONTROLTYPE {
|
||||
OMX_ExposureControlOff = 0,
|
||||
OMX_ExposureControlAuto,
|
||||
OMX_ExposureControlNight,
|
||||
OMX_ExposureControlBackLight,
|
||||
OMX_ExposureControlSpotLight,
|
||||
OMX_ExposureControlSports,
|
||||
OMX_ExposureControlSnow,
|
||||
OMX_ExposureControlBeach,
|
||||
OMX_ExposureControlLargeAperture,
|
||||
OMX_ExposureControlSmallApperture,
|
||||
OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_ExposureControlMax = 0x7FFFFFFF
|
||||
} OMX_EXPOSURECONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* White Balance control configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eExposureControl : Exposure control enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_EXPOSURECONTROLTYPE eExposureControl;
|
||||
} OMX_CONFIG_EXPOSURECONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines sensor supported mode.
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nFrameRate : Single shot mode is indicated by a 0
|
||||
* bOneShot : Enable for single shot, disable for streaming
|
||||
* sFrameSize : Framesize
|
||||
*/
|
||||
typedef struct OMX_PARAM_SENSORMODETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nFrameRate;
|
||||
OMX_BOOL bOneShot;
|
||||
OMX_FRAMESIZETYPE sFrameSize;
|
||||
} OMX_PARAM_SENSORMODETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines contrast level
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nContrast : Values allowed for contrast -100 to 100, zero means no change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_CONTRASTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nContrast;
|
||||
} OMX_CONFIG_CONTRASTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines brightness level
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nBrightness : 0-100%
|
||||
*/
|
||||
typedef struct OMX_CONFIG_BRIGHTNESSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nBrightness;
|
||||
} OMX_CONFIG_BRIGHTNESSTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines backlight level configuration for a video sink, e.g. LCD panel
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nBacklight : Values allowed for backlight 0-100%
|
||||
* nTimeout : Number of milliseconds before backlight automatically turns
|
||||
* off. A value of 0x0 disables backight timeout
|
||||
*/
|
||||
typedef struct OMX_CONFIG_BACKLIGHTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nBacklight;
|
||||
OMX_U32 nTimeout;
|
||||
} OMX_CONFIG_BACKLIGHTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines setting for Gamma
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nGamma : Values allowed for gamma -100 to 100, zero means no change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_GAMMATYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nGamma;
|
||||
} OMX_CONFIG_GAMMATYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define for setting saturation
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nSaturation : Values allowed for saturation -100 to 100, zero means
|
||||
* no change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_SATURATIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nSaturation;
|
||||
} OMX_CONFIG_SATURATIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define for setting Lightness
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nLightness : Values allowed for lightness -100 to 100, zero means no
|
||||
* change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_LIGHTNESSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nLightness;
|
||||
} OMX_CONFIG_LIGHTNESSTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Plane blend configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Index of input port associated with the plane.
|
||||
* nDepth : Depth of the plane in relation to the screen. Higher
|
||||
* numbered depths are "behind" lower number depths.
|
||||
* This number defaults to the Port Index number.
|
||||
* nAlpha : Transparency blending component for the entire plane.
|
||||
* See blending modes for more detail.
|
||||
*/
|
||||
typedef struct OMX_CONFIG_PLANEBLENDTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nDepth;
|
||||
OMX_U32 nAlpha;
|
||||
} OMX_CONFIG_PLANEBLENDTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define interlace type
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bEnable : Enable control variable for this functionality
|
||||
* (see below)
|
||||
* nInterleavePortIndex : Index of input or output port associated with
|
||||
* the interleaved plane.
|
||||
* pPlanarPortIndexes[4] : Index of input or output planar ports.
|
||||
*/
|
||||
typedef struct OMX_PARAM_INTERLEAVETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bEnable;
|
||||
OMX_U32 nInterleavePortIndex;
|
||||
} OMX_PARAM_INTERLEAVETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines the picture effect used for an input picture
|
||||
*/
|
||||
typedef enum OMX_TRANSITIONEFFECTTYPE {
|
||||
OMX_EffectNone,
|
||||
OMX_EffectFadeFromBlack,
|
||||
OMX_EffectFadeToBlack,
|
||||
OMX_EffectUnspecifiedThroughConstantColor,
|
||||
OMX_EffectDissolve,
|
||||
OMX_EffectWipe,
|
||||
OMX_EffectUnspecifiedMixOfTwoScenes,
|
||||
OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_EffectMax = 0x7FFFFFFF
|
||||
} OMX_TRANSITIONEFFECTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure used to configure current transition effect
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eEffect : Effect to enable
|
||||
*/
|
||||
typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_TRANSITIONEFFECTTYPE eEffect;
|
||||
} OMX_CONFIG_TRANSITIONEFFECTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines possible data unit types for encoded video data. The data unit
|
||||
* types are used both for encoded video input for playback as well as
|
||||
* encoded video output from recording.
|
||||
*/
|
||||
typedef enum OMX_DATAUNITTYPE {
|
||||
OMX_DataUnitCodedPicture,
|
||||
OMX_DataUnitVideoSegment,
|
||||
OMX_DataUnitSeveralSegments,
|
||||
OMX_DataUnitArbitraryStreamSection,
|
||||
OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_DataUnitMax = 0x7FFFFFFF
|
||||
} OMX_DATAUNITTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines possible encapsulation types for coded video data unit. The
|
||||
* encapsulation information is used both for encoded video input for
|
||||
* playback as well as encoded video output from recording.
|
||||
*/
|
||||
typedef enum OMX_DATAUNITENCAPSULATIONTYPE {
|
||||
OMX_DataEncapsulationElementaryStream,
|
||||
OMX_DataEncapsulationGenericPayload,
|
||||
OMX_DataEncapsulationRtpPayload,
|
||||
OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_DataEncapsulationMax = 0x7FFFFFFF
|
||||
} OMX_DATAUNITENCAPSULATIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure used to configure the type of being decoded/encoded
|
||||
*/
|
||||
typedef struct OMX_PARAM_DATAUNITTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< Port that this structure applies to */
|
||||
OMX_DATAUNITTYPE eUnitType;
|
||||
OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;
|
||||
} OMX_PARAM_DATAUNITTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines dither types
|
||||
*/
|
||||
typedef enum OMX_DITHERTYPE {
|
||||
OMX_DitherNone,
|
||||
OMX_DitherOrdered,
|
||||
OMX_DitherErrorDiffusion,
|
||||
OMX_DitherOther,
|
||||
OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_DitherMax = 0x7FFFFFFF
|
||||
} OMX_DITHERTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure used to configure current type of dithering
|
||||
*/
|
||||
typedef struct OMX_CONFIG_DITHERTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< Port that this structure applies to */
|
||||
OMX_DITHERTYPE eDither; /**< Type of dithering to use */
|
||||
} OMX_CONFIG_DITHERTYPE;
|
||||
|
||||
typedef struct OMX_CONFIG_CAPTUREMODETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex; /**< Port that this structure applies to */
|
||||
OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture
|
||||
* data as fast as possible (otherwise obey port's frame rate). */
|
||||
OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the
|
||||
* specified number of frames (otherwise the port does not
|
||||
* terminate the capture until instructed to do so by the client).
|
||||
* Even if set, the client may manually terminate the capture prior
|
||||
* to reaching the limit. */
|
||||
OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only
|
||||
* valid if bFrameLimited is set). */
|
||||
} OMX_CONFIG_CAPTUREMODETYPE;
|
||||
|
||||
typedef enum OMX_METERINGTYPE {
|
||||
|
||||
OMX_MeteringModeAverage, /**< Center-weighted average metering. */
|
||||
OMX_MeteringModeSpot, /**< Spot (partial) metering. */
|
||||
OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */
|
||||
|
||||
OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_EVModeMax = 0x7fffffff
|
||||
} OMX_METERINGTYPE;
|
||||
|
||||
typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_METERINGTYPE eMetering;
|
||||
OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */
|
||||
OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
|
||||
OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */
|
||||
OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
|
||||
OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */
|
||||
OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
|
||||
OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */
|
||||
} OMX_CONFIG_EXPOSUREVALUETYPE;
|
||||
|
||||
/**
|
||||
* Focus region configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bCenter : Use center region as focus region of interest
|
||||
* bLeft : Use left region as focus region of interest
|
||||
* bRight : Use right region as focus region of interest
|
||||
* bTop : Use top region as focus region of interest
|
||||
* bBottom : Use bottom region as focus region of interest
|
||||
* bTopLeft : Use top left region as focus region of interest
|
||||
* bTopRight : Use top right region as focus region of interest
|
||||
* bBottomLeft : Use bottom left region as focus region of interest
|
||||
* bBottomRight : Use bottom right region as focus region of interest
|
||||
*/
|
||||
typedef struct OMX_CONFIG_FOCUSREGIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bCenter;
|
||||
OMX_BOOL bLeft;
|
||||
OMX_BOOL bRight;
|
||||
OMX_BOOL bTop;
|
||||
OMX_BOOL bBottom;
|
||||
OMX_BOOL bTopLeft;
|
||||
OMX_BOOL bTopRight;
|
||||
OMX_BOOL bBottomLeft;
|
||||
OMX_BOOL bBottomRight;
|
||||
} OMX_CONFIG_FOCUSREGIONTYPE;
|
||||
|
||||
/**
|
||||
* Focus Status type
|
||||
*/
|
||||
typedef enum OMX_FOCUSSTATUSTYPE {
|
||||
OMX_FocusStatusOff = 0,
|
||||
OMX_FocusStatusRequest,
|
||||
OMX_FocusStatusReached,
|
||||
OMX_FocusStatusUnableToReach,
|
||||
OMX_FocusStatusLost,
|
||||
OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_FocusStatusMax = 0x7FFFFFFF
|
||||
} OMX_FOCUSSTATUSTYPE;
|
||||
|
||||
/**
|
||||
* Focus status configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eFocusStatus : Specifies the focus status
|
||||
* bCenterStatus : Use center region as focus region of interest
|
||||
* bLeftStatus : Use left region as focus region of interest
|
||||
* bRightStatus : Use right region as focus region of interest
|
||||
* bTopStatus : Use top region as focus region of interest
|
||||
* bBottomStatus : Use bottom region as focus region of interest
|
||||
* bTopLeftStatus : Use top left region as focus region of interest
|
||||
* bTopRightStatus : Use top right region as focus region of interest
|
||||
* bBottomLeftStatus : Use bottom left region as focus region of interest
|
||||
* bBottomRightStatus : Use bottom right region as focus region of interest
|
||||
*/
|
||||
typedef struct OMX_PARAM_FOCUSSTATUSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_FOCUSSTATUSTYPE eFocusStatus;
|
||||
OMX_BOOL bCenterStatus;
|
||||
OMX_BOOL bLeftStatus;
|
||||
OMX_BOOL bRightStatus;
|
||||
OMX_BOOL bTopStatus;
|
||||
OMX_BOOL bBottomStatus;
|
||||
OMX_BOOL bTopLeftStatus;
|
||||
OMX_BOOL bTopRightStatus;
|
||||
OMX_BOOL bBottomLeftStatus;
|
||||
OMX_BOOL bBottomRightStatus;
|
||||
} OMX_PARAM_FOCUSSTATUSTYPE;
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
||||
328
third_party/openmax/include/OMX_Image.h
vendored
328
third_party/openmax/include/OMX_Image.h
vendored
@@ -1,328 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file OMX_Image.h - OpenMax IL version 1.1.2
|
||||
* The structures needed by Image components to exchange parameters and
|
||||
* configuration data with the components.
|
||||
*/
|
||||
#ifndef OMX_Image_h
|
||||
#define OMX_Image_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/**
|
||||
* Each OMX header must include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
|
||||
#include <OMX_IVCommon.h>
|
||||
|
||||
/** @defgroup imaging OpenMAX IL Imaging Domain
|
||||
* @ingroup iv
|
||||
* Structures for OpenMAX IL Imaging domain
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enumeration used to define the possible image compression coding.
|
||||
*/
|
||||
typedef enum OMX_IMAGE_CODINGTYPE {
|
||||
OMX_IMAGE_CodingUnused, /**< Value when format is N/A */
|
||||
OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */
|
||||
OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */
|
||||
OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */
|
||||
OMX_IMAGE_CodingEXIF, /**< EXIF image format */
|
||||
OMX_IMAGE_CodingTIFF, /**< TIFF image format */
|
||||
OMX_IMAGE_CodingGIF, /**< Graphics image format */
|
||||
OMX_IMAGE_CodingPNG, /**< PNG image format */
|
||||
OMX_IMAGE_CodingLZW, /**< LZW image format */
|
||||
OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */
|
||||
OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_IMAGE_CodingMax = 0x7FFFFFFF
|
||||
} OMX_IMAGE_CODINGTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Data structure used to define an image path. The number of image paths
|
||||
* for input and output will vary by type of the image component.
|
||||
*
|
||||
* Input (aka Source) : Zero Inputs, one Output,
|
||||
* Splitter : One Input, 2 or more Outputs,
|
||||
* Processing Element : One Input, one output,
|
||||
* Mixer : 2 or more inputs, one output,
|
||||
* Output (aka Sink) : One Input, zero outputs.
|
||||
*
|
||||
* The PortDefinition structure is used to define all of the parameters
|
||||
* necessary for the compliant component to setup an input or an output
|
||||
* image path. If additional vendor specific data is required, it should
|
||||
* be transmitted to the component using the CustomCommand function.
|
||||
* Compliant components will prepopulate this structure with optimal
|
||||
* values during the OMX_GetParameter() command.
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* cMIMEType : MIME type of data for the port
|
||||
* pNativeRender : Platform specific reference for a display if a
|
||||
* sync, otherwise this field is 0
|
||||
* nFrameWidth : Width of frame to be used on port if
|
||||
* uncompressed format is used. Use 0 for
|
||||
* unknown, don't care or variable
|
||||
* nFrameHeight : Height of frame to be used on port if
|
||||
* uncompressed format is used. Use 0 for
|
||||
* unknown, don't care or variable
|
||||
* nStride : Number of bytes per span of an image (i.e.
|
||||
* indicates the number of bytes to get from
|
||||
* span N to span N+1, where negative stride
|
||||
* indicates the image is bottom up
|
||||
* nSliceHeight : Height used when encoding in slices
|
||||
* bFlagErrorConcealment : Turns on error concealment if it is supported by
|
||||
* the OMX component
|
||||
* eCompressionFormat : Compression format used in this instance of
|
||||
* the component. When OMX_IMAGE_CodingUnused is
|
||||
* specified, eColorFormat is valid
|
||||
* eColorFormat : Decompressed format used by this component
|
||||
* pNativeWindow : Platform specific reference for a window object if a
|
||||
* display sink , otherwise this field is 0x0.
|
||||
*/
|
||||
typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {
|
||||
OMX_STRING cMIMEType;
|
||||
OMX_NATIVE_DEVICETYPE pNativeRender;
|
||||
OMX_U32 nFrameWidth;
|
||||
OMX_U32 nFrameHeight;
|
||||
OMX_S32 nStride;
|
||||
OMX_U32 nSliceHeight;
|
||||
OMX_BOOL bFlagErrorConcealment;
|
||||
OMX_IMAGE_CODINGTYPE eCompressionFormat;
|
||||
OMX_COLOR_FORMATTYPE eColorFormat;
|
||||
OMX_NATIVE_WINDOWTYPE pNativeWindow;
|
||||
} OMX_IMAGE_PORTDEFINITIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Port format parameter. This structure is used to enumerate the various
|
||||
* data input/output format supported by the port.
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Indicates which port to set
|
||||
* nIndex : Indicates the enumeration index for the format from
|
||||
* 0x0 to N-1
|
||||
* eCompressionFormat : Compression format used in this instance of the
|
||||
* component. When OMX_IMAGE_CodingUnused is specified,
|
||||
* eColorFormat is valid
|
||||
* eColorFormat : Decompressed format used by this component
|
||||
*/
|
||||
typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nIndex;
|
||||
OMX_IMAGE_CODINGTYPE eCompressionFormat;
|
||||
OMX_COLOR_FORMATTYPE eColorFormat;
|
||||
} OMX_IMAGE_PARAM_PORTFORMATTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Flash control type
|
||||
*
|
||||
* ENUMS
|
||||
* Torch : Flash forced constantly on
|
||||
*/
|
||||
typedef enum OMX_IMAGE_FLASHCONTROLTYPE {
|
||||
OMX_IMAGE_FlashControlOn = 0,
|
||||
OMX_IMAGE_FlashControlOff,
|
||||
OMX_IMAGE_FlashControlAuto,
|
||||
OMX_IMAGE_FlashControlRedEyeReduction,
|
||||
OMX_IMAGE_FlashControlFillin,
|
||||
OMX_IMAGE_FlashControlTorch,
|
||||
OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_IMAGE_FlashControlMax = 0x7FFFFFFF
|
||||
} OMX_IMAGE_FLASHCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Flash control configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eFlashControl : Flash control type
|
||||
*/
|
||||
typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;
|
||||
} OMX_IMAGE_PARAM_FLASHCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Focus control type
|
||||
*/
|
||||
typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {
|
||||
OMX_IMAGE_FocusControlOn = 0,
|
||||
OMX_IMAGE_FocusControlOff,
|
||||
OMX_IMAGE_FocusControlAuto,
|
||||
OMX_IMAGE_FocusControlAutoLock,
|
||||
OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_IMAGE_FocusControlMax = 0x7FFFFFFF
|
||||
} OMX_IMAGE_FOCUSCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Focus control configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eFocusControl : Focus control
|
||||
* nFocusSteps : Focus can take on values from 0 mm to infinity.
|
||||
* Interest is only in number of steps over this range.
|
||||
* nFocusStepIndex : Current focus step index
|
||||
*/
|
||||
typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;
|
||||
OMX_U32 nFocusSteps;
|
||||
OMX_U32 nFocusStepIndex;
|
||||
} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Q Factor for JPEG compression, which controls the tradeoff between image
|
||||
* quality and size. Q Factor provides a more simple means of controlling
|
||||
* JPEG compression quality, without directly programming Quantization
|
||||
* tables for chroma and luma
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1
|
||||
* produces the smallest, worst quality images, and a factor
|
||||
* of 100 produces the largest, best quality images. A
|
||||
* typical default is 75 for small good quality images
|
||||
*/
|
||||
typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nQFactor;
|
||||
} OMX_IMAGE_PARAM_QFACTORTYPE;
|
||||
|
||||
/**
|
||||
* Quantization table type
|
||||
*/
|
||||
|
||||
typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {
|
||||
OMX_IMAGE_QuantizationTableLuma = 0,
|
||||
OMX_IMAGE_QuantizationTableChroma,
|
||||
OMX_IMAGE_QuantizationTableChromaCb,
|
||||
OMX_IMAGE_QuantizationTableChromaCr,
|
||||
OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF
|
||||
} OMX_IMAGE_QUANTIZATIONTABLETYPE;
|
||||
|
||||
/**
|
||||
* JPEG quantization tables are used to determine DCT compression for
|
||||
* YUV data, as an alternative to specifying Q factor, providing exact
|
||||
* control of compression
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eQuantizationTable : Quantization table type
|
||||
* nQuantizationMatrix[64] : JPEG quantization table of coefficients stored
|
||||
* in increasing columns then by rows of data (i.e.
|
||||
* row 1, ... row 8). Quantization values are in
|
||||
* the range 0-255 and stored in linear order
|
||||
* (i.e. the component will zig-zag the
|
||||
* quantization table data if required internally)
|
||||
*/
|
||||
typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;
|
||||
OMX_U8 nQuantizationMatrix[64];
|
||||
} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Huffman table type, the same Huffman table is applied for chroma and
|
||||
* luma component
|
||||
*/
|
||||
typedef enum OMX_IMAGE_HUFFMANTABLETYPE {
|
||||
OMX_IMAGE_HuffmanTableAC = 0,
|
||||
OMX_IMAGE_HuffmanTableDC,
|
||||
OMX_IMAGE_HuffmanTableACLuma,
|
||||
OMX_IMAGE_HuffmanTableACChroma,
|
||||
OMX_IMAGE_HuffmanTableDCLuma,
|
||||
OMX_IMAGE_HuffmanTableDCChroma,
|
||||
OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF
|
||||
} OMX_IMAGE_HUFFMANTABLETYPE;
|
||||
|
||||
/**
|
||||
* JPEG Huffman table
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eHuffmanTable : Huffman table type
|
||||
* nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each
|
||||
* possible length
|
||||
* nHuffmanTable[256] : 0-255, the size used for AC and DC
|
||||
* HuffmanTable are 16 and 162
|
||||
*/
|
||||
typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;
|
||||
OMX_U8 nNumberOfHuffmanCodeOfLength[16];
|
||||
OMX_U8 nHuffmanTable[256];
|
||||
}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
||||
259
third_party/openmax/include/OMX_Index.h
vendored
259
third_party/openmax/include/OMX_Index.h
vendored
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file OMX_Index.h - OpenMax IL version 1.1.2
|
||||
* The OMX_Index header file contains the definitions for both applications
|
||||
* and components .
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OMX_Index_h
|
||||
#define OMX_Index_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* Each OMX header must include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
#include <OMX_Types.h>
|
||||
|
||||
|
||||
/** The OMX_INDEXTYPE enumeration is used to select a structure when either
|
||||
* getting or setting parameters and/or configuration data. Each entry in
|
||||
* this enumeration maps to an OMX specified structure. When the
|
||||
* OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods
|
||||
* are used, the second parameter will always be an entry from this enumeration
|
||||
* and the third entry will be the structure shown in the comments for the entry.
|
||||
* For example, if the application is initializing a cropping function, the
|
||||
* OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter
|
||||
* and would send a pointer to an initialized OMX_RECTTYPE structure as the
|
||||
* third parameter.
|
||||
*
|
||||
* The enumeration entries named with the OMX_Config prefix are sent using
|
||||
* the OMX_SetConfig command and the enumeration entries named with the
|
||||
* OMX_PARAM_ prefix are sent using the OMX_SetParameter command.
|
||||
*/
|
||||
typedef enum OMX_INDEXTYPE {
|
||||
|
||||
OMX_IndexComponentStartUnused = 0x01000000,
|
||||
OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
|
||||
OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */
|
||||
OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */
|
||||
OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */
|
||||
OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */
|
||||
OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */
|
||||
OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */
|
||||
OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */
|
||||
OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */
|
||||
OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */
|
||||
OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */
|
||||
OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */
|
||||
OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */
|
||||
OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */
|
||||
OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */
|
||||
OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */
|
||||
OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */
|
||||
OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */
|
||||
OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */
|
||||
OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
|
||||
OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
|
||||
OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
|
||||
OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */
|
||||
|
||||
OMX_IndexPortStartUnused = 0x02000000,
|
||||
OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */
|
||||
OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */
|
||||
OMX_IndexReservedStartUnused = 0x03000000,
|
||||
|
||||
/* Audio parameters and configurations */
|
||||
OMX_IndexAudioStartUnused = 0x04000000,
|
||||
OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */
|
||||
OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */
|
||||
OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */
|
||||
OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */
|
||||
OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */
|
||||
OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */
|
||||
OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */
|
||||
OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */
|
||||
OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */
|
||||
OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */
|
||||
OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */
|
||||
OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */
|
||||
OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */
|
||||
OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */
|
||||
OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */
|
||||
OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */
|
||||
OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */
|
||||
OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */
|
||||
OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */
|
||||
OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */
|
||||
OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */
|
||||
OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */
|
||||
OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */
|
||||
OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */
|
||||
OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */
|
||||
OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */
|
||||
OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */
|
||||
|
||||
OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */
|
||||
OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */
|
||||
OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */
|
||||
OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */
|
||||
OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */
|
||||
OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */
|
||||
OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */
|
||||
OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */
|
||||
OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */
|
||||
OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */
|
||||
OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */
|
||||
OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */
|
||||
OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */
|
||||
OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */
|
||||
OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */
|
||||
OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */
|
||||
OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */
|
||||
OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */
|
||||
OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */
|
||||
OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */
|
||||
|
||||
/* Image specific parameters and configurations */
|
||||
OMX_IndexImageStartUnused = 0x05000000,
|
||||
OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */
|
||||
OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
|
||||
OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */
|
||||
OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */
|
||||
OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */
|
||||
OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */
|
||||
OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
|
||||
|
||||
/* Video specific parameters and configurations */
|
||||
OMX_IndexVideoStartUnused = 0x06000000,
|
||||
OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */
|
||||
OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */
|
||||
OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */
|
||||
OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */
|
||||
OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */
|
||||
OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */
|
||||
OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */
|
||||
OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */
|
||||
OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */
|
||||
OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */
|
||||
OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */
|
||||
OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */
|
||||
OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */
|
||||
OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */
|
||||
OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
|
||||
OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
|
||||
OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */
|
||||
OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */
|
||||
OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */
|
||||
OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
|
||||
OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */
|
||||
OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */
|
||||
OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
|
||||
OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */
|
||||
OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */
|
||||
OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */
|
||||
OMX_IndexConfigCommonDeinterlace, /**< reference: OMX_VIDEO_CONFIG_DEINTERLACE */
|
||||
|
||||
/* Image & Video common Configurations */
|
||||
OMX_IndexCommonStartUnused = 0x07000000,
|
||||
OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */
|
||||
OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */
|
||||
OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */
|
||||
OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */
|
||||
OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
|
||||
OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */
|
||||
OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */
|
||||
OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */
|
||||
OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */
|
||||
OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */
|
||||
OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */
|
||||
OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */
|
||||
OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */
|
||||
OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
|
||||
OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
|
||||
OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
|
||||
OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/
|
||||
OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */
|
||||
OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */
|
||||
OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */
|
||||
OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */
|
||||
OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */
|
||||
OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */
|
||||
OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */
|
||||
OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */
|
||||
OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */
|
||||
OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */
|
||||
OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */
|
||||
OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */
|
||||
OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */
|
||||
OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */
|
||||
OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */
|
||||
OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */
|
||||
OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */
|
||||
|
||||
/* Reserved Configuration range */
|
||||
OMX_IndexOtherStartUnused = 0x08000000,
|
||||
OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */
|
||||
OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */
|
||||
OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */
|
||||
|
||||
|
||||
/* Reserved Time range */
|
||||
OMX_IndexTimeStartUnused = 0x09000000,
|
||||
OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */
|
||||
OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */
|
||||
OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */
|
||||
OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
|
||||
OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
|
||||
OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
|
||||
OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
|
||||
OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */
|
||||
OMX_IndexConfigTimeClientStartTime, /**<reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
|
||||
OMX_IndexConfigTimePosition, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */
|
||||
OMX_IndexConfigTimeSeekMode, /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */
|
||||
|
||||
|
||||
OMX_IndexKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
/* Vendor specific area */
|
||||
OMX_IndexVendorStartUnused = 0x7F000000,
|
||||
/* Vendor specific structures should be in the range of 0x7F000000
|
||||
to 0x7FFFFFFE. This range is not broken out by vendor, so
|
||||
private indexes are not guaranteed unique and therefore should
|
||||
only be sent to the appropriate component. */
|
||||
|
||||
OMX_IndexMax = 0x7FFFFFFF
|
||||
|
||||
} OMX_INDEXTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
||||
95
third_party/openmax/include/OMX_IndexExt.h
vendored
95
third_party/openmax/include/OMX_IndexExt.h
vendored
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file OMX_IndexExt.h - OpenMax IL version 1.1.2
|
||||
* The OMX_IndexExt header file contains extensions to the definitions
|
||||
* for both applications and components .
|
||||
*/
|
||||
|
||||
#ifndef OMX_IndexExt_h
|
||||
#define OMX_IndexExt_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Each OMX header shall include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
#include <OMX_Index.h>
|
||||
|
||||
|
||||
/** Khronos standard extension indices.
|
||||
|
||||
This enum lists the current Khronos extension indices to OpenMAX IL.
|
||||
*/
|
||||
typedef enum OMX_INDEXEXTTYPE {
|
||||
|
||||
/* Component parameters and configurations */
|
||||
OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000,
|
||||
OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */
|
||||
OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */
|
||||
OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */
|
||||
|
||||
/* Port parameters and configurations */
|
||||
OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000,
|
||||
|
||||
/* Audio parameters and configurations */
|
||||
OMX_IndexExtAudioStartUnused = OMX_IndexKhronosExtensions + 0x00400000,
|
||||
|
||||
/* Image parameters and configurations */
|
||||
OMX_IndexExtImageStartUnused = OMX_IndexKhronosExtensions + 0x00500000,
|
||||
|
||||
/* Video parameters and configurations */
|
||||
OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000,
|
||||
OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
|
||||
OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
|
||||
OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */
|
||||
OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */
|
||||
OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */
|
||||
OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */
|
||||
OMX_IndexParamVideoReserved, /**< Reserved for future index */
|
||||
OMX_IndexParamVideoHevc, /**< reference: OMX_VIDEO_PARAM_HEVCTYPE */
|
||||
|
||||
/* Image & Video common configurations */
|
||||
OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000,
|
||||
|
||||
/* Other configurations */
|
||||
OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000,
|
||||
OMX_IndexConfigAutoFramerateConversion, /**< reference: OMX_CONFIG_BOOLEANTYPE */
|
||||
OMX_IndexConfigPriority, /**< reference: OMX_PARAM_U32TYPE */
|
||||
OMX_IndexConfigOperatingRate, /**< reference: OMX_PARAM_U32TYPE in Q16 format for video and in Hz for audio */
|
||||
|
||||
/* Time configurations */
|
||||
OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000,
|
||||
|
||||
OMX_IndexExtMax = 0x7FFFFFFF
|
||||
} OMX_INDEXEXTTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* OMX_IndexExt_h */
|
||||
/* File EOF */
|
||||
337
third_party/openmax/include/OMX_Other.h
vendored
337
third_party/openmax/include/OMX_Other.h
vendored
@@ -1,337 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file OMX_Other.h - OpenMax IL version 1.1.2
|
||||
* The structures needed by Other components to exchange
|
||||
* parameters and configuration data with the components.
|
||||
*/
|
||||
|
||||
#ifndef OMX_Other_h
|
||||
#define OMX_Other_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* Each OMX header must include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
|
||||
#include <OMX_Core.h>
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration of possible data types which match to multiple domains or no
|
||||
* domain at all. For types which are vendor specific, a value above
|
||||
* OMX_OTHER_VENDORTSTART should be used.
|
||||
*/
|
||||
typedef enum OMX_OTHER_FORMATTYPE {
|
||||
OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
|
||||
time deltas, etc */
|
||||
OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power
|
||||
management, setting clocks? */
|
||||
OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames
|
||||
dropped, etc */
|
||||
OMX_OTHER_FormatBinary, /**< Arbitrary binary data */
|
||||
OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
|
||||
formats */
|
||||
|
||||
OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_OTHER_FormatMax = 0x7FFFFFFF
|
||||
} OMX_OTHER_FORMATTYPE;
|
||||
|
||||
/**
|
||||
* Enumeration of seek modes.
|
||||
*/
|
||||
typedef enum OMX_TIME_SEEKMODETYPE {
|
||||
OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
|
||||
* of the requested seek position over
|
||||
* the actual seek position if it
|
||||
* results in a faster seek. */
|
||||
OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
|
||||
* position over an approximation
|
||||
* of the requested seek position even
|
||||
* if it results in a slower seek. */
|
||||
OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_TIME_SeekModeMax = 0x7FFFFFFF
|
||||
} OMX_TIME_SEEKMODETYPE;
|
||||
|
||||
/* Structure representing the seekmode of the component */
|
||||
typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */
|
||||
} OMX_TIME_CONFIG_SEEKMODETYPE;
|
||||
|
||||
/** Structure representing a time stamp used with the following configs
|
||||
* on the Clock Component (CC):
|
||||
*
|
||||
* OMX_IndexConfigTimeCurrentWallTime: query of the CC<43>s current wall
|
||||
* time
|
||||
* OMX_IndexConfigTimeCurrentMediaTime: query of the CC<43>s current media
|
||||
* time
|
||||
* OMX_IndexConfigTimeCurrentAudioReference and
|
||||
* OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
|
||||
* clock sending SC its reference time
|
||||
* OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
|
||||
* this structure to the Clock Component via a SetConfig on its
|
||||
* client port when it receives a buffer with
|
||||
* OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
|
||||
* specified by that buffer for nStartTimestamp.
|
||||
*
|
||||
* It<49>s also used with the following config on components in general:
|
||||
*
|
||||
* OMX_IndexConfigTimePosition: IL client querying component position
|
||||
* (GetConfig) or commanding a component to seek to the given location
|
||||
* (SetConfig)
|
||||
*/
|
||||
typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version
|
||||
* information */
|
||||
OMX_U32 nPortIndex; /**< port that this structure applies to */
|
||||
OMX_TICKS nTimestamp; /**< timestamp .*/
|
||||
} OMX_TIME_CONFIG_TIMESTAMPTYPE;
|
||||
|
||||
/** Enumeration of possible reference clocks to the media time. */
|
||||
typedef enum OMX_TIME_UPDATETYPE {
|
||||
OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
|
||||
OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
|
||||
OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
|
||||
OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_TIME_UpdateMax = 0x7FFFFFFF
|
||||
} OMX_TIME_UPDATETYPE;
|
||||
|
||||
/** Enumeration of possible reference clocks to the media time. */
|
||||
typedef enum OMX_TIME_REFCLOCKTYPE {
|
||||
OMX_TIME_RefClockNone, /**< Use no references. */
|
||||
OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
|
||||
OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
|
||||
OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_TIME_RefClockMax = 0x7FFFFFFF
|
||||
} OMX_TIME_REFCLOCKTYPE;
|
||||
|
||||
/** Enumeration of clock states. */
|
||||
typedef enum OMX_TIME_CLOCKSTATE {
|
||||
OMX_TIME_ClockStateRunning, /**< Clock running. */
|
||||
OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
|
||||
* prescribed clients emit their
|
||||
* start time. */
|
||||
OMX_TIME_ClockStateStopped, /**< Clock stopped. */
|
||||
OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_TIME_ClockStateMax = 0x7FFFFFFF
|
||||
} OMX_TIME_CLOCKSTATE;
|
||||
|
||||
/** Structure representing a media time request to the clock component.
|
||||
*
|
||||
* A client component sends this structure to the Clock Component via a SetConfig
|
||||
* on its client port to specify a media timestamp the Clock Component
|
||||
* should emit. The Clock Component should fulfill the request by sending a
|
||||
* OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
|
||||
* timestamp.
|
||||
*
|
||||
* The client may require a media time request be fulfilled slightly
|
||||
* earlier than the media time specified. In this case the client specifies
|
||||
* an offset which is equal to the difference between wall time corresponding
|
||||
* to the requested media time and the wall time when it will be
|
||||
* fulfilled.
|
||||
*
|
||||
* A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
|
||||
* time events according to timestamps. If a client must perform an operation O at
|
||||
* a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
|
||||
* media time request at T (perhaps specifying an offset to ensure the request fulfillment
|
||||
* is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
|
||||
* structure back to the client component, the client may perform operation O (perhaps having
|
||||
* to wait a slight amount more time itself as specified by the return values).
|
||||
*/
|
||||
|
||||
typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< port that this structure applies to */
|
||||
OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
|
||||
* from others (e.g. the number of the frame to deliver).
|
||||
* Duplicated in the media time structure that fulfills
|
||||
* this request. A value of zero is reserved for time scale
|
||||
* updates. */
|
||||
OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
|
||||
OMX_TICKS nOffset; /**< Amount of wall clock time by which this
|
||||
* request should be fulfilled early */
|
||||
} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
|
||||
|
||||
/**< Structure sent from the clock component client either when fulfilling
|
||||
* a media time request or when the time scale has changed.
|
||||
*
|
||||
* In the former case the Clock Component fills this structure and times its emission
|
||||
* to a client component (via the client port) according to the corresponding media
|
||||
* time request sent by the client. The Clock Component should time the emission to occur
|
||||
* when the requested timestamp matches the Clock Component's media time but also the
|
||||
* prescribed offset early.
|
||||
*
|
||||
* Upon scale changes the clock component clears the nClientPrivate data, sends the current
|
||||
* media time and sets the nScale to the new scale via the client port. It emits a
|
||||
* OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
|
||||
* alter processing to accomodate scaling. For instance a video component might skip inter-frames
|
||||
* in the case of extreme fastforward. Likewise an audio component might add or remove samples
|
||||
* from an audio frame to scale audio data.
|
||||
*
|
||||
* It is expected that some clock components may not be able to fulfill requests
|
||||
* at exactly the prescribed time. This is acceptable so long as the request is
|
||||
* fulfilled at least as early as described and not later. This structure provides
|
||||
* fields the client may use to wait for the remaining time.
|
||||
*
|
||||
* The client may use either the nOffset or nWallTimeAtMedia fields to determine the
|
||||
* wall time until the nMediaTimestamp actually occurs. In the latter case the
|
||||
* client can get a more accurate value for offset by getting the current wall
|
||||
* from the cloc component and subtracting it from nWallTimeAtMedia.
|
||||
*/
|
||||
|
||||
typedef struct OMX_TIME_MEDIATIMETYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
|
||||
* from others. Copied from the media time request.
|
||||
* A value of zero is reserved for time scale updates. */
|
||||
OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
|
||||
OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
|
||||
* requested then this is the current media time. */
|
||||
OMX_TICKS nOffset; /**< Amount of wall clock time by which this
|
||||
* request was actually fulfilled early */
|
||||
|
||||
OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
|
||||
* A client may compare this value to current
|
||||
* media time obtained from the Clock Component to determine
|
||||
* the wall time until the media timestamp is really
|
||||
* current. */
|
||||
OMX_S32 xScale; /**< Current media time scale in Q16 format. */
|
||||
OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
|
||||
/**< State of the media time. */
|
||||
} OMX_TIME_MEDIATIMETYPE;
|
||||
|
||||
/** Structure representing the current media time scale factor. Applicable only to clock
|
||||
* component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
|
||||
* the clock component client ports. Upon recieving this config the clock component changes
|
||||
* the rate by which the media time increases or decreases effectively implementing trick modes.
|
||||
*/
|
||||
typedef struct OMX_TIME_CONFIG_SCALETYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_S32 xScale; /**< This is a value in Q16 format which is used for
|
||||
* scaling the media time */
|
||||
} OMX_TIME_CONFIG_SCALETYPE;
|
||||
|
||||
/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE<50>s nWaitMask field */
|
||||
#define OMX_CLOCKPORT0 0x00000001
|
||||
#define OMX_CLOCKPORT1 0x00000002
|
||||
#define OMX_CLOCKPORT2 0x00000004
|
||||
#define OMX_CLOCKPORT3 0x00000008
|
||||
#define OMX_CLOCKPORT4 0x00000010
|
||||
#define OMX_CLOCKPORT5 0x00000020
|
||||
#define OMX_CLOCKPORT6 0x00000040
|
||||
#define OMX_CLOCKPORT7 0x00000080
|
||||
|
||||
/** Structure representing the current mode of the media clock.
|
||||
* IL Client uses this config to change or query the mode of the
|
||||
* media clock of the clock component. Applicable only to clock
|
||||
* component.
|
||||
*
|
||||
* On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
|
||||
* starts immediately at the prescribed start time. If
|
||||
* OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
|
||||
* the given nStartTime and waits for all clients specified in the
|
||||
* nWaitMask to send starttimes (via
|
||||
* OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
|
||||
* the media clock using the earliest start time supplied. */
|
||||
typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version
|
||||
* information */
|
||||
OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
|
||||
OMX_TICKS nStartTime; /**< Start time of the media time. */
|
||||
OMX_TICKS nOffset; /**< Time to offset the media time by
|
||||
* (e.g. preroll). Media time will be
|
||||
* reported to be nOffset ticks earlier.
|
||||
*/
|
||||
OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
|
||||
} OMX_TIME_CONFIG_CLOCKSTATETYPE;
|
||||
|
||||
/** Structure representing the reference clock currently being used to
|
||||
* compute media time. IL client uses this config to change or query the
|
||||
* clock component's active reference clock */
|
||||
typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
|
||||
} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
|
||||
|
||||
/** Descriptor for setting specifics of power type.
|
||||
* Note: this structure is listed for backwards compatibility. */
|
||||
typedef struct OMX_OTHER_CONFIG_POWERTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
|
||||
} OMX_OTHER_CONFIG_POWERTYPE;
|
||||
|
||||
|
||||
/** Descriptor for setting specifics of stats type.
|
||||
* Note: this structure is listed for backwards compatibility. */
|
||||
typedef struct OMX_OTHER_CONFIG_STATSTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
/* what goes here */
|
||||
} OMX_OTHER_CONFIG_STATSTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* The PortDefinition structure is used to define all of the parameters
|
||||
* necessary for the compliant component to setup an input or an output other
|
||||
* path.
|
||||
*/
|
||||
typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
|
||||
OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
|
||||
} OMX_OTHER_PORTDEFINITIONTYPE;
|
||||
|
||||
/** Port format parameter. This structure is used to enumerate
|
||||
* the various data input/output format supported by the port.
|
||||
*/
|
||||
typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_U32 nPortIndex; /**< Indicates which port to set */
|
||||
OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
|
||||
OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
|
||||
} OMX_OTHER_PARAM_PORTFORMATTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
||||
1888
third_party/openmax/include/OMX_QCOMExtns.h
vendored
1888
third_party/openmax/include/OMX_QCOMExtns.h
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,155 +0,0 @@
|
||||
/*@@@+++@@@@******************************************************************
|
||||
|
||||
Microsoft Skype Engineering
|
||||
Copyright (C) 2014 Microsoft Corporation.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
*@@@---@@@@******************************************************************/
|
||||
|
||||
|
||||
#ifndef __OMX_SKYPE_VIDEOEXTENSIONS_H__
|
||||
#define __OMX_SKYPE_VIDEOEXTENSIONS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <OMX_Core.h>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
||||
typedef enum OMX_SKYPE_VIDEO_SliceControlMode
|
||||
{
|
||||
OMX_SKYPE_VIDEO_SliceControlModeNone = 0,
|
||||
OMX_SKYPE_VIDEO_SliceControlModeMB = 1,
|
||||
OMX_SKYPE_VIDEO_SliceControlModeByte = 2,
|
||||
OMX_SKYPE_VIDEO_SliceControlModMBRow = 3,
|
||||
} OMX_SKYPE_VIDEO_SliceControlMode;
|
||||
|
||||
|
||||
typedef enum OMX_SKYPE_VIDEO_HierarType
|
||||
{
|
||||
OMX_SKYPE_VIDEO_HierarType_P = 0x01,
|
||||
OMX_SKYPE_VIDEO_HierarType_B = 0x02,
|
||||
} OMX_SKYPE_VIDEO_HIERAR_HierarType;
|
||||
|
||||
typedef enum OMX_VIDEO_EXTENSION_AVCPROFILETYPE
|
||||
{
|
||||
OMX_VIDEO_EXT_AVCProfileConstrainedBaseline = 0x01,
|
||||
OMX_VIDEO_EXT_AVCProfileConstrainedHigh = 0x02,
|
||||
} OMX_VIDEO_EXTENSION_AVCPROFILETYPE;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_ENCODERPARAMS {
|
||||
OMX_BOOL bLowLatency;
|
||||
OMX_BOOL bUseExtendedProfile;
|
||||
OMX_BOOL bSequenceHeaderWithIDR;
|
||||
OMX_VIDEO_EXTENSION_AVCPROFILETYPE eProfile;
|
||||
OMX_U32 nLTRFrames;
|
||||
OMX_SKYPE_VIDEO_HierarType eHierarType;
|
||||
OMX_U32 nMaxTemporalLayerCount;
|
||||
OMX_SKYPE_VIDEO_SliceControlMode eSliceControlMode;
|
||||
OMX_U32 nSarIndex;
|
||||
OMX_U32 nSarWidth;
|
||||
OMX_U32 nSarHeight;
|
||||
} OMX_SKYPE_VIDEO_ENCODERPARAMS;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_PARAM_ENCODERSETTING {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_SKYPE_VIDEO_ENCODERPARAMS stEncParam;
|
||||
} OMX_SKYPE_VIDEO_PARAM_ENCODESETTING;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_ENCODERCAP {
|
||||
OMX_BOOL bLowLatency;
|
||||
OMX_U32 nMaxFrameWidth;
|
||||
OMX_U32 nMaxFrameHeight;
|
||||
OMX_U32 nMaxInstances;
|
||||
OMX_U32 nMaxTemporaLayerCount;
|
||||
OMX_U32 nMaxRefFrames;
|
||||
OMX_U32 nMaxLTRFrames;
|
||||
OMX_VIDEO_AVCLEVELTYPE nMaxLevel;
|
||||
OMX_U32 nSliceControlModesBM;
|
||||
OMX_U32 nMaxMacroblockProcessingRate;
|
||||
OMX_U32 xMinScaleFactor;
|
||||
} OMX_SKYPE_VIDEO_ENCODERCAP;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_PARAM_ENCODERCAP {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_SKYPE_VIDEO_ENCODERCAP stEncCap;
|
||||
} OMX_SKYPE_VIDEO_PARAM_ENCODERCAP;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_DECODERCAP {
|
||||
OMX_BOOL bLowLatency;
|
||||
OMX_U32 nMaxFrameWidth;
|
||||
OMX_U32 nMaxFrameHeight;
|
||||
OMX_U32 nMaxInstances;
|
||||
OMX_VIDEO_AVCLEVELTYPE nMaxLevel;
|
||||
OMX_U32 nMaxMacroblockProcessingRate;
|
||||
} OMX_SKYPE_VIDEO_DECODERCAP;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_PARAM_DECODERCAP {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_SKYPE_VIDEO_DECODERCAP stDecoderCap;
|
||||
} OMX_SKYPE_VIDEO_PARAM_DECODERCAP;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_CONFIG_QP {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nQP;
|
||||
} OMX_SKYPE_VIDEO_CONFIG_QP;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_CONFIG_BASELAYERPID{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nPID;
|
||||
} OMX_SKYPE_VIDEO_CONFIG_BASELAYERPID;
|
||||
|
||||
typedef struct OMX_SKYPE_VIDEO_PARAM_DRIVERVER {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U64 nDriverVersion;
|
||||
} OMX_SKYPE_VIDEO_PARAM_DRIVERVER;
|
||||
|
||||
typedef enum OMX_SKYPE_VIDEO_DownScaleFactor
|
||||
{
|
||||
OMX_SKYPE_VIDEO_DownScaleFactor_1_1 = 0,
|
||||
OMX_SKYPE_VIDEO_DownScaleFactor_Equal_AR = 1,
|
||||
OMX_SKYPE_VIDEO_DownScaleFactor_Any = 2,
|
||||
} OMX_SKYPE_VIDEO_DownScaleFactor;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
359
third_party/openmax/include/OMX_Types.h
vendored
359
third_party/openmax/include/OMX_Types.h
vendored
@@ -1,359 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** OMX_Types.h - OpenMax IL version 1.1.2
|
||||
* The OMX_Types header file contains the primitive type definitions used by
|
||||
* the core, the application and the component. This file may need to be
|
||||
* modified to be used on systems that do not have "char" set to 8 bits,
|
||||
* "short" set to 16 bits and "long" set to 32 bits.
|
||||
*/
|
||||
|
||||
#ifndef OMX_Types_h
|
||||
#define OMX_Types_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** The OMX_API and OMX_APIENTRY are platform specific definitions used
|
||||
* to declare OMX function prototypes. They are modified to meet the
|
||||
* requirements for a particular platform */
|
||||
#ifdef __SYMBIAN32__
|
||||
# ifdef __OMX_EXPORTS
|
||||
# define OMX_API __declspec(dllexport)
|
||||
# else
|
||||
# ifdef _WIN32
|
||||
# define OMX_API __declspec(dllexport)
|
||||
# else
|
||||
# define OMX_API __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# ifdef _WIN32
|
||||
# ifdef __OMX_EXPORTS
|
||||
# define OMX_API __declspec(dllexport)
|
||||
# else
|
||||
# define OMX_API __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# ifdef __OMX_EXPORTS
|
||||
# define OMX_API
|
||||
# else
|
||||
# define OMX_API extern
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef OMX_APIENTRY
|
||||
#define OMX_APIENTRY
|
||||
#endif
|
||||
|
||||
/** OMX_IN is used to identify inputs to an OMX function. This designation
|
||||
will also be used in the case of a pointer that points to a parameter
|
||||
that is used as an output. */
|
||||
#ifndef OMX_IN
|
||||
#define OMX_IN
|
||||
#endif
|
||||
|
||||
/** OMX_OUT is used to identify outputs from an OMX function. This
|
||||
designation will also be used in the case of a pointer that points
|
||||
to a parameter that is used as an input. */
|
||||
#ifndef OMX_OUT
|
||||
#define OMX_OUT
|
||||
#endif
|
||||
|
||||
|
||||
/** OMX_INOUT is used to identify parameters that may be either inputs or
|
||||
outputs from an OMX function at the same time. This designation will
|
||||
also be used in the case of a pointer that points to a parameter that
|
||||
is used both as an input and an output. */
|
||||
#ifndef OMX_INOUT
|
||||
#define OMX_INOUT
|
||||
#endif
|
||||
|
||||
/** OMX_ALL is used to as a wildcard to select all entities of the same type
|
||||
* when specifying the index, or referring to a object by an index. (i.e.
|
||||
* use OMX_ALL to indicate all N channels). When used as a port index
|
||||
* for a config or parameter this OMX_ALL denotes that the config or
|
||||
* parameter applies to the entire component not just one port. */
|
||||
#define OMX_ALL 0xFFFFFFFF
|
||||
|
||||
/** In the following we define groups that help building doxygen documentation */
|
||||
|
||||
/** @defgroup core OpenMAX IL core
|
||||
* Functions and structure related to the OMX IL core
|
||||
*/
|
||||
|
||||
/** @defgroup comp OpenMAX IL component
|
||||
* Functions and structure related to the OMX IL component
|
||||
*/
|
||||
|
||||
/** @defgroup rpm Resource and Policy Management
|
||||
* Structures for resource and policy management of components
|
||||
*/
|
||||
|
||||
/** @defgroup buf Buffer Management
|
||||
* Buffer handling functions and structures
|
||||
*/
|
||||
|
||||
/** @defgroup tun Tunneling
|
||||
* @ingroup core comp
|
||||
* Structures and functions to manage tunnels among component ports
|
||||
*/
|
||||
|
||||
/** @defgroup cp Content Pipes
|
||||
* @ingroup core
|
||||
*/
|
||||
|
||||
/** @defgroup metadata Metadata handling
|
||||
*
|
||||
*/
|
||||
|
||||
/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
|
||||
typedef unsigned char OMX_U8;
|
||||
|
||||
/** OMX_S8 is an 8 bit signed quantity that is byte aligned */
|
||||
typedef signed char OMX_S8;
|
||||
|
||||
/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
|
||||
typedef unsigned short OMX_U16;
|
||||
|
||||
/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
|
||||
typedef signed short OMX_S16;
|
||||
|
||||
/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
|
||||
typedef unsigned int OMX_U32;
|
||||
|
||||
/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
|
||||
typedef signed int OMX_S32;
|
||||
|
||||
|
||||
/* Users with compilers that cannot accept the "long long" designation should
|
||||
define the OMX_SKIP64BIT macro. It should be noted that this may cause
|
||||
some components to fail to compile if the component was written to require
|
||||
64 bit integral types. However, these components would NOT compile anyway
|
||||
since the compiler does not support the way the component was written.
|
||||
*/
|
||||
#ifndef OMX_SKIP64BIT
|
||||
#ifdef __SYMBIAN32__
|
||||
/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
|
||||
typedef unsigned long long OMX_U64;
|
||||
|
||||
/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
|
||||
typedef signed long long OMX_S64;
|
||||
|
||||
#elif defined(WIN32)
|
||||
|
||||
/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
|
||||
typedef unsigned __int64 OMX_U64;
|
||||
|
||||
/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
|
||||
typedef signed __int64 OMX_S64;
|
||||
|
||||
#else /* WIN32 */
|
||||
|
||||
/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
|
||||
typedef unsigned long long OMX_U64;
|
||||
|
||||
/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
|
||||
typedef signed long long OMX_S64;
|
||||
|
||||
#endif /* WIN32 */
|
||||
#endif
|
||||
|
||||
|
||||
/** The OMX_BOOL type is intended to be used to represent a true or a false
|
||||
value when passing parameters to and from the OMX core and components. The
|
||||
OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
|
||||
*/
|
||||
typedef enum OMX_BOOL {
|
||||
OMX_FALSE = 0,
|
||||
OMX_TRUE = !OMX_FALSE,
|
||||
OMX_BOOL_MAX = 0x7FFFFFFF
|
||||
} OMX_BOOL;
|
||||
|
||||
#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
|
||||
|
||||
typedef OMX_U32 OMX_PTR;
|
||||
typedef OMX_PTR OMX_STRING;
|
||||
typedef OMX_PTR OMX_BYTE;
|
||||
|
||||
#else
|
||||
|
||||
/** The OMX_PTR type is intended to be used to pass pointers between the OMX
|
||||
applications and the OMX Core and components. This is a 32 bit pointer and
|
||||
is aligned on a 32 bit boundary.
|
||||
*/
|
||||
typedef void* OMX_PTR;
|
||||
|
||||
/** The OMX_STRING type is intended to be used to pass "C" type strings between
|
||||
the application and the core and component. The OMX_STRING type is a 32
|
||||
bit pointer to a zero terminated string. The pointer is word aligned and
|
||||
the string is byte aligned.
|
||||
*/
|
||||
typedef char* OMX_STRING;
|
||||
|
||||
/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
|
||||
buffers between the application and the component and core. The OMX_BYTE
|
||||
type is a 32 bit pointer to a zero terminated string. The pointer is word
|
||||
aligned and the string is byte aligned.
|
||||
*/
|
||||
typedef unsigned char* OMX_BYTE;
|
||||
|
||||
/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
|
||||
at runtime. This identifier should be generated by a component in a way
|
||||
that guarantees that every instance of the identifier running on the system
|
||||
is unique. */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
typedef unsigned char OMX_UUIDTYPE[128];
|
||||
|
||||
/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
|
||||
an output port. This enumeration is common across all component types.
|
||||
*/
|
||||
typedef enum OMX_DIRTYPE
|
||||
{
|
||||
OMX_DirInput, /**< Port is an input port */
|
||||
OMX_DirOutput, /**< Port is an output port */
|
||||
OMX_DirMax = 0x7FFFFFFF
|
||||
} OMX_DIRTYPE;
|
||||
|
||||
/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
|
||||
for numerical data (i.e. big endian, or little endian).
|
||||
*/
|
||||
typedef enum OMX_ENDIANTYPE
|
||||
{
|
||||
OMX_EndianBig, /**< big endian */
|
||||
OMX_EndianLittle, /**< little endian */
|
||||
OMX_EndianMax = 0x7FFFFFFF
|
||||
} OMX_ENDIANTYPE;
|
||||
|
||||
|
||||
/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
|
||||
is signed or unsigned
|
||||
*/
|
||||
typedef enum OMX_NUMERICALDATATYPE
|
||||
{
|
||||
OMX_NumericalDataSigned, /**< signed data */
|
||||
OMX_NumericalDataUnsigned, /**< unsigned data */
|
||||
OMX_NumercialDataMax = 0x7FFFFFFF
|
||||
} OMX_NUMERICALDATATYPE;
|
||||
|
||||
|
||||
/** Unsigned bounded value type */
|
||||
typedef struct OMX_BU32 {
|
||||
OMX_U32 nValue; /**< actual value */
|
||||
OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
|
||||
OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
|
||||
} OMX_BU32;
|
||||
|
||||
|
||||
/** Signed bounded value type */
|
||||
typedef struct OMX_BS32 {
|
||||
OMX_S32 nValue; /**< actual value */
|
||||
OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
|
||||
OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
|
||||
} OMX_BS32;
|
||||
|
||||
|
||||
/** Structure representing some time or duration in microseconds. This structure
|
||||
* must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
|
||||
* negative deltas and preroll scenarios. The quantity is represented in microseconds
|
||||
* to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
|
||||
* on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
|
||||
* individual audio samples delivered at 192 kHz). The quantity is 64 bit to
|
||||
* accommodate a large dynamic range (signed 32 bit values would allow only for plus
|
||||
* or minus 35 minutes).
|
||||
*
|
||||
* Implementations with limited precision may convert the signed 64 bit value to
|
||||
* a signed 32 bit value internally but risk loss of precision.
|
||||
*/
|
||||
#ifndef OMX_SKIP64BIT
|
||||
typedef OMX_S64 OMX_TICKS;
|
||||
#else
|
||||
typedef struct OMX_TICKS
|
||||
{
|
||||
OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */
|
||||
OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */
|
||||
} OMX_TICKS;
|
||||
#endif
|
||||
#define OMX_TICKS_PER_SECOND 1000000
|
||||
|
||||
/** Define the public interface for the OMX Handle. The core will not use
|
||||
this value internally, but the application should only use this value.
|
||||
*/
|
||||
typedef void* OMX_HANDLETYPE;
|
||||
|
||||
typedef struct OMX_MARKTYPE
|
||||
{
|
||||
OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will
|
||||
generate a mark event upon
|
||||
processing the mark. */
|
||||
OMX_PTR pMarkData; /**< Application specific data associated with
|
||||
the mark sent on a mark event to disambiguate
|
||||
this mark from others. */
|
||||
} OMX_MARKTYPE;
|
||||
|
||||
|
||||
/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
|
||||
* platform & operating specific object used to reference the display
|
||||
* or can be used by a audio port for native audio rendering */
|
||||
typedef void* OMX_NATIVE_DEVICETYPE;
|
||||
|
||||
/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
|
||||
* platform & operating specific object used to reference the window */
|
||||
typedef void* OMX_NATIVE_WINDOWTYPE;
|
||||
|
||||
/** The OMX_VERSIONTYPE union is used to specify the version for
|
||||
a structure or component. For a component, the version is entirely
|
||||
specified by the component vendor. Components doing the same function
|
||||
from different vendors may or may not have the same version. For
|
||||
structures, the version shall be set by the entity that allocates the
|
||||
structure. For structures specified in the OMX 1.1 specification, the
|
||||
value of the version shall be set to 1.1.0.0 in all cases. Access to the
|
||||
OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
|
||||
by accessing one of the structure elements to, for example, check only
|
||||
the Major revision.
|
||||
*/
|
||||
typedef union OMX_VERSIONTYPE
|
||||
{
|
||||
struct
|
||||
{
|
||||
OMX_U8 nVersionMajor; /**< Major version accessor element */
|
||||
OMX_U8 nVersionMinor; /**< Minor version accessor element */
|
||||
OMX_U8 nRevision; /**< Revision version accessor element */
|
||||
OMX_U8 nStep; /**< Step version accessor element */
|
||||
} s;
|
||||
OMX_U32 nVersion; /**< 32 bit value to make accessing the
|
||||
version easily done in a single word
|
||||
size copy/compare operation */
|
||||
} OMX_VERSIONTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
||||
1082
third_party/openmax/include/OMX_Video.h
vendored
1082
third_party/openmax/include/OMX_Video.h
vendored
File diff suppressed because it is too large
Load Diff
166
third_party/openmax/include/OMX_VideoExt.h
vendored
166
third_party/openmax/include/OMX_VideoExt.h
vendored
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
/** OMX_VideoExt.h - OpenMax IL version 1.1.2
|
||||
* The OMX_VideoExt header file contains extensions to the
|
||||
* definitions used by both the application and the component to
|
||||
* access video items.
|
||||
*/
|
||||
|
||||
#ifndef OMX_VideoExt_h
|
||||
#define OMX_VideoExt_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Each OMX header shall include all required header files to allow the
|
||||
* header to compile without errors. The includes below are required
|
||||
* for this header file to compile successfully
|
||||
*/
|
||||
#include <OMX_Core.h>
|
||||
|
||||
/** NALU Formats */
|
||||
typedef enum OMX_NALUFORMATSTYPE {
|
||||
OMX_NaluFormatStartCodes = 1,
|
||||
OMX_NaluFormatOneNaluPerBuffer = 2,
|
||||
OMX_NaluFormatOneByteInterleaveLength = 4,
|
||||
OMX_NaluFormatTwoByteInterleaveLength = 8,
|
||||
OMX_NaluFormatFourByteInterleaveLength = 16,
|
||||
OMX_NaluFormatCodingMax = 0x7FFFFFFF
|
||||
} OMX_NALUFORMATSTYPE;
|
||||
|
||||
/** NAL Stream Format */
|
||||
typedef struct OMX_NALSTREAMFORMATTYPE{
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_NALUFORMATSTYPE eNaluFormat;
|
||||
} OMX_NALSTREAMFORMATTYPE;
|
||||
|
||||
/** VP8 profiles */
|
||||
typedef enum OMX_VIDEO_VP8PROFILETYPE {
|
||||
OMX_VIDEO_VP8ProfileMain = 0x01,
|
||||
OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF,
|
||||
OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_VP8PROFILETYPE;
|
||||
|
||||
/** VP8 levels */
|
||||
typedef enum OMX_VIDEO_VP8LEVELTYPE {
|
||||
OMX_VIDEO_VP8Level_Version0 = 0x01,
|
||||
OMX_VIDEO_VP8Level_Version1 = 0x02,
|
||||
OMX_VIDEO_VP8Level_Version2 = 0x04,
|
||||
OMX_VIDEO_VP8Level_Version3 = 0x08,
|
||||
OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF,
|
||||
OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_VP8LEVELTYPE;
|
||||
|
||||
/** VP8 Param */
|
||||
typedef struct OMX_VIDEO_PARAM_VP8TYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_VIDEO_VP8PROFILETYPE eProfile;
|
||||
OMX_VIDEO_VP8LEVELTYPE eLevel;
|
||||
OMX_U32 nDCTPartitions;
|
||||
OMX_BOOL bErrorResilientMode;
|
||||
} OMX_VIDEO_PARAM_VP8TYPE;
|
||||
|
||||
/** Structure for configuring VP8 reference frames */
|
||||
typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bPreviousFrameRefresh;
|
||||
OMX_BOOL bGoldenFrameRefresh;
|
||||
OMX_BOOL bAlternateFrameRefresh;
|
||||
OMX_BOOL bUsePreviousFrame;
|
||||
OMX_BOOL bUseGoldenFrame;
|
||||
OMX_BOOL bUseAlternateFrame;
|
||||
} OMX_VIDEO_VP8REFERENCEFRAMETYPE;
|
||||
|
||||
/** Structure for querying VP8 reference frame type */
|
||||
typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bIsIntraFrame;
|
||||
OMX_BOOL bIsGoldenOrAlternateFrame;
|
||||
} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE;
|
||||
|
||||
/** HEVC Profiles */
|
||||
typedef enum OMX_VIDEO_HEVCPROFILETYPE {
|
||||
OMX_VIDEO_HEVCProfileMain = 0x01,
|
||||
OMX_VIDEO_HEVCProfileMain10 = 0x02,
|
||||
OMX_VIDEO_HEVCProfileUnknown = 0x6EFFFFFF,
|
||||
OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_HEVCPROFILETYPE;
|
||||
|
||||
/** HEVC levels */
|
||||
typedef enum OMX_VIDEO_HEVCLEVELTYPE {
|
||||
OMX_VIDEO_HEVCLevel_Version0 = 0x0,
|
||||
OMX_VIDEO_HEVCMainTierLevel1 = 0x1,
|
||||
OMX_VIDEO_HEVCHighTierLevel1 = 0x2,
|
||||
OMX_VIDEO_HEVCMainTierLevel2 = 0x4,
|
||||
OMX_VIDEO_HEVCHighTierLevel2 = 0x8,
|
||||
OMX_VIDEO_HEVCMainTierLevel21 = 0x10,
|
||||
OMX_VIDEO_HEVCHighTierLevel21 = 0x20,
|
||||
OMX_VIDEO_HEVCMainTierLevel3 = 0x40,
|
||||
OMX_VIDEO_HEVCHighTierLevel3 = 0x80,
|
||||
OMX_VIDEO_HEVCMainTierLevel31 = 0x100,
|
||||
OMX_VIDEO_HEVCHighTierLevel31 = 0x200,
|
||||
OMX_VIDEO_HEVCMainTierLevel4 = 0x400,
|
||||
OMX_VIDEO_HEVCHighTierLevel4 = 0x800,
|
||||
OMX_VIDEO_HEVCMainTierLevel41 = 0x1000,
|
||||
OMX_VIDEO_HEVCHighTierLevel41 = 0x2000,
|
||||
OMX_VIDEO_HEVCMainTierLevel5 = 0x4000,
|
||||
OMX_VIDEO_HEVCHighTierLevel5 = 0x8000,
|
||||
OMX_VIDEO_HEVCMainTierLevel51 = 0x10000,
|
||||
OMX_VIDEO_HEVCHighTierLevel51 = 0x20000,
|
||||
OMX_VIDEO_HEVCMainTierLevel52 = 0x40000,
|
||||
OMX_VIDEO_HEVCHighTierLevel52 = 0x80000,
|
||||
OMX_VIDEO_HEVCMainTierLevel6 = 0x100000,
|
||||
OMX_VIDEO_HEVCHighTierLevel6 = 0x200000,
|
||||
OMX_VIDEO_HEVCMainTierLevel61 = 0x400000,
|
||||
OMX_VIDEO_HEVCHighTierLevel61 = 0x800000,
|
||||
OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000,
|
||||
OMX_VIDEO_HEVCLevelUnknown = 0x6EFFFFFF,
|
||||
OMX_VIDEO_HEVCLevelMax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_HEVCLEVELTYPE;
|
||||
|
||||
/** HEVC Param */
|
||||
typedef struct OMX_VIDEO_PARAM_HEVCTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_VIDEO_HEVCPROFILETYPE eProfile;
|
||||
OMX_VIDEO_HEVCLEVELTYPE eLevel;
|
||||
} OMX_VIDEO_PARAM_HEVCTYPE;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* OMX_VideoExt_h */
|
||||
/* File EOF */
|
||||
@@ -11,10 +11,7 @@ V4L2_BUF_FLAG_KEYFRAME = 8
|
||||
|
||||
def writer(fn, addr, sock_name):
|
||||
import cereal.messaging as messaging
|
||||
HEADER = b"\x00\x00\x00\x01\x40\x01\x0c\x01\xff\xff\x01\x60\x00\x00\x03\x00\xb0\x00\x00\x03\x00\x00\x03\x00\x96\xac\x09\x00\x00\x00\x01\x42\x01\x01\x01\x60\x00\x00\x03\x00\xb0\x00\x00\x03\x00\x00\x03\x00\x96\xa0\x03\xd0\x80\x13\x07\x1b\x2e\x5a\xee\x4c\x92\xea\x00\xbb\x42\x84\xa0\x00\x00\x00\x01\x44\x01\xc0\xe2\x4f\x09\xc1\x80\xc6\x08\x40\x00"
|
||||
fifo_file = open(fn, "wb")
|
||||
fifo_file.write(HEADER)
|
||||
fifo_file.flush()
|
||||
|
||||
os.environ["ZMQ"] = "1"
|
||||
messaging.context = messaging.Context()
|
||||
@@ -26,23 +23,25 @@ def writer(fn, addr, sock_name):
|
||||
msgs = messaging.drain_sock(sock, wait_for_one=True)
|
||||
for evt in msgs:
|
||||
evta = getattr(evt, evt.which())
|
||||
lat = ((evt.logMonoTime/1e9) - (evta.timestampEof/1e6))*1000
|
||||
print("%2d %4d %.3f %.3f latency %.2f ms" % (len(msgs), evta.idx, evt.logMonoTime/1e9, evta.timestampEof/1e6, lat), len(evta.data), sock_name)
|
||||
if evta.idx != 0 and evta.idx != (last_idx+1):
|
||||
lat = ((evt.logMonoTime/1e9) - (evta.idx.timestampEof/1e9))*1000
|
||||
print("%2d %4d %.3f %.3f latency %.2f ms" % (len(msgs), evta.idx.encodeId, evt.logMonoTime/1e9, evta.idx.timestampEof/1e6, lat), len(evta.data), sock_name)
|
||||
if evta.idx.encodeId != 0 and evta.idx.encodeId != (last_idx+1):
|
||||
print("DROP!")
|
||||
last_idx = evta.idx
|
||||
if evta.flags & V4L2_BUF_FLAG_KEYFRAME or evta.flags == 0x7f001030:
|
||||
last_idx = evta.idx.encodeId
|
||||
if evta.idx.flags & V4L2_BUF_FLAG_KEYFRAME:
|
||||
fifo_file.write(evta.header)
|
||||
seen_iframe = True
|
||||
if not seen_iframe:
|
||||
print("waiting for iframe")
|
||||
continue
|
||||
fifo_file.write(evta.data)
|
||||
fifo_file.flush()
|
||||
|
||||
FFMPEG_OPTIONS = {"probesize": "32", "flags": "low_delay"}
|
||||
|
||||
def decoder_nvidia(fn, vipc_server, vst, yuv=True, rgb=False):
|
||||
sys.path.append("/raid.dell2/PyNvCodec")
|
||||
import PyNvCodec as nvc # pylint: disable=import-error
|
||||
decoder = nvc.PyNvDecoder(fn, 0, {"probesize": "32"})
|
||||
decoder = nvc.PyNvDecoder(fn, 0, FFMPEG_OPTIONS)
|
||||
cc1 = nvc.ColorspaceConversionContext(nvc.ColorSpace.BT_709, nvc.ColorRange.JPEG)
|
||||
|
||||
if rgb:
|
||||
@@ -72,7 +71,7 @@ def decoder_nvidia(fn, vipc_server, vst, yuv=True, rgb=False):
|
||||
|
||||
def decoder_ffmpeg(fn, vipc_server, vst, yuv=True, rgb=False):
|
||||
import av # pylint: disable=import-error
|
||||
container = av.open(fn, options={"probesize": "32"})
|
||||
container = av.open(fn, options=FFMPEG_OPTIONS)
|
||||
cnt = 0
|
||||
for frame in container.decode(video=0):
|
||||
if rgb:
|
||||
@@ -87,6 +86,7 @@ import argparse
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description='Decode video streams and broacast on VisionIPC')
|
||||
parser.add_argument("addr", help="Address of comma 3")
|
||||
parser.add_argument('--pipes', action='store_true', help='Only create pipes')
|
||||
parser.add_argument('--nvidia', action='store_true', help='Use nvidia instead of ffmpeg')
|
||||
parser.add_argument('--rgb', action='store_true', help='Also broadcast RGB')
|
||||
parser.add_argument("--cams", default="0,1,2", help="Cameras to decode")
|
||||
@@ -112,7 +112,9 @@ if __name__ == "__main__":
|
||||
os.unlink(FIFO_NAME)
|
||||
os.mkfifo(FIFO_NAME)
|
||||
multiprocessing.Process(target=writer, args=(FIFO_NAME, sys.argv[1], k)).start()
|
||||
if args.nvidia:
|
||||
if args.pipes:
|
||||
print("connect to", FIFO_NAME)
|
||||
elif args.nvidia:
|
||||
multiprocessing.Process(target=decoder_nvidia, args=(FIFO_NAME, vipc_server, v, True, args.rgb)).start()
|
||||
else:
|
||||
multiprocessing.Process(target=decoder_ffmpeg, args=(FIFO_NAME, vipc_server, v, True, args.rgb)).start()
|
||||
|
||||
Reference in New Issue
Block a user