// SPDX-License-Identifier: GPL-2.0-or-later /* * VIDEO MOTION CODECs internal API for video devices * * Interface for MJPEG (and maybe later MPEG/WAVELETS) codec's * bound to a master device. * * (c) 2002 Wolfgang Scherr <scherr@net4you.at>
*/
/* ================================================= */ /* function prototypes of the master/slave interface */ /* ================================================= */
if (!h) {
zrdev_err(zr, "%s: no device available\n", __func__); return NULL;
}
while (h) { // attach only if the slave has at least the flags // expected by the master if ((master->flags & h->codec->flags) == master->flags) {
zrdev_dbg(zr, "%s: try '%s'\n", __func__, h->codec->name);
codec = kmemdup(h->codec, sizeof(struct videocodec), GFP_KERNEL); if (!codec) goto out_kfree;
res = strlen(codec->name);
snprintf(codec->name + res, sizeof(codec->name) - res, "[%d]", h->attached);
codec->master_data = master;
res = codec->setup(codec); if (res == 0) {
zrdev_dbg(zr, "%s: '%s'\n", __func__, codec->name);
ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); if (!ptr) goto out_kfree;
ptr->codec = codec;
a = h->list; if (!a) {
h->list = ptr;
zrdev_dbg(zr, "videocodec: first element\n");
} else { while (a->next)
a = a->next; // find end
a->next = ptr;
zrdev_dbg(zr, "videocodec: in after '%s'\n",
h->codec->name);
}
if (!h) {
codeclist_top = ptr;
zrdev_dbg(zr, "videocodec: hooked in as first element\n");
} else { while (h->next)
h = h->next; // find the end
h->next = ptr;
zrdev_dbg(zr, "videocodec: hooked in after '%s'\n",
h->codec->name);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.