1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
/*
* encode_null.c -- produces empty (as in zero-sized) A/V frames.
* (C) 2005-2010 Francesco Romani <fromani at gmail dot com>
*
* This file is part of transcode, a video stream processing tool.
*
* transcode 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 2 of the License, or
* (at your option) any later version.
*
* transcode 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/>.
*/
#include "transcode.h"
#include "framebuffer.h"
#include "libtc/optstr.h"
#include "libtc/tcmodule-plugin.h"
#define MOD_NAME "encode_null.so"
#define MOD_VERSION "v0.0.3 (2005-06-05)"
#define MOD_CAP "null (fake) A/V encoder"
#define MOD_FEATURES \
TC_MODULE_FEATURE_ENCODE|TC_MODULE_FEATURE_VIDEO|TC_MODULE_FEATURE_AUDIO
#define MOD_FLAGS \
TC_MODULE_FLAG_RECONFIGURABLE
static const char null_help[] = ""
"Overview:\n"
" this module absorbs provided A/V frames and produces fake,"
" empty \"encoded\" frames.\n"
"Options:\n"
" help produce module overview and options explanations\n";
static int null_init(TCModuleInstance *self, uint32_t features)
{
TC_MODULE_SELF_CHECK(self, "init");
TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);
if (verbose) {
tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CAP);
}
self->userdata = NULL;
return TC_OK;
}
static int null_fini(TCModuleInstance *self)
{
TC_MODULE_SELF_CHECK(self, "fini");
return TC_OK;
}
static int null_configure(TCModuleInstance *self,
const char *options, vob_t *vob)
{
TC_MODULE_SELF_CHECK(self, "configure");
return TC_OK;
}
static int null_inspect(TCModuleInstance *self,
const char *param, const char **value)
{
TC_MODULE_SELF_CHECK(self, "inspect");
if (optstr_lookup(param, "help")) {
*value = null_help;
}
return TC_OK;
}
static int null_stop(TCModuleInstance *self)
{
TC_MODULE_SELF_CHECK(self, "stop");
return TC_OK;
}
static int null_encode_video(TCModuleInstance *self,
vframe_list_t *inframe, vframe_list_t *outframe)
{
TC_MODULE_SELF_CHECK(self, "encode_video");
outframe->video_len = 0;
return TC_OK;
}
static int null_encode_audio(TCModuleInstance *self,
aframe_list_t *inframe, aframe_list_t *outframe)
{
TC_MODULE_SELF_CHECK(self, "encode_audio");
outframe->audio_len = 0;
return TC_OK;
}
/*************************************************************************/
static const TCCodecID null_codecs_in[] = { TC_CODEC_ANY, TC_CODEC_ERROR };
static const TCCodecID null_codecs_out[] = { TC_CODEC_ANY, TC_CODEC_ERROR };
TC_MODULE_CODEC_FORMATS(null);
TC_MODULE_INFO(null);
static const TCModuleClass null_class = {
TC_MODULE_CLASS_HEAD(null),
.init = null_init,
.fini = null_fini,
.configure = null_configure,
.stop = null_stop,
.inspect = null_inspect,
.encode_video = null_encode_video,
.encode_audio = null_encode_audio,
};
TC_MODULE_ENTRY_POINT(null)
/*************************************************************************/
/*
* Local variables:
* c-file-style: "stroustrup"
* c-file-offsets: ((case-label . *) (statement-case-intro . *))
* indent-tabs-mode: nil
* End:
*
* vim: expandtab shiftwidth=4:
*/
|