Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2014-02-09 00:01:26 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-02-09 20:15:19 +0400
commit5965adeb20476071e8f2d0d579c57fe1d2483764 (patch)
tree812a01b7e2b45096540930bf404c61e8f67d3776 /libavdevice/decklink_enc_c.c
parent36a62979537018a3c1572ede96dce6316b7daf5d (diff)
lavd: add decklink output device
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/decklink_enc_c.c')
-rw-r--r--libavdevice/decklink_enc_c.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
new file mode 100644
index 0000000000..b98e0b4fa4
--- /dev/null
+++ b/libavdevice/decklink_enc_c.c
@@ -0,0 +1,55 @@
+/*
+ * Blackmagic DeckLink output
+ * Copyright (c) 2013-2014 Ramiro Polla
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavformat/avformat.h"
+#include "libavutil/opt.h"
+
+#include "decklink_enc.h"
+
+#define OFFSET(x) offsetof(struct decklink_cctx, x)
+#define ENC AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "list_devices", "list available devices" , OFFSET(list_devices), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },
+ { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },
+ { "preroll" , "video preroll in seconds", OFFSET(preroll ), AV_OPT_TYPE_DOUBLE, { .dbl = 0.5 }, 0, 5, ENC },
+ { NULL },
+};
+
+static const AVClass decklink_muxer_class = {
+ .class_name = "Blackmagic DeckLink muxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVOutputFormat ff_decklink_muxer = {
+ .name = "decklink",
+ .long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"),
+ .audio_codec = AV_CODEC_ID_PCM_S16LE,
+ .video_codec = AV_CODEC_ID_RAWVIDEO,
+ .subtitle_codec = AV_CODEC_ID_NONE,
+ .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
+ .priv_class = &decklink_muxer_class,
+ .priv_data_size = sizeof(struct decklink_cctx),
+ .write_header = ff_decklink_write_header,
+ .write_packet = ff_decklink_write_packet,
+ .write_trailer = ff_decklink_write_trailer,
+};