FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
decklink_common.h
Go to the documentation of this file.
1 /*
2  * Blackmagic DeckLink common code
3  * Copyright (c) 2013-2014 Ramiro Polla, Luca Barbato, Deti Fliegl
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "decklink_common_c.h"
23 
26 
27 typedef struct AVPacketQueue {
30  unsigned long long size;
36 
37 struct decklink_ctx {
38  /* DeckLink SDK interfaces */
39  IDeckLink *dl;
40  IDeckLinkOutput *dlo;
41  IDeckLinkInput *dli;
44 
45  /* DeckLink mode information */
46  BMDTimeValue bmd_tb_den;
47  BMDTimeValue bmd_tb_num;
48  BMDDisplayMode bmd_mode;
49  int bmd_width;
52 
53  /* Capture buffer queue */
55 
56  /* Streams present */
57  int audio;
58  int video;
59 
60  /* Status */
63  int64_t last_pts;
64  unsigned long frameCount;
65  unsigned int dropped;
68 
69  /* Options */
72  double preroll;
73 
76 
77  sem_t semaphore;
78 
79  int channels;
80 };
81 
83 
84 #ifdef _WIN32
85 typedef unsigned long buffercount_type;
86 IDeckLinkIterator *CreateDeckLinkIteratorInstance(void);
87 #else
88 typedef uint32_t buffercount_type;
89 #endif
90 
91 
92 HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName);
93 int ff_decklink_set_format(AVFormatContext *avctx, int width, int height, int tb_num, int tb_den, decklink_direction_t direction = DIRECTION_OUT, int num = 0);
94 int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t direction, int num);
97