obs-output.h 1.8 KB
Newer Older
J
jp9000 已提交
1
/******************************************************************************
J
jp9000 已提交
2
    Copyright (C) 2013-2014 by Hugh Bailey <obs.jim@gmail.com>
J
jp9000 已提交
3 4 5

    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
6
    the Free Software Foundation, either version 2 of the License, or
J
jp9000 已提交
7 8 9 10 11 12 13 14 15 16 17
    (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/>.
******************************************************************************/

18
#pragma once
J
jp9000 已提交
19

J
jp9000 已提交
20 21 22 23 24 25 26
#define OBS_OUTPUT_VIDEO       (1<<0)
#define OBS_OUTPUT_AUDIO       (1<<1)
#define OBS_OUTPUT_AV          (OBS_OUTPUT_VIDEO | OBS_OUTPUT_AUDIO)
#define OBS_OUTPUT_ENCODED     (1<<2)

struct encoder_packet;

J
jp9000 已提交
27 28
struct obs_output_info {
	/* required */
29
	const char *id;
J
jp9000 已提交
30

J
jp9000 已提交
31 32
	uint32_t flags;

33 34
	const char *(*getname)(const char *locale);

J
jp9000 已提交
35
	void *(*create)(obs_data_t settings, obs_output_t output);
J
jp9000 已提交
36 37
	void (*destroy)(void *data);

38
	bool (*start)(void *data);
J
jp9000 已提交
39 40
	void (*stop)(void *data);

J
jp9000 已提交
41 42 43 44 45
	void (*raw_video)(void *data, struct video_data *frame);
	void (*raw_audio)(void *data, struct audio_data *frames);

	void (*encoded_video)(void *data, struct encoder_packet *packet);
	void (*encoded_audio)(void *data, struct encoder_packet *packet);
46

J
jp9000 已提交
47
	/* optional */
J
jp9000 已提交
48 49
	void (*update)(void *data, obs_data_t settings);

J
jp9000 已提交
50 51
	void (*defaults)(obs_data_t settings);

J
jp9000 已提交
52 53
	obs_properties_t (*properties)(const char *locale);

J
jp9000 已提交
54 55 56
	void (*pause)(void *data);
};

J
jp9000 已提交
57
EXPORT void obs_register_output(const struct obs_output_info *info);