2 * Copyright (C) 2011 Andoni Morales Alastruey <ylatuya@gmail.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __GSTFRAGMENT_H__
23 #define __GSTFRAGMENT_H__
25 #include <glib-object.h>
30 #define GST_TYPE_FRAGMENT (gst_fragment_get_type())
31 #define GST_FRAGMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FRAGMENT,GstFragment))
32 #define GST_FRAGMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FRAGMENT,GstFragmentClass))
33 #define GST_IS_FRAGMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FRAGMENT))
34 #define GST_IS_FRAGMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FRAGMENT))
36 typedef struct _GstFragment GstFragment;
37 typedef struct _GstFragmentPrivate GstFragmentPrivate;
38 typedef struct _GstFragmentClass GstFragmentClass;
44 gchar * name; /* Name of the fragment */
45 gboolean completed; /* Whether the fragment is complete or not */
46 guint64 download_start_time; /* Epoch time when the download started */
47 guint64 download_stop_time; /* Epoch time when the download finished */
48 guint64 start_time; /* Start time of the fragment */
49 guint64 stop_time; /* Stop time of the fragment */
50 gboolean index; /* Index of the fragment */
51 gboolean discontinuous; /* Whether this fragment is discontinuous or not */
53 GstFragmentPrivate *priv;
56 struct _GstFragmentClass
58 GObjectClass parent_class;
61 GType gst_fragment_get_type (void);
63 guint64 gst_fragment_get_total_size (GstFragment * fragment);
64 GstBuffer *gst_fragment_get_buffer(GstFragment *fragment);
65 gboolean gst_fragment_add_buffer (GstFragment *fragment, GstBuffer *buffer);
66 GstFragment * gst_fragment_new (void);
69 #endif /* __GSTFRAGMENT_H__ */