• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wtay@chello.be>
4  *                    2006 Wim Taymans <wim@fluendo.com>
5  *                    2006 David A. Schleef <ds@schleef.org>
6  *
7  * gstmultifilesink.c:
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  */
24 
25 #ifdef HAVE_CONFIG_H
26 #  include "config.h"
27 #endif
28 
29 #include <gst/gst.h>
30 
31 /* ohos.ext.func.0002 */
32 #ifdef OHOS_EXT_FUNC
33 #include "gstsplitmuxsink.h"
34 #else
35 #include "gstmultifilesink.h"
36 #include "gstmultifilesrc.h"
37 #include "gstsplitfilesrc.h"
38 #include "gstsplitmuxsink.h"
39 #include "gstsplitmuxsrc.h"
40 #endif
41 
42 static gboolean
plugin_init(GstPlugin * plugin)43 plugin_init (GstPlugin * plugin)
44 {
45 /* ohos.ext.func.0002: The media service need splitmuxsink element to support recording file split feature.
46  * But the other elements have compilation dependence. So, only enable the compilation of necessary elements.
47  */
48 #ifdef OHOS_EXT_FUNC
49   if (!register_splitmuxsink (plugin))
50     return FALSE;
51 #else
52   gst_element_register (plugin, "multifilesrc", GST_RANK_NONE,
53       gst_multi_file_src_get_type ());
54   gst_element_register (plugin, "multifilesink", GST_RANK_NONE,
55       gst_multi_file_sink_get_type ());
56   gst_element_register (plugin, "splitfilesrc", GST_RANK_NONE,
57       gst_split_file_src_get_type ());
58   if (!register_splitmuxsink (plugin))
59     return FALSE;
60 
61   if (!register_splitmuxsrc (plugin))
62     return FALSE;
63 #endif
64 
65   return TRUE;
66 }
67 
68 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
69     GST_VERSION_MINOR,
70     multifile,
71     "Reads/Writes buffers from/to sequentially named files",
72     plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
73