1 /*
2 * GPAC - Multimedia Framework C SDK
3 *
4 * Authors: Jean Le Feuvre
5 * Copyright (c) Telecom ParisTech 2000-2012
6 * All rights reserved
7 *
8 * This file is part of GPAC / FFMPEG module
9 *
10 * GPAC is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
14 *
15 * GPAC is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; see the file COPYING. If not, write to
22 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 */
25
26 #include "ffmpeg_in.h"
27
28
29 #if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(__GNUC__)
30
31 #if defined(_WIN32_WCE)
32 #pragma comment(lib, "toolhelp")
33 #pragma comment(lib, "winsock")
34 #endif
35
36 #define _TOSTR(_val) #_val
37 #define TOSTR(_val) _TOSTR(_val)
38
39 #endif
40
41 GPAC_MODULE_EXPORT
QueryInterfaces()42 const u32 *QueryInterfaces()
43 {
44 static u32 si [] = {
45 GF_MEDIA_DECODER_INTERFACE,
46 #ifndef DISABLE_FFMPEG_DEMUX
47 GF_NET_CLIENT_INTERFACE,
48 #endif
49 0
50 };
51 return si;
52 }
53
54 GPAC_MODULE_EXPORT
LoadInterface(u32 InterfaceType)55 GF_BaseInterface *LoadInterface(u32 InterfaceType)
56 {
57 if (InterfaceType == GF_MEDIA_DECODER_INTERFACE) return (GF_BaseInterface*)FFDEC_Load();
58 #ifndef DISABLE_FFMPEG_DEMUX
59 if (InterfaceType == GF_NET_CLIENT_INTERFACE) return (GF_BaseInterface*)New_FFMPEG_Demux();
60 #endif
61 return NULL;
62 }
63
64 GPAC_MODULE_EXPORT
ShutdownInterface(GF_BaseInterface * ifce)65 void ShutdownInterface(GF_BaseInterface *ifce)
66 {
67 switch (ifce->InterfaceType) {
68 case GF_MEDIA_DECODER_INTERFACE:
69 FFDEC_Delete(ifce);
70 break;
71 #ifndef DISABLE_FFMPEG_DEMUX
72 case GF_NET_CLIENT_INTERFACE:
73 Delete_FFMPEG_Demux(ifce);
74 break;
75 #endif
76 }
77 }
78
79
80 GPAC_MODULE_STATIC_DECLARATION( ffmpeg )
81