1 /*
2 *			GPAC - Multimedia Framework C SDK
3 *
4 *			Authors: Romain Bouqueau, Jean Le Feuvre
5 *			Copyright (c) 2014-2016 GPAC Licensing
6 *			Copyright (c) 2016-2020 Telecom Paris
7 *					All rights reserved
8 *
9 *  This file is part of GPAC / Dektec SDI video output filter
10 *
11 *  GPAC is free software; you can redistribute it and/or modify
12 *  it under the terms of the GNU Lesser General Public License as published by
13 *  the Free Software Foundation; either version 2, or (at your option)
14 *  any later version.
15 *
16 *  GPAC is distributed in the hope that it will be useful,
17 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 *  GNU Lesser General Public License for more details.
20 *
21 *  You should have received a copy of the GNU Lesser General Public
22 *  License along with this library; see the file COPYING.  If not, write to
23 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 */
26 
27 #ifndef _GF_DEKTECVID_H_
28 #define _GF_DEKTECVID_H_
29 
30 #include <gpac/filters.h>
31 
32 
33 
34 //#define FAKE_DT_API
35 
36 #if defined(GPAC_HAS_DTAPI) && !defined(FAKE_DT_API)
37 #include <DTAPI.h>
38 #endif
39 
40 #include <gpac/constants.h>
41 #include <gpac/color.h>
42 #include <gpac/thread.h>
43 
44 #if defined(GPAC_HAS_DTAPI) && !defined(FAKE_DT_API)
45 
46 #if defined(WIN32) && !defined(__GNUC__)
47 # include <intrin.h>
48 #else
49 #  include <emmintrin.h>
50 #endif
51 
52 #endif
53 
54 
55 typedef struct {
56 	struct _dtout_ctx *ctx;
57 	GF_FilterPid *video; //null if audio callback
58 	GF_FilterPid *audio; //null if video callback
59 } DtCbkCtx;
60 
61 typedef struct _dtout_ctx
62 {
63 	//opts
64 	s32 bus, slot;
65 	GF_Fraction fps;
66 	Bool clip;
67 	u32 port;
68 	Double start;
69 
70 	u32 width, height, pix_fmt, stride, stride_uv, uv_height, nb_planes;
71 	GF_Fraction framerate;
72 	Bool is_sending, is_configured, is_10b, is_eos;
73 
74 #if defined(GPAC_HAS_DTAPI) && !defined(FAKE_DT_API)
75 	DtMxProcess *dt_matrix;
76 	DtDevice *dt_device;
77 	DtCbkCtx audio_cbk, video_cbk;
78 #endif
79 
80 	s64 frameNum;
81 	u64 init_clock, last_frame_time;
82 
83 	u32 frame_dur, frame_scale;
84 	Bool needs_reconfigure;
85 } GF_DTOutCtx;
86 
87 
88 #if defined(GPAC_HAS_DTAPI)
89 GF_Err dtout_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove);
90 GF_Err dtout_initialize(GF_Filter *filter);
91 void dtout_finalize(GF_Filter *filter);
92 GF_Err dtout_process(GF_Filter *filter);
93 #endif
94 
95 
96 #endif //_GF_DEKTECVID_H_
97 
98 
99