2013-09-30 19:37:13 -07:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
2013-10-14 04:21:15 -07:00
|
|
|
#pragma once
|
2013-09-30 19:37:13 -07:00
|
|
|
|
|
|
|
#include "../util/c99defs.h"
|
|
|
|
#include "media-io.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Base video output component. Use this to create an video output track
|
|
|
|
* for the media.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct video_output;
|
|
|
|
typedef struct video_output *video_t;
|
|
|
|
|
2013-10-24 00:57:55 -07:00
|
|
|
enum video_type {
|
|
|
|
VIDEO_FORMAT_UNKNOWN,
|
|
|
|
VIDEO_FORMAT_YUV444,
|
|
|
|
VIDEO_FORMAT_YUV422,
|
|
|
|
VIDEO_FORMAT_YUV420,
|
|
|
|
VIDEO_FORMAT_RGBA,
|
|
|
|
VIDEO_FORMAT_BGRA,
|
|
|
|
VIDEO_FORMAT_BGRX,
|
|
|
|
};
|
|
|
|
|
2013-09-30 19:37:13 -07:00
|
|
|
struct video_frame {
|
|
|
|
const void *data;
|
|
|
|
uint32_t row_size;
|
|
|
|
uint64_t timestamp;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct video_info {
|
2013-10-24 00:57:55 -07:00
|
|
|
const char *name;
|
|
|
|
const char *format;
|
2013-09-30 19:37:13 -07:00
|
|
|
|
2013-10-24 00:57:55 -07:00
|
|
|
enum video_type type;
|
|
|
|
uint32_t fps_num; /* numerator */
|
|
|
|
uint32_t fps_den; /* denominator */
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
2013-09-30 19:37:13 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#define VIDEO_OUTPUT_SUCCESS 0
|
|
|
|
#define VIDEO_OUTPUT_INVALIDPARAM -1
|
|
|
|
#define VIDEO_OUTPUT_FAIL -2
|
|
|
|
|
|
|
|
EXPORT int video_output_open(video_t *video, media_t media,
|
|
|
|
struct video_info *info);
|
|
|
|
EXPORT void video_output_frame(video_t video, struct video_frame *frame);
|
|
|
|
EXPORT bool video_output_wait(video_t video);
|
|
|
|
EXPORT uint64_t video_getframetime(video_t video);
|
|
|
|
EXPORT uint64_t video_gettime(video_t video);
|
|
|
|
EXPORT void video_output_stop(video_t video);
|
|
|
|
EXPORT void video_output_close(video_t video);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|